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 |
|---|---|---|---|---|---|---|---|
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import re
class DataRow(object):
_row_continuation_marker = '...'
_whitespace_regexp = re.compile('\s+')
_ye_olde_metadata_prefix = 'meta:'
def __init__(self, cells):
self.cells, self.comments = self._parse(cells)
def _parse(self, row):
data = []
comments = []
for cell in row:
cell = self._collapse_whitespace(cell)
if cell.startswith('#') and not comments:
comments.append(cell[1:])
elif comments:
comments.append(cell)
else:
data.append(cell)
return self._purge_empty_cells(data), self._purge_empty_cells(comments)
def _collapse_whitespace(self, cell):
return self._whitespace_regexp.sub(' ', cell).strip()
def _purge_empty_cells(self, row):
while row and not row[-1]:
row.pop()
# Cells with only a single backslash are considered empty
return [cell if cell != '\\' else '' for cell in row]
@property
def head(self):
return self.cells[0] if self.cells else None
@property
def _tail(self):
return self.cells[1:] if self.cells else None
@property
def all(self):
return self.cells
@property
def data(self):
if self.is_continuing():
index = self.cells.index(self._row_continuation_marker) + 1
return self.cells[index:]
return self.cells
def dedent(self):
datarow = DataRow([])
datarow.cells = self._tail
datarow.comments = self.comments
return datarow
def startswith(self, value):
return self.head() == value
def handle_old_style_metadata(self):
if self._is_metadata_with_olde_prefix(self.head):
self.cells = self._convert_to_new_style_metadata()
def _is_metadata_with_olde_prefix(self, value):
return value.lower().startswith(self._ye_olde_metadata_prefix)
def _convert_to_new_style_metadata(self):
return ['Metadata'] + [self.head.split(':', 1)[1].strip()] + self._tail
def starts_for_loop(self):
if self.head and self.head.startswith(':'):
return self.head.replace(':', '').replace(' ', '').upper() == 'FOR'
return False
def starts_test_or_user_keyword_setting(self):
head = self.head
return head and head[0] == '[' and head[-1] == ']'
def test_or_user_keyword_setting_name(self):
return self.head[1:-1].strip()
def is_indented(self):
return self.head == ''
def is_continuing(self):
for cell in self.cells:
if cell == self._row_continuation_marker:
return True
if cell:
return False
def is_commented(self):
return bool(not self.cells and self.comments)
def __nonzero__(self):
return bool(self.cells or self.comments)
| ajibawa-2023/Python-Code-Large/train/row_99878 | 70 | 112 | 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_99878:Import_L15_C0", "label": "re import re", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.1339, 0.0089, 0, 0.66, 0.0, 540, 0, 1, 0, 0, 540, 0, 0], "semantic": {"name": "re", "arg_names": [], "import_names": ["re"], "rhs_call_name": "", "annotation": ""}, "snippet": "import re"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99878:ClassDef_L18_C0", "label": "DataRow", "type": "class", "loc": [18, 112], "level": 0, "parent": null, "vector": [3, 0, 0.5804, 0.8482, 0, 0.66, 1.0, 207, 0, 20, 0, 0, 186, 0, 29], "semantic": {"name": "DataRow", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class DataRow(object):\n _row_continuation_marker = '...'\n _whitespace_regexp = re.compile('\\s+')\n _ye_olde_metadata_prefix = 'meta:'\n\n def __init__(self, cells):\n self.cells, self.comments = self._parse(cells)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99878:Assign_L19_C4", "label": "_row_continuation_marker =", "type": "assigned_variable", "loc": [19, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99878:ClassDef_L18_C0", "vector": [14, 1, 0.1696, 0.0089, 1, 0.67, 0.0, 909, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "_row_continuation_marker", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _row_continuation_marker = '...'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99878:Assign_L20_C4", "label": "_whitespace_regexp = compile()", "type": "assigned_variable", "loc": [20, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99878:ClassDef_L18_C0", "vector": [14, 1, 0.1786, 0.0089, 1, 0.67, 0.0455, 506, 3, 1, 0, 0, 821, 10, 1], "semantic": {"name": "_whitespace_regexp", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": " _whitespace_regexp = re.compile('\\s+')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99878:Assign_L21_C4", "label": "_ye_olde_metadata_prefix =", "type": "assigned_variable", "loc": [21, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99878:ClassDef_L18_C0", "vector": [14, 1, 0.1875, 0.0089, 1, 0.67, 0.0909, 222, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "_ye_olde_metadata_prefix", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _ye_olde_metadata_prefix = 'meta:'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L23_C4", "label": "__init__", "type": "function", "loc": [23, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99878:ClassDef_L18_C0", "vector": [2, 1, 0.2098, 0.0179, 1, 0.67, 0.1364, 555, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "cells"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, cells):\n self.cells, self.comments = self._parse(cells)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99878:Assign_L24_C8", "label": " = _parse()", "type": "assigned_variable", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L23_C4", "vector": [14, 2, 0.2143, 0.0089, 2, 0.35, 0.0, 0, 3, 1, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "_parse", "annotation": ""}, "snippet": " self.cells, self.comments = self._parse(cells)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L26_C4", "label": "_parse", "type": "function", "loc": [26, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99878:ClassDef_L18_C0", "vector": [2, 1, 0.2812, 0.1071, 1, 0.67, 0.1818, 0, 0, 2, 1, 0, 0, 0, 7], "semantic": {"name": "_parse", "arg_names": ["self", "row"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _parse(self, row):\n data = []\n comments = []\n for cell in row:\n cell = self._collapse_whitespace(cell)\n if cell.startswith('#') and not comments:\n comments.append(cell[1:])\n elif comments:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99878:Assign_L27_C8", "label": "data =", "type": "assigned_variable", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L26_C4", "vector": [14, 2, 0.2411, 0.0089, 2, 0.97, 0.0, 929, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " data = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99878:Assign_L28_C8", "label": "comments =", "type": "assigned_variable", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L26_C4", "vector": [14, 2, 0.25, 0.0089, 2, 0.97, 0.3333, 122, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "comments", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " comments = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99878:For_L29_C8", "label": "for cell", "type": "for", "loc": [29, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L26_C4", "vector": [6, 2, 0.2902, 0.0714, 2, 0.97, 0.6667, 787, 2, 0, 0, 0, 0, 0, 5], "semantic": {"name": "cell", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for cell in row:\n cell = self._collapse_whitespace(cell)\n if cell.startswith('#') and not comments:\n comments.append(cell[1:])\n elif comments:\n comments.append(cell)\n else:\n data.append(cell)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99878:Assign_L30_C12", "label": "cell = _collapse_whitespace()", "type": "assigned_variable", "loc": [30, 30], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99878:For_L29_C8", "vector": [14, 3, 0.2679, 0.0089, 3, 0.35, 0.0, 787, 3, 1, 0, 0, 280, 10, 1], "semantic": {"name": "cell", "arg_names": [], "import_names": [], "rhs_call_name": "_collapse_whitespace", "annotation": ""}, "snippet": " cell = self._collapse_whitespace(cell)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99878:If_L31_C12", "label": "if", "type": "if", "loc": [31, 36], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99878:For_L29_C8", "vector": [4, 3, 0.2991, 0.0536, 3, 0.35, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if cell.startswith('#') and not comments:\n comments.append(cell[1:])\n elif comments:\n comments.append(cell)\n else:\n data.append(cell)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99878:Expr_L32_C16", "label": "append()", "type": "expression", "loc": [32, 32], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99878:If_L31_C12", "vector": [8, 4, 0.2857, 0.0089, 4, 0.4, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " comments.append(cell[1:])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99878:If_L33_C12", "label": "if", "type": "if", "loc": [33, 36], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99878:If_L31_C12", "vector": [4, 4, 0.308, 0.0357, 4, 0.4, 1.0, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif comments:\n comments.append(cell)\n else:\n data.append(cell)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99878:Expr_L34_C16", "label": "append()", "type": "expression", "loc": [34, 34], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99878:If_L33_C12", "vector": [8, 5, 0.3036, 0.0089, 5, 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": " comments.append(cell)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99878:Expr_L36_C16", "label": "append()", "type": "expression", "loc": [36, 36], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99878:If_L33_C12", "vector": [8, 5, 0.3214, 0.0089, 5, 0.34, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " data.append(cell)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99878:Return_L37_C8", "label": "return", "type": "return", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L26_C4", "vector": [13, 2, 0.3304, 0.0089, 2, 0.97, 1.0, 0, 0, 0, 0, 0, 0, 8, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._purge_empty_cells(data), self._purge_empty_cells(comments)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L39_C4", "label": "_collapse_whitespace", "type": "function", "loc": [39, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99878:ClassDef_L18_C0", "vector": [2, 1, 0.3527, 0.0179, 1, 0.67, 0.2273, 280, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "_collapse_whitespace", "arg_names": ["self", "cell"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _collapse_whitespace(self, cell):\n return self._whitespace_regexp.sub(' ', cell).strip()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99878:Return_L40_C8", "label": "return", "type": "return", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L39_C4", "vector": [13, 2, 0.3571, 0.0089, 2, 0.29, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._whitespace_regexp.sub(' ', cell).strip()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L42_C4", "label": "_purge_empty_cells", "type": "function", "loc": [42, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99878:ClassDef_L18_C0", "vector": [2, 1, 0.3929, 0.0446, 1, 0.67, 0.2727, 538, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "_purge_empty_cells", "arg_names": ["self", "row"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _purge_empty_cells(self, row):\n while row and not row[-1]:\n row.pop()\n # Cells with only a single backslash are considered empty\n return [cell if cell != '\\\\' else '' for cell in row]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99878:While_L43_C8", "label": "while", "type": "while", "loc": [43, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L42_C4", "vector": [5, 2, 0.3884, 0.0179, 2, 0.99, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while row and not row[-1]:\n row.pop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99878:Expr_L44_C12", "label": "pop()", "type": "expression", "loc": [44, 44], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99878:While_L43_C8", "vector": [8, 3, 0.3929, 0.0089, 3, 0.57, 0.0, 969, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pop", "arg_names": [], "import_names": [], "rhs_call_name": "pop", "annotation": ""}, "snippet": " row.pop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99878:Return_L46_C8", "label": "return", "type": "return", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L42_C4", "vector": [13, 2, 0.4107, 0.0089, 2, 0.99, 1.0, 0, 5, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [cell if cell != '\\\\' else '' for cell in row]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L49_C4", "label": "head", "type": "function", "loc": [49, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99878:ClassDef_L18_C0", "vector": [2, 1, 0.442, 0.0179, 1, 0.67, 0.3182, 217, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "head", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def head(self):\n return self.cells[0] if self.cells else None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99878:Return_L50_C8", "label": "return", "type": "return", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L49_C4", "vector": [13, 2, 0.4464, 0.0089, 2, 0.79, 0.0, 0, 8, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.cells[0] if self.cells else None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L53_C4", "label": "_tail", "type": "function", "loc": [53, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99878:ClassDef_L18_C0", "vector": [2, 1, 0.4777, 0.0179, 1, 0.67, 0.3636, 812, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "_tail", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _tail(self):\n return self.cells[1:] if self.cells else None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99878:Return_L54_C8", "label": "return", "type": "return", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L53_C4", "vector": [13, 2, 0.4821, 0.0089, 2, 0.98, 0.0, 0, 8, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.cells[1:] if self.cells else None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L57_C4", "label": "all", "type": "function", "loc": [57, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99878:ClassDef_L18_C0", "vector": [2, 1, 0.5134, 0.0179, 1, 0.67, 0.4091, 895, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "all", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def all(self):\n return self.cells"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99878:Return_L58_C8", "label": "return", "type": "return", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L57_C4", "vector": [13, 2, 0.5179, 0.0089, 2, 0.18, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.cells"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L61_C4", "label": "data", "type": "function", "loc": [61, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99878:ClassDef_L18_C0", "vector": [2, 1, 0.5625, 0.0446, 1, 0.67, 0.4545, 929, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "data", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def data(self):\n if self.is_continuing():\n index = self.cells.index(self._row_continuation_marker) + 1\n return self.cells[index:]\n return self.cells"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99878:If_L62_C8", "label": "if", "type": "if", "loc": [62, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L61_C4", "vector": [4, 2, 0.5625, 0.0268, 2, 0.88, 0.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.is_continuing():\n index = self.cells.index(self._row_continuation_marker) + 1\n return self.cells[index:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99878:Assign_L63_C12", "label": "index =", "type": "assigned_variable", "loc": [63, 63], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99878:If_L62_C8", "vector": [14, 3, 0.5625, 0.0089, 3, 0.89, 0.0, 780, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "index", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " index = self.cells.index(self._row_continuation_marker) + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99878:Return_L64_C12", "label": "return", "type": "return", "loc": [64, 64], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99878:If_L62_C8", "vector": [13, 3, 0.5714, 0.0089, 3, 0.89, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.cells[index:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99878:Return_L65_C8", "label": "return", "type": "return", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L61_C4", "vector": [13, 2, 0.5804, 0.0089, 2, 0.88, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.cells"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L67_C4", "label": "dedent", "type": "function", "loc": [67, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99878:ClassDef_L18_C0", "vector": [2, 1, 0.6161, 0.0446, 1, 0.67, 0.5, 899, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "dedent", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def dedent(self):\n datarow = DataRow([])\n datarow.cells = self._tail\n datarow.comments = self.comments\n return datarow"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99878:Assign_L68_C8", "label": "datarow = DataRow()", "type": "assigned_variable", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L67_C4", "vector": [14, 2, 0.6071, 0.0089, 2, 0.45, 0.0, 496, 3, 1, 0, 0, 207, 10, 1], "semantic": {"name": "datarow", "arg_names": [], "import_names": [], "rhs_call_name": "DataRow", "annotation": ""}, "snippet": " datarow = DataRow([])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99878:Assign_L69_C8", "label": "datarow.cells =", "type": "assigned_variable", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L67_C4", "vector": [14, 2, 0.6161, 0.0089, 2, 0.45, 0.3333, 646, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "datarow.cells", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " datarow.cells = self._tail"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99878:Assign_L70_C8", "label": "datarow.comments =", "type": "assigned_variable", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L67_C4", "vector": [14, 2, 0.625, 0.0089, 2, 0.45, 0.6667, 267, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "datarow.comments", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " datarow.comments = self.comments"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99878:Return_L71_C8", "label": "return", "type": "return", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L67_C4", "vector": [13, 2, 0.6339, 0.0089, 2, 0.45, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return datarow"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L73_C4", "label": "startswith", "type": "function", "loc": [73, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99878:ClassDef_L18_C0", "vector": [2, 1, 0.6562, 0.0179, 1, 0.67, 0.5455, 193, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "startswith", "arg_names": ["self", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def startswith(self, value):\n return self.head() == value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99878:Return_L74_C8", "label": "return", "type": "return", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L73_C4", "vector": [13, 2, 0.6607, 0.0089, 2, 0.83, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.head() == value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L76_C4", "label": "handle_old_style_metadata", "type": "function", "loc": [76, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99878:ClassDef_L18_C0", "vector": [2, 1, 0.6875, 0.0268, 1, 0.67, 0.5909, 474, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "handle_old_style_metadata", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def handle_old_style_metadata(self):\n if self._is_metadata_with_olde_prefix(self.head):\n self.cells = self._convert_to_new_style_metadata()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99878:If_L77_C8", "label": "if", "type": "if", "loc": [77, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L76_C4", "vector": [4, 2, 0.692, 0.0179, 2, 0.62, 0.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._is_metadata_with_olde_prefix(self.head):\n self.cells = self._convert_to_new_style_metadata()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99878:Assign_L78_C12", "label": "self.cells = _convert_to_new_style_metadata()", "type": "assigned_variable", "loc": [78, 78], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99878:If_L77_C8", "vector": [14, 3, 0.6964, 0.0089, 3, 0.64, 0.0, 652, 3, 0, 0, 0, 452, 10, 1], "semantic": {"name": "self.cells", "arg_names": [], "import_names": [], "rhs_call_name": "_convert_to_new_style_metadata", "annotation": ""}, "snippet": " self.cells = self._convert_to_new_style_metadata()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L80_C4", "label": "_is_metadata_with_olde_prefix", "type": "function", "loc": [80, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99878:ClassDef_L18_C0", "vector": [2, 1, 0.7188, 0.0179, 1, 0.67, 0.6364, 44, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "_is_metadata_with_olde_prefix", "arg_names": ["self", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _is_metadata_with_olde_prefix(self, value):\n return value.lower().startswith(self._ye_olde_metadata_prefix)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99878:Return_L81_C8", "label": "return", "type": "return", "loc": [81, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L80_C4", "vector": [13, 2, 0.7232, 0.0089, 2, 0.94, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return value.lower().startswith(self._ye_olde_metadata_prefix)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L83_C4", "label": "_convert_to_new_style_metadata", "type": "function", "loc": [83, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99878:ClassDef_L18_C0", "vector": [2, 1, 0.7455, 0.0179, 1, 0.67, 0.6818, 452, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "_convert_to_new_style_metadata", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _convert_to_new_style_metadata(self):\n return ['Metadata'] + [self.head.split(':', 1)[1].strip()] + self._tail"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99878:Return_L84_C8", "label": "return", "type": "return", "loc": [84, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L83_C4", "vector": [13, 2, 0.75, 0.0089, 2, 0.58, 0.0, 0, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ['Metadata'] + [self.head.split(':', 1)[1].strip()] + self._tail"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L86_C4", "label": "starts_for_loop", "type": "function", "loc": [86, 89], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99878:ClassDef_L18_C0", "vector": [2, 1, 0.7812, 0.0357, 1, 0.67, 0.7273, 259, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "starts_for_loop", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def starts_for_loop(self):\n if self.head and self.head.startswith(':'):\n return self.head.replace(':', '').replace(' ', '').upper() == 'FOR'\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99878:If_L87_C8", "label": "if", "type": "if", "loc": [87, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L86_C4", "vector": [4, 2, 0.7812, 0.0179, 2, 0.25, 0.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.head and self.head.startswith(':'):\n return self.head.replace(':', '').replace(' ', '').upper() == 'FOR'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99878:Return_L88_C12", "label": "return", "type": "return", "loc": [88, 88], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99878:If_L87_C8", "vector": [13, 3, 0.7857, 0.0089, 3, 0.64, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.head.replace(':', '').replace(' ', '').upper() == 'FOR'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99878:Return_L89_C8", "label": "return", "type": "return", "loc": [89, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L86_C4", "vector": [13, 2, 0.7946, 0.0089, 2, 0.25, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L91_C4", "label": "starts_test_or_user_keyword_setting", "type": "function", "loc": [91, 93], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99878:ClassDef_L18_C0", "vector": [2, 1, 0.8214, 0.0268, 1, 0.67, 0.7727, 610, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "starts_test_or_user_keyword_setting", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def starts_test_or_user_keyword_setting(self):\n head = self.head\n return head and head[0] == '[' and head[-1] == ']'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99878:Assign_L92_C8", "label": "head =", "type": "assigned_variable", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L91_C4", "vector": [14, 2, 0.8214, 0.0089, 2, 0.01, 0.0, 217, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "head", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " head = self.head"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99878:Return_L93_C8", "label": "return", "type": "return", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L91_C4", "vector": [13, 2, 0.8304, 0.0089, 2, 0.01, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return head and head[0] == '[' and head[-1] == ']'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L95_C4", "label": "test_or_user_keyword_setting_name", "type": "function", "loc": [95, 96], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99878:ClassDef_L18_C0", "vector": [2, 1, 0.8527, 0.0179, 1, 0.67, 0.8182, 803, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "test_or_user_keyword_setting_name", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def test_or_user_keyword_setting_name(self):\n return self.head[1:-1].strip()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99878:Return_L96_C8", "label": "return", "type": "return", "loc": [96, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L95_C4", "vector": [13, 2, 0.8571, 0.0089, 2, 0.34, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.head[1:-1].strip()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L98_C4", "label": "is_indented", "type": "function", "loc": [98, 99], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99878:ClassDef_L18_C0", "vector": [2, 1, 0.8795, 0.0179, 1, 0.67, 0.8636, 79, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "is_indented", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def is_indented(self):\n return self.head == ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99878:Return_L99_C8", "label": "return", "type": "return", "loc": [99, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L98_C4", "vector": [13, 2, 0.8839, 0.0089, 2, 0.57, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.head == ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L101_C4", "label": "is_continuing", "type": "function", "loc": [101, 106], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99878:ClassDef_L18_C0", "vector": [2, 1, 0.9241, 0.0536, 1, 0.67, 0.9091, 674, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "is_continuing", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def is_continuing(self):\n for cell in self.cells:\n if cell == self._row_continuation_marker:\n return True\n if cell:\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99878:For_L102_C8", "label": "for cell", "type": "for", "loc": [102, 106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L101_C4", "vector": [6, 2, 0.9286, 0.0446, 2, 0.04, 0.0, 787, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cell", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for cell in self.cells:\n if cell == self._row_continuation_marker:\n return True\n if cell:\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99878:If_L103_C12", "label": "if", "type": "if", "loc": [103, 104], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99878:For_L102_C8", "vector": [4, 3, 0.9241, 0.0179, 3, 0.27, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if cell == self._row_continuation_marker:\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99878:Return_L104_C16", "label": "return", "type": "return", "loc": [104, 104], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99878:If_L103_C12", "vector": [13, 4, 0.9286, 0.0089, 4, 0.5, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99878:If_L105_C12", "label": "if", "type": "if", "loc": [105, 106], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99878:For_L102_C8", "vector": [4, 3, 0.942, 0.0179, 3, 0.27, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if cell:\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99878:Return_L106_C16", "label": "return", "type": "return", "loc": [106, 106], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99878:If_L105_C12", "vector": [13, 4, 0.9464, 0.0089, 4, 0.7, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L108_C4", "label": "is_commented", "type": "function", "loc": [108, 109], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99878:ClassDef_L18_C0", "vector": [2, 1, 0.9688, 0.0179, 1, 0.67, 0.9545, 139, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "is_commented", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def is_commented(self):\n return bool(not self.cells and self.comments)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99878:Return_L109_C8", "label": "return", "type": "return", "loc": [109, 109], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L108_C4", "vector": [13, 2, 0.9732, 0.0089, 2, 0.83, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return bool(not self.cells and self.comments)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L111_C4", "label": "__nonzero__", "type": "function", "loc": [111, 112], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99878:ClassDef_L18_C0", "vector": [2, 1, 0.9955, 0.0179, 1, 0.67, 1.0, 322, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "__nonzero__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __nonzero__(self):\n return bool(self.cells or self.comments)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99878:Return_L112_C8", "label": "return", "type": "return", "loc": [112, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L111_C4", "vector": [13, 2, 1.0, 0.0089, 2, 0.75, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return bool(self.cells or self.comments)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99878:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99878:Assign_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99878:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99878:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99878:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99878:Assign_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99878:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99878:Assign_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99878:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99878:Assign_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99878:Assign_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99878:For_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99878:For_L29_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99878:Assign_L30_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99878:For_L29_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99878:If_L31_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99878:If_L31_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99878:Expr_L32_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99878:If_L31_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99878:If_L33_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99878:If_L33_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99878:Expr_L34_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99878:If_L33_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99878:Expr_L36_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99878:Return_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99878:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L39_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99878:Return_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99878:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99878:While_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99878:While_L43_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99878:Expr_L44_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99878:Return_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99878:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99878:Return_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99878:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99878:Return_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99878:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99878:Return_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99878:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99878:If_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99878:If_L62_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99878:Assign_L63_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99878:If_L62_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99878:Return_L64_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99878:Return_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99878:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L67_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99878:Assign_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L67_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99878:Assign_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L67_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99878:Assign_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L67_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99878:Return_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99878:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L73_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99878:Return_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99878:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L76_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99878:If_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99878:If_L77_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99878:Assign_L78_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99878:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L80_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99878:Return_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99878:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L83_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99878:Return_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99878:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L86_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L86_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99878:If_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99878:If_L87_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99878:Return_L88_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L86_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99878:Return_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99878:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L91_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99878:Assign_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99878:Return_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99878:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L95_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99878:Return_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99878:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L98_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L98_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99878:Return_L99_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99878:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L101_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L101_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99878:For_L102_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99878:For_L102_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99878:If_L103_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99878:If_L103_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99878:Return_L104_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99878:For_L102_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99878:If_L105_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99878:If_L105_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99878:Return_L106_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99878:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L108_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L108_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99878:Return_L109_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99878:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L111_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99878:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99878:Return_L112_C8"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from datarow import DataRow
from model import (TestCaseFile, TestDataDirectory, ResourceFile,
TestCase, UserKeyword)
| ajibawa-2023/Python-Code-Large/train/row_99879 | 2 | 17 | 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_99879:ImportFrom_L15_C0", "label": "from datarow import DataRow", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.8824, 0.0588, 0, 0.66, 0.0, 496, 0, 1, 0, 0, 496, 0, 0], "semantic": {"name": "datarow", "arg_names": [], "import_names": ["DataRow"], "rhs_call_name": "", "annotation": ""}, "snippet": "from datarow import DataRow"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99879:ImportFrom_L16_C0", "label": "from model import TestCaseFile, TestDataDirectory, ResourceFile\u2026", "type": "import", "loc": [16, 17], "level": 0, "parent": null, "vector": [1, 0, 0.9706, 0.1176, 0, 0.66, 1.0, 722, 0, 5, 0, 0, 722, 0, 0], "semantic": {"name": "model", "arg_names": [], "import_names": ["TestCaseFile", "TestDataDirectory", "ResourceFile", "TestCase", "UserKeyword"], "rhs_call_name": "", "annotation": ""}, "snippet": "from model import (TestCaseFile, TestDataDirectory, ResourceFile,\n TestCase, UserKeyword)"}] | [] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import tempfile
import os
from docutils.core import publish_cmdline
from htmlreader import HtmlReader
# Ignore custom sourcecode directives at least we use in reST sources.
# See e.g. ug2html.py for an example how custom directives are created.
from docutils.parsers.rst import directives
ignorer = lambda *args: []
ignorer.content = 1
directives.register_directive('sourcecode', ignorer)
del directives, ignorer
class RestReader(HtmlReader):
def read(self, rstfile, rawdata):
htmlpath = self._rest_to_html(rstfile.name)
htmlfile = None
try:
htmlfile = open(htmlpath, 'rb')
return HtmlReader.read(self, htmlfile, rawdata)
finally:
if htmlfile:
htmlfile.close()
os.remove(htmlpath)
def _rest_to_html(self, rstpath):
filedesc, htmlpath = tempfile.mkstemp('.html')
os.close(filedesc)
publish_cmdline(writer_name='html', argv=[rstpath, htmlpath])
return htmlpath
| ajibawa-2023/Python-Code-Large/train/row_99880 | 23 | 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_99880:Import_L16_C0", "label": "tempfile import tempfile", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.3077, 0.0192, 0, 0.66, 0.0, 516, 0, 1, 0, 0, 516, 0, 0], "semantic": {"name": "tempfile", "arg_names": [], "import_names": ["tempfile"], "rhs_call_name": "", "annotation": ""}, "snippet": "import tempfile"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99880:Import_L17_C0", "label": "os import os", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.3269, 0.0192, 0, 0.66, 0.125, 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_99880:ImportFrom_L19_C0", "label": "from docutils.core import publish_cmdline", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.3654, 0.0192, 0, 0.66, 0.25, 219, 0, 1, 0, 0, 219, 0, 0], "semantic": {"name": "docutils.core", "arg_names": [], "import_names": ["publish_cmdline"], "rhs_call_name": "", "annotation": ""}, "snippet": "from docutils.core import publish_cmdline"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99880:ImportFrom_L21_C0", "label": "from htmlreader import HtmlReader", "type": "import", "loc": [21, 21], "level": 0, "parent": null, "vector": [1, 0, 0.4038, 0.0192, 0, 0.66, 0.375, 643, 0, 1, 0, 0, 643, 0, 0], "semantic": {"name": "htmlreader", "arg_names": [], "import_names": ["HtmlReader"], "rhs_call_name": "", "annotation": ""}, "snippet": "from htmlreader import HtmlReader"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99880:ImportFrom_L26_C0", "label": "from docutils.parsers.rst import directives", "type": "import", "loc": [26, 26], "level": 0, "parent": null, "vector": [1, 0, 0.5, 0.0192, 0, 0.66, 0.5, 299, 0, 1, 0, 0, 299, 0, 0], "semantic": {"name": "docutils.parsers.rst", "arg_names": [], "import_names": ["directives"], "rhs_call_name": "", "annotation": ""}, "snippet": "from docutils.parsers.rst import directives"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99880:Assign_L27_C0", "label": "ignorer =", "type": "assigned_variable", "loc": [27, 27], "level": 0, "parent": null, "vector": [14, 0, 0.5192, 0.0192, 0, 0.66, 0.625, 373, 9, 0, 0, 0, 0, 0, 0], "semantic": {"name": "ignorer", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "ignorer = lambda *args: []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99880:Assign_L28_C0", "label": "ignorer.content =", "type": "assigned_variable", "loc": [28, 28], "level": 0, "parent": null, "vector": [14, 0, 0.5385, 0.0192, 0, 0.66, 0.75, 422, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "ignorer.content", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "ignorer.content = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99880:Expr_L29_C0", "label": "register_directive()", "type": "expression", "loc": [29, 29], "level": 0, "parent": null, "vector": [8, 0, 0.5577, 0.0192, 0, 0.66, 0.875, 78, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "register_directive", "arg_names": [], "import_names": [], "rhs_call_name": "register_directive", "annotation": ""}, "snippet": "directives.register_directive('sourcecode', ignorer)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99880:ClassDef_L33_C0", "label": "RestReader", "type": "class", "loc": [33, 50], "level": 0, "parent": null, "vector": [3, 0, 0.7981, 0.3462, 0, 0.66, 1.125, 251, 0, 2, 0, 0, 151, 0, 8], "semantic": {"name": "RestReader", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class RestReader(HtmlReader):\n\n def read(self, rstfile, rawdata):\n htmlpath = self._rest_to_html(rstfile.name)\n htmlfile = None\n try:\n htmlfile = open(htmlpath, 'rb')\n return HtmlReader.read(self, htmlfile, rawdata)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99880:FunctionDef_L35_C4", "label": "read", "type": "function", "loc": [35, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99880:ClassDef_L33_C0", "vector": [2, 1, 0.7596, 0.1923, 1, 0.15, 0.0, 453, 0, 3, 1, 0, 0, 0, 5], "semantic": {"name": "read", "arg_names": ["self", "rstfile", "rawdata"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def read(self, rstfile, rawdata):\n htmlpath = self._rest_to_html(rstfile.name)\n htmlfile = None\n try:\n htmlfile = open(htmlpath, 'rb')\n return HtmlReader.read(self, htmlfile, rawdata)\n finally:\n if htmlfile:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99880:Assign_L36_C8", "label": "htmlpath = _rest_to_html()", "type": "assigned_variable", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99880:FunctionDef_L35_C4", "vector": [14, 2, 0.6923, 0.0192, 2, 0.4, 0.0, 877, 3, 1, 0, 0, 923, 10, 1], "semantic": {"name": "htmlpath", "arg_names": [], "import_names": [], "rhs_call_name": "_rest_to_html", "annotation": ""}, "snippet": " htmlpath = self._rest_to_html(rstfile.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99880:Assign_L37_C8", "label": "htmlfile =", "type": "assigned_variable", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99880:FunctionDef_L35_C4", "vector": [14, 2, 0.7115, 0.0192, 2, 0.4, 0.5, 663, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "htmlfile", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " htmlfile = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99880:Try_L38_C8", "label": "try", "type": "try", "loc": [38, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99880:FunctionDef_L35_C4", "vector": [7, 2, 0.7885, 0.1346, 2, 0.4, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n htmlfile = open(htmlpath, 'rb')\n return HtmlReader.read(self, htmlfile, rawdata)\n finally:\n if htmlfile:\n htmlfile.close()\n os.remove(htmlpath)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99880:Assign_L39_C12", "label": "htmlfile = open()", "type": "assigned_variable", "loc": [39, 39], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99880:Try_L38_C8", "vector": [14, 3, 0.75, 0.0192, 3, 0.94, 0.0, 663, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "htmlfile", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": " htmlfile = open(htmlpath, 'rb')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99880:Return_L40_C12", "label": "return", "type": "return", "loc": [40, 40], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99880:Try_L38_C8", "vector": [13, 3, 0.7692, 0.0192, 3, 0.94, 0.3333, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return HtmlReader.read(self, htmlfile, rawdata)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99880:If_L42_C12", "label": "if", "type": "if", "loc": [42, 43], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99880:Try_L38_C8", "vector": [4, 3, 0.8173, 0.0385, 3, 0.94, 0.6667, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if htmlfile:\n htmlfile.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99880:Expr_L43_C16", "label": "close()", "type": "expression", "loc": [43, 43], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99880:If_L42_C12", "vector": [8, 4, 0.8269, 0.0192, 4, 0.66, 0.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " htmlfile.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99880:Expr_L44_C12", "label": "remove()", "type": "expression", "loc": [44, 44], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99880:Try_L38_C8", "vector": [8, 3, 0.8462, 0.0192, 3, 0.94, 1.0, 185, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "remove", "arg_names": [], "import_names": [], "rhs_call_name": "remove", "annotation": ""}, "snippet": " os.remove(htmlpath)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99880:FunctionDef_L46_C4", "label": "_rest_to_html", "type": "function", "loc": [46, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99880:ClassDef_L33_C0", "vector": [2, 1, 0.9231, 0.0962, 1, 0.15, 1.0, 923, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "_rest_to_html", "arg_names": ["self", "rstpath"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _rest_to_html(self, rstpath):\n filedesc, htmlpath = tempfile.mkstemp('.html')\n os.close(filedesc)\n publish_cmdline(writer_name='html', argv=[rstpath, htmlpath])\n return htmlpath"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99880:Assign_L47_C8", "label": "filedesc, htmlpath = mkstemp()", "type": "assigned_variable", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99880:FunctionDef_L46_C4", "vector": [14, 2, 0.9038, 0.0192, 2, 0.29, 0.0, 982, 3, 1, 0, 0, 708, 10, 1], "semantic": {"name": "filedesc, htmlpath", "arg_names": [], "import_names": [], "rhs_call_name": "mkstemp", "annotation": ""}, "snippet": " filedesc, htmlpath = tempfile.mkstemp('.html')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99880:Expr_L48_C8", "label": "close()", "type": "expression", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99880:FunctionDef_L46_C4", "vector": [8, 2, 0.9231, 0.0192, 2, 0.29, 0.3333, 77, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " os.close(filedesc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99880:Expr_L49_C8", "label": "publish_cmdline()", "type": "expression", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99880:FunctionDef_L46_C4", "vector": [8, 2, 0.9423, 0.0192, 2, 0.29, 0.6667, 679, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "publish_cmdline", "arg_names": [], "import_names": [], "rhs_call_name": "publish_cmdline", "annotation": ""}, "snippet": " publish_cmdline(writer_name='html', argv=[rstpath, htmlpath])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99880:Return_L50_C8", "label": "return", "type": "return", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99880:FunctionDef_L46_C4", "vector": [13, 2, 0.9615, 0.0192, 2, 0.29, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return htmlpath"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99880:ClassDef_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99880:FunctionDef_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99880:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99880:Assign_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99880:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99880:Assign_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99880:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99880:Try_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99880:Try_L38_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99880:Assign_L39_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99880:Try_L38_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99880:Return_L40_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99880:Try_L38_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99880:If_L42_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99880:If_L42_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99880:Expr_L43_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99880:Try_L38_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99880:Expr_L44_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99880:ClassDef_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99880:FunctionDef_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99880:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99880:Assign_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99880:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99880:Expr_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99880:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99880:Expr_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99880:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99880:Return_L50_C8"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import HTMLParser
import sys
from htmlentitydefs import entitydefs
extra_entitydefs = {'nbsp': ' ', 'apos': "'", 'tilde': '~'}
class HtmlReader(HTMLParser.HTMLParser):
IGNORE = 0
INITIAL = 1
PROCESS = 2
def __init__(self):
HTMLParser.HTMLParser.__init__(self)
self._encoding = 'ISO-8859-1'
self._handlers = { 'table_start' : self.table_start,
'table_end' : self.table_end,
'tr_start' : self.tr_start,
'tr_end' : self.tr_end,
'td_start' : self.td_start,
'td_end' : self.td_end,
'th_start' : self.td_start,
'th_end' : self.td_end,
'br_start' : self.br_start,
'meta_start' : self.meta_start }
def read(self, htmlfile, populator):
self.populator = populator
self.state = self.IGNORE
self.current_row = None
self.current_cell = None
for line in htmlfile.readlines():
self.feed(line)
# Calling close is required by the HTMLParser but may cause problems
# if the same instance of our HtmlParser is reused. Currently it's
# used only once so there's no problem.
self.close()
self.populator.eof()
def handle_starttag(self, tag, attrs):
handler = self._handlers.get(tag+'_start')
if handler is not None:
handler(attrs)
def handle_endtag(self, tag):
handler = self._handlers.get(tag+'_end')
if handler is not None:
handler()
def handle_data(self, data, decode=True):
if self.state == self.IGNORE or self.current_cell is None:
return
if decode:
data = data.decode(self._encoding)
self.current_cell.append(data)
def handle_entityref(self, name):
value = self._handle_entityref(name)
self.handle_data(value, decode=False)
def _handle_entityref(self, name):
if extra_entitydefs.has_key(name):
return extra_entitydefs[name]
try:
value = entitydefs[name]
except KeyError:
return '&'+name+';'
if value.startswith('&#'):
return unichr(int(value[2:-1]))
return value.decode('ISO-8859-1')
def handle_charref(self, number):
value = self._handle_charref(number)
self.handle_data(value, decode=False)
def _handle_charref(self, number):
try:
return unichr(int(number))
except ValueError:
return '&#'+number+';'
def handle_pi(self, data):
encoding = self._get_encoding_from_pi(data)
if encoding:
self._encoding = encoding
def unknown_decl(self, data):
# Ignore everything even if it's invalid. This kind of stuff comes
# at least from MS Excel
pass
def table_start(self, attrs=None):
self.state = self.INITIAL
self.current_row = None
self.current_cell = None
def table_end(self):
if self.current_row is not None:
self.tr_end()
self.state = self.IGNORE
def tr_start(self, attrs=None):
if self.current_row is not None:
self.tr_end()
self.current_row = []
def tr_end(self):
if self.current_row is None:
return
if self.current_cell is not None:
self.td_end()
if self.state == self.INITIAL:
if len(self.current_row) > 0:
if self.populator.start_table(self.current_row):
self.state = self.PROCESS
else:
self.state = self.IGNORE
else:
self.state = self.IGNORE
elif self.state == self.PROCESS:
self.populator.add(self.current_row)
self.current_row = None
def td_start(self, attrs=None):
if self.current_cell is not None:
self.td_end()
if self.current_row is None:
self.tr_start()
self.current_cell = []
def td_end(self):
if self.current_cell is not None and self.state != self.IGNORE:
cell = ''.join(self.current_cell)
self.current_row.append(cell)
self.current_cell = None
def br_start(self, attrs=None):
if self.current_cell is not None and self.state != self.IGNORE:
self.current_cell.append('\n')
def meta_start(self, attrs):
encoding = self._get_encoding_from_meta(attrs)
if encoding:
self._encoding = encoding
def _get_encoding_from_meta(self, attrs):
valid_http_equiv = False
encoding = None
for name, value in attrs:
name = name.lower()
if name == 'http-equiv' and value.lower() == 'content-type':
valid_http_equiv = True
if name == 'content':
for token in value.split(';'):
token = token.strip()
if token.lower().startswith('charset='):
encoding = token[8:]
return valid_http_equiv and encoding or None
def _get_encoding_from_pi(self, data):
data = data.strip()
if not data.lower().startswith('xml '):
return None
if data.endswith('?'):
data = data[:-1]
for token in data.split():
if token.lower().startswith('encoding='):
encoding = token[9:]
if encoding.startswith("'") or encoding.startswith('"'):
encoding = encoding[1:-1]
return encoding
return None
# Workaround for following bug in Python 2.6: http://bugs.python.org/issue3932
if sys.version_info[:2] > (2, 5):
def unescape_from_py25(self, s):
if '&' not in s:
return s
s = s.replace("<", "<")
s = s.replace(">", ">")
s = s.replace("'", "'")
s = s.replace(""", '"')
s = s.replace("&", "&") # Must be last
return s
HTMLParser.HTMLParser.unescape = unescape_from_py25
| ajibawa-2023/Python-Code-Large/train/row_99881 | 140 | 202 | 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_99881:Import_L16_C0", "label": "HTMLParser import HTMLParser", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.0792, 0.005, 0, 0.66, 0.0, 217, 0, 1, 0, 0, 217, 0, 0], "semantic": {"name": "HTMLParser", "arg_names": [], "import_names": ["HTMLParser"], "rhs_call_name": "", "annotation": ""}, "snippet": "import HTMLParser"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Import_L17_C0", "label": "sys import sys", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.0842, 0.005, 0, 0.66, 0.2, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:ImportFrom_L18_C0", "label": "from htmlentitydefs import entitydefs", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.0891, 0.005, 0, 0.66, 0.4, 744, 0, 1, 0, 0, 744, 0, 0], "semantic": {"name": "htmlentitydefs", "arg_names": [], "import_names": ["entitydefs"], "rhs_call_name": "", "annotation": ""}, "snippet": "from htmlentitydefs import entitydefs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L20_C0", "label": "extra_entitydefs =", "type": "assigned_variable", "loc": [20, 20], "level": 0, "parent": null, "vector": [14, 0, 0.099, 0.005, 0, 0.66, 0.6, 30, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "extra_entitydefs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "extra_entitydefs = {'nbsp': ' ', 'apos': \"'\", 'tilde': '~'}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:ClassDef_L23_C0", "label": "HtmlReader", "type": "class", "loc": [23, 187], "level": 0, "parent": null, "vector": [3, 0, 0.5198, 0.8168, 0, 0.66, 0.8, 151, 0, 21, 0, 0, 795, 0, 50], "semantic": {"name": "HtmlReader", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class HtmlReader(HTMLParser.HTMLParser):\n IGNORE = 0\n INITIAL = 1\n PROCESS = 2\n\n def __init__(self):\n HTMLParser.HTMLParser.__init__(self)\n self._encoding = 'ISO-8859-1'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L24_C4", "label": "IGNORE =", "type": "assigned_variable", "loc": [24, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:ClassDef_L23_C0", "vector": [14, 1, 0.1188, 0.005, 1, 0.3, 0.0, 731, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "IGNORE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " IGNORE = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L25_C4", "label": "INITIAL =", "type": "assigned_variable", "loc": [25, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:ClassDef_L23_C0", "vector": [14, 1, 0.1238, 0.005, 1, 0.3, 0.0435, 600, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "INITIAL", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " INITIAL = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L26_C4", "label": "PROCESS =", "type": "assigned_variable", "loc": [26, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:ClassDef_L23_C0", "vector": [14, 1, 0.1287, 0.005, 1, 0.3, 0.087, 842, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "PROCESS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " PROCESS = 2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L28_C4", "label": "__init__", "type": "function", "loc": [28, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:ClassDef_L23_C0", "vector": [2, 1, 0.1683, 0.0644, 1, 0.3, 0.1304, 555, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self):\n HTMLParser.HTMLParser.__init__(self)\n self._encoding = 'ISO-8859-1'\n self._handlers = { 'table_start' : self.table_start,\n 'table_end' : self.table_end,\n 'tr_start' : self.tr_start,\n 'tr_end' : self.tr_end,\n 'td_start' : self.td_start,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Expr_L29_C8", "label": "__init__()", "type": "expression", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L28_C4", "vector": [8, 2, 0.1436, 0.005, 2, 0.16, 0.0, 555, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " HTMLParser.HTMLParser.__init__(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L30_C8", "label": "self._encoding =", "type": "assigned_variable", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L28_C4", "vector": [14, 2, 0.1485, 0.005, 2, 0.16, 0.5, 420, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self._encoding", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._encoding = 'ISO-8859-1'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L31_C8", "label": "self._handlers =", "type": "assigned_variable", "loc": [31, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L28_C4", "vector": [14, 2, 0.1757, 0.0495, 2, 0.16, 1.0, 893, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self._handlers", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._handlers = { 'table_start' : self.table_start,\n 'table_end' : self.table_end,\n 'tr_start' : self.tr_start,\n 'tr_end' : self.tr_end,\n 'td_start' : self.td_start,\n 'td_end' : self.td_end,\n 'th_start' : self.td_start,\n 'th_end' : self.td_end,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L42_C4", "label": "read", "type": "function", "loc": [42, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:ClassDef_L23_C0", "vector": [2, 1, 0.2351, 0.0594, 1, 0.3, 0.1739, 453, 0, 3, 0, 0, 0, 0, 4], "semantic": {"name": "read", "arg_names": ["self", "htmlfile", "populator"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def read(self, htmlfile, populator):\n self.populator = populator\n self.state = self.IGNORE\n self.current_row = None\n self.current_cell = None\n for line in htmlfile.readlines():\n self.feed(line)\n # Calling close is required by the HTMLParser but may cause problems"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L43_C8", "label": "self.populator =", "type": "assigned_variable", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L42_C4", "vector": [14, 2, 0.2129, 0.005, 2, 0.4, 0.0, 758, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.populator", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.populator = populator"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L44_C8", "label": "self.state =", "type": "assigned_variable", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L42_C4", "vector": [14, 2, 0.2178, 0.005, 2, 0.4, 0.1667, 765, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.state", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.state = self.IGNORE"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L45_C8", "label": "self.current_row =", "type": "assigned_variable", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L42_C4", "vector": [14, 2, 0.2228, 0.005, 2, 0.4, 0.3333, 264, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.current_row", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.current_row = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L46_C8", "label": "self.current_cell =", "type": "assigned_variable", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L42_C4", "vector": [14, 2, 0.2277, 0.005, 2, 0.4, 0.5, 196, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.current_cell", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.current_cell = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:For_L47_C8", "label": "for line", "type": "for", "loc": [47, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L42_C4", "vector": [6, 2, 0.2351, 0.0099, 2, 0.4, 0.6667, 373, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "line", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for line in htmlfile.readlines():\n self.feed(line)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Expr_L48_C12", "label": "feed()", "type": "expression", "loc": [48, 48], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:For_L47_C8", "vector": [8, 3, 0.2376, 0.005, 3, 0.96, 0.0, 87, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "feed", "arg_names": [], "import_names": [], "rhs_call_name": "feed", "annotation": ""}, "snippet": " self.feed(line)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Expr_L52_C8", "label": "close()", "type": "expression", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L42_C4", "vector": [8, 2, 0.2574, 0.005, 2, 0.4, 0.8333, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " self.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Expr_L53_C8", "label": "eof()", "type": "expression", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L42_C4", "vector": [8, 2, 0.2624, 0.005, 2, 0.4, 1.0, 797, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "eof", "arg_names": [], "import_names": [], "rhs_call_name": "eof", "annotation": ""}, "snippet": " self.populator.eof()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L55_C4", "label": "handle_starttag", "type": "function", "loc": [55, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:ClassDef_L23_C0", "vector": [2, 1, 0.2797, 0.0198, 1, 0.3, 0.2174, 761, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "handle_starttag", "arg_names": ["self", "tag", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def handle_starttag(self, tag, attrs):\n handler = self._handlers.get(tag+'_start')\n if handler is not None:\n handler(attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L56_C8", "label": "handler = get()", "type": "assigned_variable", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L55_C4", "vector": [14, 2, 0.2772, 0.005, 2, 0.22, 0.0, 388, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "handler", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " handler = self._handlers.get(tag+'_start')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L57_C8", "label": "if", "type": "if", "loc": [57, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L55_C4", "vector": [4, 2, 0.2847, 0.0099, 2, 0.22, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if handler is not None:\n handler(attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Expr_L58_C12", "label": "handler()", "type": "expression", "loc": [58, 58], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L57_C8", "vector": [8, 3, 0.2871, 0.005, 3, 0.56, 0.0, 388, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "handler", "arg_names": [], "import_names": [], "rhs_call_name": "handler", "annotation": ""}, "snippet": " handler(attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L60_C4", "label": "handle_endtag", "type": "function", "loc": [60, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:ClassDef_L23_C0", "vector": [2, 1, 0.3045, 0.0198, 1, 0.3, 0.2609, 63, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "handle_endtag", "arg_names": ["self", "tag"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def handle_endtag(self, tag):\n handler = self._handlers.get(tag+'_end')\n if handler is not None:\n handler()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L61_C8", "label": "handler = get()", "type": "assigned_variable", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L60_C4", "vector": [14, 2, 0.302, 0.005, 2, 0.06, 0.0, 388, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "handler", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " handler = self._handlers.get(tag+'_end')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L62_C8", "label": "if", "type": "if", "loc": [62, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L60_C4", "vector": [4, 2, 0.3094, 0.0099, 2, 0.06, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if handler is not None:\n handler()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Expr_L63_C12", "label": "handler()", "type": "expression", "loc": [63, 63], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L62_C8", "vector": [8, 3, 0.3119, 0.005, 3, 0.76, 0.0, 388, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "handler", "arg_names": [], "import_names": [], "rhs_call_name": "handler", "annotation": ""}, "snippet": " handler()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L65_C4", "label": "handle_data", "type": "function", "loc": [65, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:ClassDef_L23_C0", "vector": [2, 1, 0.3342, 0.0297, 1, 0.3, 0.3043, 645, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "handle_data", "arg_names": ["self", "data", "decode"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def handle_data(self, data, decode=True):\n if self.state == self.IGNORE or self.current_cell is None:\n return\n if decode:\n data = data.decode(self._encoding)\n self.current_cell.append(data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L66_C8", "label": "if", "type": "if", "loc": [66, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L65_C4", "vector": [4, 2, 0.3292, 0.0099, 2, 0.87, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.state == self.IGNORE or self.current_cell is None:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Return_L67_C12", "label": "return", "type": "return", "loc": [67, 67], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L66_C8", "vector": [13, 3, 0.3317, 0.005, 3, 0.31, 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_99881:If_L68_C8", "label": "if", "type": "if", "loc": [68, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L65_C4", "vector": [4, 2, 0.3391, 0.0099, 2, 0.87, 0.5, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if decode:\n data = data.decode(self._encoding)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L69_C12", "label": "data = decode()", "type": "assigned_variable", "loc": [69, 69], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L68_C8", "vector": [14, 3, 0.3416, 0.005, 3, 0.84, 0.0, 929, 3, 1, 0, 0, 528, 10, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "decode", "annotation": ""}, "snippet": " data = data.decode(self._encoding)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Expr_L70_C8", "label": "append()", "type": "expression", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L65_C4", "vector": [8, 2, 0.3465, 0.005, 2, 0.87, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.current_cell.append(data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L72_C4", "label": "handle_entityref", "type": "function", "loc": [72, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:ClassDef_L23_C0", "vector": [2, 1, 0.3614, 0.0149, 1, 0.3, 0.3478, 733, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "handle_entityref", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def handle_entityref(self, name):\n value = self._handle_entityref(name)\n self.handle_data(value, decode=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L73_C8", "label": "value = _handle_entityref()", "type": "assigned_variable", "loc": [73, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L72_C4", "vector": [14, 2, 0.3614, 0.005, 2, 0.66, 0.0, 441, 3, 1, 0, 0, 37, 10, 1], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "_handle_entityref", "annotation": ""}, "snippet": " value = self._handle_entityref(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Expr_L74_C8", "label": "handle_data()", "type": "expression", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L72_C4", "vector": [8, 2, 0.3663, 0.005, 2, 0.66, 1.0, 645, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "handle_data", "arg_names": [], "import_names": [], "rhs_call_name": "handle_data", "annotation": ""}, "snippet": " self.handle_data(value, decode=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L76_C4", "label": "_handle_entityref", "type": "function", "loc": [76, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:ClassDef_L23_C0", "vector": [2, 1, 0.3985, 0.0495, 1, 0.3, 0.3913, 37, 0, 2, 1, 0, 0, 0, 5], "semantic": {"name": "_handle_entityref", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _handle_entityref(self, name):\n if extra_entitydefs.has_key(name):\n return extra_entitydefs[name]\n try:\n value = entitydefs[name]\n except KeyError:\n return '&'+name+';'\n if value.startswith('&#'):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L77_C8", "label": "if", "type": "if", "loc": [77, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L76_C4", "vector": [4, 2, 0.3837, 0.0099, 2, 0.84, 0.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if extra_entitydefs.has_key(name):\n return extra_entitydefs[name]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Return_L78_C12", "label": "return", "type": "return", "loc": [78, 78], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L77_C8", "vector": [13, 3, 0.3861, 0.005, 3, 0.44, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return extra_entitydefs[name]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Try_L79_C8", "label": "try", "type": "try", "loc": [79, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L76_C4", "vector": [7, 2, 0.3985, 0.0198, 2, 0.84, 0.3333, 0, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n value = entitydefs[name]\n except KeyError:\n return '&'+name+';'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L80_C12", "label": "value =", "type": "assigned_variable", "loc": [80, 80], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:Try_L79_C8", "vector": [14, 3, 0.396, 0.005, 3, 0.1, 0.0, 441, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " value = entitydefs[name]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Return_L82_C12", "label": "return", "type": "return", "loc": [82, 82], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:Try_L79_C8", "vector": [13, 3, 0.4059, 0.005, 3, 0.1, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '&'+name+';'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L83_C8", "label": "if", "type": "if", "loc": [83, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L76_C4", "vector": [4, 2, 0.4134, 0.0099, 2, 0.84, 0.6667, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if value.startswith('&#'):\n return unichr(int(value[2:-1]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Return_L84_C12", "label": "return", "type": "return", "loc": [84, 84], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L83_C8", "vector": [13, 3, 0.4158, 0.005, 3, 0.08, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return unichr(int(value[2:-1]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Return_L85_C8", "label": "return", "type": "return", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L76_C4", "vector": [13, 2, 0.4208, 0.005, 2, 0.84, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return value.decode('ISO-8859-1')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L87_C4", "label": "handle_charref", "type": "function", "loc": [87, 89], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:ClassDef_L23_C0", "vector": [2, 1, 0.4356, 0.0149, 1, 0.3, 0.4348, 26, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "handle_charref", "arg_names": ["self", "number"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def handle_charref(self, number):\n value = self._handle_charref(number)\n self.handle_data(value, decode=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L88_C8", "label": "value = _handle_charref()", "type": "assigned_variable", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L87_C4", "vector": [14, 2, 0.4356, 0.005, 2, 0.59, 0.0, 441, 3, 1, 0, 0, 871, 10, 1], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "_handle_charref", "annotation": ""}, "snippet": " value = self._handle_charref(number)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Expr_L89_C8", "label": "handle_data()", "type": "expression", "loc": [89, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L87_C4", "vector": [8, 2, 0.4406, 0.005, 2, 0.59, 1.0, 645, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "handle_data", "arg_names": [], "import_names": [], "rhs_call_name": "handle_data", "annotation": ""}, "snippet": " self.handle_data(value, decode=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L91_C4", "label": "_handle_charref", "type": "function", "loc": [91, 95], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:ClassDef_L23_C0", "vector": [2, 1, 0.4604, 0.0248, 1, 0.3, 0.4783, 871, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "_handle_charref", "arg_names": ["self", "number"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _handle_charref(self, number):\n try:\n return unichr(int(number))\n except ValueError:\n return '&#'+number+';'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Try_L92_C8", "label": "try", "type": "try", "loc": [92, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L91_C4", "vector": [7, 2, 0.4629, 0.0198, 2, 0.97, 0.0, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n return unichr(int(number))\n except ValueError:\n return '&#'+number+';'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Return_L93_C12", "label": "return", "type": "return", "loc": [93, 93], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:Try_L92_C8", "vector": [13, 3, 0.4604, 0.005, 3, 0.93, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return unichr(int(number))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Return_L95_C12", "label": "return", "type": "return", "loc": [95, 95], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:Try_L92_C8", "vector": [13, 3, 0.4703, 0.005, 3, 0.93, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '&#'+number+';'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L97_C4", "label": "handle_pi", "type": "function", "loc": [97, 100], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:ClassDef_L23_C0", "vector": [2, 1, 0.4876, 0.0198, 1, 0.3, 0.5217, 784, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "handle_pi", "arg_names": ["self", "data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def handle_pi(self, data):\n encoding = self._get_encoding_from_pi(data)\n if encoding:\n self._encoding = encoding"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L98_C8", "label": "encoding = _get_encoding_from_pi()", "type": "assigned_variable", "loc": [98, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L97_C4", "vector": [14, 2, 0.4851, 0.005, 2, 0.18, 0.0, 325, 3, 1, 0, 0, 451, 10, 1], "semantic": {"name": "encoding", "arg_names": [], "import_names": [], "rhs_call_name": "_get_encoding_from_pi", "annotation": ""}, "snippet": " encoding = self._get_encoding_from_pi(data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L99_C8", "label": "if", "type": "if", "loc": [99, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L97_C4", "vector": [4, 2, 0.4926, 0.0099, 2, 0.18, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if encoding:\n self._encoding = encoding"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L100_C12", "label": "self._encoding =", "type": "assigned_variable", "loc": [100, 100], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L99_C8", "vector": [14, 3, 0.495, 0.005, 3, 0.9, 0.0, 420, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._encoding", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._encoding = encoding"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L102_C4", "label": "unknown_decl", "type": "function", "loc": [102, 105], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:ClassDef_L23_C0", "vector": [2, 1, 0.5124, 0.0198, 1, 0.3, 0.5652, 899, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "unknown_decl", "arg_names": ["self", "data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def unknown_decl(self, data):\n # Ignore everything even if it's invalid. This kind of stuff comes\n # at least from MS Excel\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L107_C4", "label": "table_start", "type": "function", "loc": [107, 110], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:ClassDef_L23_C0", "vector": [2, 1, 0.5371, 0.0198, 1, 0.3, 0.6087, 439, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "table_start", "arg_names": ["self", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def table_start(self, attrs=None):\n self.state = self.INITIAL\n self.current_row = None\n self.current_cell = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L108_C8", "label": "self.state =", "type": "assigned_variable", "loc": [108, 108], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L107_C4", "vector": [14, 2, 0.5347, 0.005, 2, 0.03, 0.0, 765, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.state", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.state = self.INITIAL"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L109_C8", "label": "self.current_row =", "type": "assigned_variable", "loc": [109, 109], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L107_C4", "vector": [14, 2, 0.5396, 0.005, 2, 0.03, 0.5, 264, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.current_row", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.current_row = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L110_C8", "label": "self.current_cell =", "type": "assigned_variable", "loc": [110, 110], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L107_C4", "vector": [14, 2, 0.5446, 0.005, 2, 0.03, 1.0, 196, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.current_cell", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.current_cell = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L112_C4", "label": "table_end", "type": "function", "loc": [112, 115], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:ClassDef_L23_C0", "vector": [2, 1, 0.5619, 0.0198, 1, 0.3, 0.6522, 727, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "table_end", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def table_end(self):\n if self.current_row is not None:\n self.tr_end()\n self.state = self.IGNORE"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L113_C8", "label": "if", "type": "if", "loc": [113, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L112_C4", "vector": [4, 2, 0.5619, 0.0099, 2, 0.73, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.current_row is not None:\n self.tr_end()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Expr_L114_C12", "label": "tr_end()", "type": "expression", "loc": [114, 114], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L113_C8", "vector": [8, 3, 0.5644, 0.005, 3, 0.14, 0.0, 955, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "tr_end", "arg_names": [], "import_names": [], "rhs_call_name": "tr_end", "annotation": ""}, "snippet": " self.tr_end()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L115_C8", "label": "self.state =", "type": "assigned_variable", "loc": [115, 115], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L112_C4", "vector": [14, 2, 0.5693, 0.005, 2, 0.73, 1.0, 765, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.state", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.state = self.IGNORE"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L117_C4", "label": "tr_start", "type": "function", "loc": [117, 120], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:ClassDef_L23_C0", "vector": [2, 1, 0.5866, 0.0198, 1, 0.3, 0.6957, 162, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "tr_start", "arg_names": ["self", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def tr_start(self, attrs=None):\n if self.current_row is not None:\n self.tr_end()\n self.current_row = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L118_C8", "label": "if", "type": "if", "loc": [118, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L117_C4", "vector": [4, 2, 0.5866, 0.0099, 2, 0.3, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.current_row is not None:\n self.tr_end()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Expr_L119_C12", "label": "tr_end()", "type": "expression", "loc": [119, 119], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L118_C8", "vector": [8, 3, 0.5891, 0.005, 3, 0.15, 0.0, 955, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "tr_end", "arg_names": [], "import_names": [], "rhs_call_name": "tr_end", "annotation": ""}, "snippet": " self.tr_end()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L120_C8", "label": "self.current_row =", "type": "assigned_variable", "loc": [120, 120], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L117_C4", "vector": [14, 2, 0.5941, 0.005, 2, 0.3, 1.0, 264, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.current_row", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.current_row = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L122_C4", "label": "tr_end", "type": "function", "loc": [122, 137], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:ClassDef_L23_C0", "vector": [2, 1, 0.6411, 0.0792, 1, 0.3, 0.7391, 955, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "tr_end", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def tr_end(self):\n if self.current_row is None:\n return\n if self.current_cell is not None:\n self.td_end()\n if self.state == self.INITIAL:\n if len(self.current_row) > 0:\n if self.populator.start_table(self.current_row):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L123_C8", "label": "if", "type": "if", "loc": [123, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L122_C4", "vector": [4, 2, 0.6114, 0.0099, 2, 0.67, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.current_row is None:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Return_L124_C12", "label": "return", "type": "return", "loc": [124, 124], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L123_C8", "vector": [13, 3, 0.6139, 0.005, 3, 0.28, 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_99881:If_L125_C8", "label": "if", "type": "if", "loc": [125, 126], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L122_C4", "vector": [4, 2, 0.6213, 0.0099, 2, 0.67, 0.3333, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.current_cell is not None:\n self.td_end()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Expr_L126_C12", "label": "td_end()", "type": "expression", "loc": [126, 126], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L125_C8", "vector": [8, 3, 0.6238, 0.005, 3, 0.52, 0.0, 27, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "td_end", "arg_names": [], "import_names": [], "rhs_call_name": "td_end", "annotation": ""}, "snippet": " self.td_end()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L127_C8", "label": "if", "type": "if", "loc": [127, 136], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L122_C4", "vector": [4, 2, 0.651, 0.0495, 2, 0.67, 0.6667, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.state == self.INITIAL:\n if len(self.current_row) > 0:\n if self.populator.start_table(self.current_row):\n self.state = self.PROCESS\n else:\n self.state = self.IGNORE\n else:\n self.state = self.IGNORE"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L128_C12", "label": "if", "type": "if", "loc": [128, 134], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L127_C8", "vector": [4, 3, 0.6485, 0.0347, 3, 0.73, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(self.current_row) > 0:\n if self.populator.start_table(self.current_row):\n self.state = self.PROCESS\n else:\n self.state = self.IGNORE\n else:\n self.state = self.IGNORE"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L129_C16", "label": "if", "type": "if", "loc": [129, 132], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L128_C12", "vector": [4, 4, 0.646, 0.0198, 4, 0.95, 0.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.populator.start_table(self.current_row):\n self.state = self.PROCESS\n else:\n self.state = self.IGNORE"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L130_C20", "label": "self.state =", "type": "assigned_variable", "loc": [130, 130], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L129_C16", "vector": [14, 5, 0.6436, 0.005, 5, 0.98, 0.0, 765, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.state", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.state = self.PROCESS"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L132_C20", "label": "self.state =", "type": "assigned_variable", "loc": [132, 132], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L129_C16", "vector": [14, 5, 0.6535, 0.005, 5, 0.98, 1.0, 765, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.state", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.state = self.IGNORE"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L134_C16", "label": "self.state =", "type": "assigned_variable", "loc": [134, 134], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L128_C12", "vector": [14, 4, 0.6634, 0.005, 4, 0.95, 1.0, 765, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.state", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.state = self.IGNORE"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L135_C8", "label": "if", "type": "if", "loc": [135, 136], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L127_C8", "vector": [4, 3, 0.6708, 0.0099, 3, 0.73, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif self.state == self.PROCESS:\n self.populator.add(self.current_row)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Expr_L136_C12", "label": "add()", "type": "expression", "loc": [136, 136], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L135_C8", "vector": [8, 4, 0.6733, 0.005, 4, 0.72, 0.0, 241, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " self.populator.add(self.current_row)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L137_C8", "label": "self.current_row =", "type": "assigned_variable", "loc": [137, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L122_C4", "vector": [14, 2, 0.6782, 0.005, 2, 0.67, 1.0, 264, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.current_row", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.current_row = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L139_C4", "label": "td_start", "type": "function", "loc": [139, 144], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:ClassDef_L23_C0", "vector": [2, 1, 0.7005, 0.0297, 1, 0.3, 0.7826, 502, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "td_start", "arg_names": ["self", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def td_start(self, attrs=None):\n if self.current_cell is not None:\n self.td_end()\n if self.current_row is None:\n self.tr_start()\n self.current_cell = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L140_C8", "label": "if", "type": "if", "loc": [140, 141], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L139_C4", "vector": [4, 2, 0.6955, 0.0099, 2, 0.7, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.current_cell is not None:\n self.td_end()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Expr_L141_C12", "label": "td_end()", "type": "expression", "loc": [141, 141], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L140_C8", "vector": [8, 3, 0.698, 0.005, 3, 0.85, 0.0, 27, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "td_end", "arg_names": [], "import_names": [], "rhs_call_name": "td_end", "annotation": ""}, "snippet": " self.td_end()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L142_C8", "label": "if", "type": "if", "loc": [142, 143], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L139_C4", "vector": [4, 2, 0.7054, 0.0099, 2, 0.7, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.current_row is None:\n self.tr_start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Expr_L143_C12", "label": "tr_start()", "type": "expression", "loc": [143, 143], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L142_C8", "vector": [8, 3, 0.7079, 0.005, 3, 0.92, 0.0, 162, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "tr_start", "arg_names": [], "import_names": [], "rhs_call_name": "tr_start", "annotation": ""}, "snippet": " self.tr_start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L144_C8", "label": "self.current_cell =", "type": "assigned_variable", "loc": [144, 144], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L139_C4", "vector": [14, 2, 0.7129, 0.005, 2, 0.7, 1.0, 196, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.current_cell", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.current_cell = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L146_C4", "label": "td_end", "type": "function", "loc": [146, 150], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:ClassDef_L23_C0", "vector": [2, 1, 0.7327, 0.0248, 1, 0.3, 0.8261, 27, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "td_end", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def td_end(self):\n if self.current_cell is not None and self.state != self.IGNORE:\n cell = ''.join(self.current_cell)\n self.current_row.append(cell)\n self.current_cell = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L147_C8", "label": "if", "type": "if", "loc": [147, 149], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L146_C4", "vector": [4, 2, 0.7327, 0.0149, 2, 0.42, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.current_cell is not None and self.state != self.IGNORE:\n cell = ''.join(self.current_cell)\n self.current_row.append(cell)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L148_C12", "label": "cell = join()", "type": "assigned_variable", "loc": [148, 148], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L147_C8", "vector": [14, 3, 0.7327, 0.005, 3, 0.87, 0.0, 787, 3, 1, 0, 0, 933, 10, 1], "semantic": {"name": "cell", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " cell = ''.join(self.current_cell)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Expr_L149_C12", "label": "append()", "type": "expression", "loc": [149, 149], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L147_C8", "vector": [8, 3, 0.7376, 0.005, 3, 0.87, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.current_row.append(cell)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L150_C8", "label": "self.current_cell =", "type": "assigned_variable", "loc": [150, 150], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L146_C4", "vector": [14, 2, 0.7426, 0.005, 2, 0.42, 1.0, 196, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.current_cell", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.current_cell = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L152_C4", "label": "br_start", "type": "function", "loc": [152, 154], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:ClassDef_L23_C0", "vector": [2, 1, 0.7574, 0.0149, 1, 0.3, 0.8696, 65, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "br_start", "arg_names": ["self", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def br_start(self, attrs=None):\n if self.current_cell is not None and self.state != self.IGNORE:\n self.current_cell.append('\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L153_C8", "label": "if", "type": "if", "loc": [153, 154], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L152_C4", "vector": [4, 2, 0.7599, 0.0099, 2, 0.42, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.current_cell is not None and self.state != self.IGNORE:\n self.current_cell.append('\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Expr_L154_C12", "label": "append()", "type": "expression", "loc": [154, 154], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L153_C8", "vector": [8, 3, 0.7624, 0.005, 3, 0.18, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.current_cell.append('\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L156_C4", "label": "meta_start", "type": "function", "loc": [156, 159], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:ClassDef_L23_C0", "vector": [2, 1, 0.7797, 0.0198, 1, 0.3, 0.913, 538, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "meta_start", "arg_names": ["self", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def meta_start(self, attrs):\n encoding = self._get_encoding_from_meta(attrs)\n if encoding:\n self._encoding = encoding"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L157_C8", "label": "encoding = _get_encoding_from_meta()", "type": "assigned_variable", "loc": [157, 157], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L156_C4", "vector": [14, 2, 0.7772, 0.005, 2, 0.6, 0.0, 325, 3, 1, 0, 0, 781, 10, 1], "semantic": {"name": "encoding", "arg_names": [], "import_names": [], "rhs_call_name": "_get_encoding_from_meta", "annotation": ""}, "snippet": " encoding = self._get_encoding_from_meta(attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L158_C8", "label": "if", "type": "if", "loc": [158, 159], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L156_C4", "vector": [4, 2, 0.7847, 0.0099, 2, 0.6, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if encoding:\n self._encoding = encoding"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L159_C12", "label": "self._encoding =", "type": "assigned_variable", "loc": [159, 159], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L158_C8", "vector": [14, 3, 0.7871, 0.005, 3, 0.19, 0.0, 420, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._encoding", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._encoding = encoding"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L161_C4", "label": "_get_encoding_from_meta", "type": "function", "loc": [161, 173], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:ClassDef_L23_C0", "vector": [2, 1, 0.8267, 0.0644, 1, 0.3, 0.9565, 781, 0, 2, 1, 0, 0, 0, 6], "semantic": {"name": "_get_encoding_from_meta", "arg_names": ["self", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_encoding_from_meta(self, attrs):\n valid_http_equiv = False\n encoding = None\n for name, value in attrs:\n name = name.lower()\n if name == 'http-equiv' and value.lower() == 'content-type':\n valid_http_equiv = True\n if name == 'content':"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L162_C8", "label": "valid_http_equiv =", "type": "assigned_variable", "loc": [162, 162], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L161_C4", "vector": [14, 2, 0.802, 0.005, 2, 0.6, 0.0, 150, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "valid_http_equiv", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " valid_http_equiv = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L163_C8", "label": "encoding =", "type": "assigned_variable", "loc": [163, 163], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L161_C4", "vector": [14, 2, 0.8069, 0.005, 2, 0.6, 0.3333, 325, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "encoding", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " encoding = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:For_L164_C8", "label": "for name, value", "type": "for", "loc": [164, 172], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L161_C4", "vector": [6, 2, 0.8317, 0.0446, 2, 0.6, 0.6667, 509, 2, 0, 0, 0, 0, 0, 6], "semantic": {"name": "name, value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for name, value in attrs:\n name = name.lower()\n if name == 'http-equiv' and value.lower() == 'content-type':\n valid_http_equiv = True\n if name == 'content':\n for token in value.split(';'):\n token = token.strip()\n if token.lower().startswith('charset='):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L165_C12", "label": "name = lower()", "type": "assigned_variable", "loc": [165, 165], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:For_L164_C8", "vector": [14, 3, 0.8168, 0.005, 3, 0.32, 0.0, 57, 3, 0, 0, 0, 432, 10, 1], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "lower", "annotation": ""}, "snippet": " name = name.lower()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L166_C12", "label": "if", "type": "if", "loc": [166, 167], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:For_L164_C8", "vector": [4, 3, 0.8243, 0.0099, 3, 0.32, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if name == 'http-equiv' and value.lower() == 'content-type':\n valid_http_equiv = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L167_C16", "label": "valid_http_equiv =", "type": "assigned_variable", "loc": [167, 167], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L166_C12", "vector": [14, 4, 0.8267, 0.005, 4, 0.7, 0.0, 150, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "valid_http_equiv", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " valid_http_equiv = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L168_C12", "label": "if", "type": "if", "loc": [168, 172], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:For_L164_C8", "vector": [4, 3, 0.8416, 0.0248, 3, 0.32, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if name == 'content':\n for token in value.split(';'):\n token = token.strip()\n if token.lower().startswith('charset='):\n encoding = token[8:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:For_L169_C16", "label": "for token", "type": "for", "loc": [169, 172], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L168_C12", "vector": [6, 4, 0.8441, 0.0198, 4, 0.45, 0.0, 129, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "token", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for token in value.split(';'):\n token = token.strip()\n if token.lower().startswith('charset='):\n encoding = token[8:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L170_C20", "label": "token = strip()", "type": "assigned_variable", "loc": [170, 170], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:For_L169_C16", "vector": [14, 5, 0.8416, 0.005, 5, 0.57, 0.0, 129, 3, 0, 0, 0, 973, 10, 1], "semantic": {"name": "token", "arg_names": [], "import_names": [], "rhs_call_name": "strip", "annotation": ""}, "snippet": " token = token.strip()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L171_C20", "label": "if", "type": "if", "loc": [171, 172], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:For_L169_C16", "vector": [4, 5, 0.849, 0.0099, 5, 0.57, 1.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if token.lower().startswith('charset='):\n encoding = token[8:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L172_C24", "label": "encoding =", "type": "assigned_variable", "loc": [172, 172], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L171_C20", "vector": [14, 6, 0.8515, 0.005, 6, 0.2, 0.0, 325, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "encoding", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " encoding = token[8:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Return_L173_C8", "label": "return", "type": "return", "loc": [173, 173], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L161_C4", "vector": [13, 2, 0.8564, 0.005, 2, 0.6, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return valid_http_equiv and encoding or None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L175_C4", "label": "_get_encoding_from_pi", "type": "function", "loc": [175, 187], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:ClassDef_L23_C0", "vector": [2, 1, 0.896, 0.0644, 1, 0.3, 1.0, 451, 0, 2, 1, 0, 0, 0, 9], "semantic": {"name": "_get_encoding_from_pi", "arg_names": ["self", "data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_encoding_from_pi(self, data):\n data = data.strip()\n if not data.lower().startswith('xml '):\n return None\n if data.endswith('?'):\n data = data[:-1]\n for token in data.split():\n if token.lower().startswith('encoding='):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L176_C8", "label": "data = strip()", "type": "assigned_variable", "loc": [176, 176], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L175_C4", "vector": [14, 2, 0.8713, 0.005, 2, 0.4, 0.0, 929, 3, 0, 0, 0, 973, 10, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "strip", "annotation": ""}, "snippet": " data = data.strip()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L177_C8", "label": "if", "type": "if", "loc": [177, 178], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L175_C4", "vector": [4, 2, 0.8787, 0.0099, 2, 0.4, 0.25, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not data.lower().startswith('xml '):\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Return_L178_C12", "label": "return", "type": "return", "loc": [178, 178], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L177_C8", "vector": [13, 3, 0.8812, 0.005, 3, 0.71, 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_99881:If_L179_C8", "label": "if", "type": "if", "loc": [179, 180], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L175_C4", "vector": [4, 2, 0.8886, 0.0099, 2, 0.4, 0.5, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if data.endswith('?'):\n data = data[:-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L180_C12", "label": "data =", "type": "assigned_variable", "loc": [180, 180], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L179_C8", "vector": [14, 3, 0.8911, 0.005, 3, 0.55, 0.0, 929, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " data = data[:-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:For_L181_C8", "label": "for token", "type": "for", "loc": [181, 186], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L175_C4", "vector": [6, 2, 0.9084, 0.0297, 2, 0.4, 0.75, 129, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "token", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for token in data.split():\n if token.lower().startswith('encoding='):\n encoding = token[9:]\n if encoding.startswith(\"'\") or encoding.startswith('\"'):\n encoding = encoding[1:-1]\n return encoding"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L182_C12", "label": "if", "type": "if", "loc": [182, 186], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:For_L181_C8", "vector": [4, 3, 0.9109, 0.0248, 3, 0.28, 0.0, 0, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if token.lower().startswith('encoding='):\n encoding = token[9:]\n if encoding.startswith(\"'\") or encoding.startswith('\"'):\n encoding = encoding[1:-1]\n return encoding"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L183_C16", "label": "encoding =", "type": "assigned_variable", "loc": [183, 183], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L182_C12", "vector": [14, 4, 0.9059, 0.005, 4, 0.76, 0.0, 325, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "encoding", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " encoding = token[9:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L184_C16", "label": "if", "type": "if", "loc": [184, 185], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L182_C12", "vector": [4, 4, 0.9134, 0.0099, 4, 0.76, 0.5, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if encoding.startswith(\"'\") or encoding.startswith('\"'):\n encoding = encoding[1:-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L185_C20", "label": "encoding =", "type": "assigned_variable", "loc": [185, 185], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L184_C16", "vector": [14, 5, 0.9158, 0.005, 5, 0.5, 0.0, 325, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "encoding", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " encoding = encoding[1:-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Return_L186_C16", "label": "return", "type": "return", "loc": [186, 186], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L182_C12", "vector": [13, 4, 0.9208, 0.005, 4, 0.76, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return encoding"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Return_L187_C8", "label": "return", "type": "return", "loc": [187, 187], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L175_C4", "vector": [13, 2, 0.9257, 0.005, 2, 0.4, 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_99881:If_L191_C0", "label": "if", "type": "if", "loc": [191, 202], "level": 0, "parent": null, "vector": [4, 0, 0.9728, 0.0594, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if sys.version_info[:2] > (2, 5):\n def unescape_from_py25(self, s):\n if '&' not in s:\n return s\n s = s.replace(\"<\", \"<\")\n s = s.replace(\">\", \">\")\n s = s.replace(\"'\", \"'\")\n s = s.replace(\""\", '\"')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L192_C4", "label": "unescape_from_py25", "type": "function", "loc": [192, 200], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L191_C0", "vector": [2, 1, 0.9703, 0.0446, 1, 0.29, 0.0, 935, 0, 2, 1, 0, 0, 0, 5], "semantic": {"name": "unescape_from_py25", "arg_names": ["self", "s"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def unescape_from_py25(self, s):\n if '&' not in s:\n return s\n s = s.replace(\"<\", \"<\")\n s = s.replace(\">\", \">\")\n s = s.replace(\"'\", \"'\")\n s = s.replace(\""\", '\"')\n s = s.replace(\"&\", \"&\") # Must be last"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L193_C8", "label": "if", "type": "if", "loc": [193, 194], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L192_C4", "vector": [4, 2, 0.9579, 0.0099, 2, 0.36, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if '&' not in s:\n return s"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Return_L194_C12", "label": "return", "type": "return", "loc": [194, 194], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L193_C8", "vector": [13, 3, 0.9604, 0.005, 3, 0.08, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return s"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L195_C8", "label": "s = replace()", "type": "assigned_variable", "loc": [195, 195], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L192_C4", "vector": [14, 2, 0.9653, 0.005, 2, 0.36, 0.1667, 553, 3, 2, 0, 0, 293, 10, 1], "semantic": {"name": "s", "arg_names": [], "import_names": [], "rhs_call_name": "replace", "annotation": ""}, "snippet": " s = s.replace(\"<\", \"<\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L196_C8", "label": "s = replace()", "type": "assigned_variable", "loc": [196, 196], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L192_C4", "vector": [14, 2, 0.9703, 0.005, 2, 0.36, 0.3333, 553, 3, 2, 0, 0, 293, 10, 1], "semantic": {"name": "s", "arg_names": [], "import_names": [], "rhs_call_name": "replace", "annotation": ""}, "snippet": " s = s.replace(\">\", \">\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L197_C8", "label": "s = replace()", "type": "assigned_variable", "loc": [197, 197], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L192_C4", "vector": [14, 2, 0.9752, 0.005, 2, 0.36, 0.5, 553, 3, 2, 0, 0, 293, 10, 1], "semantic": {"name": "s", "arg_names": [], "import_names": [], "rhs_call_name": "replace", "annotation": ""}, "snippet": " s = s.replace(\"'\", \"'\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L198_C8", "label": "s = replace()", "type": "assigned_variable", "loc": [198, 198], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L192_C4", "vector": [14, 2, 0.9802, 0.005, 2, 0.36, 0.6667, 553, 3, 2, 0, 0, 293, 10, 1], "semantic": {"name": "s", "arg_names": [], "import_names": [], "rhs_call_name": "replace", "annotation": ""}, "snippet": " s = s.replace(\""\", '\"')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L199_C8", "label": "s = replace()", "type": "assigned_variable", "loc": [199, 199], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L192_C4", "vector": [14, 2, 0.9851, 0.005, 2, 0.36, 0.8333, 553, 3, 2, 0, 0, 293, 10, 1], "semantic": {"name": "s", "arg_names": [], "import_names": [], "rhs_call_name": "replace", "annotation": ""}, "snippet": " s = s.replace(\"&\", \"&\") # Must be last"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Return_L200_C8", "label": "return", "type": "return", "loc": [200, 200], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L192_C4", "vector": [13, 2, 0.9901, 0.005, 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 s"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L202_C4", "label": "HTMLParser.HTMLParser.unescape =", "type": "assigned_variable", "loc": [202, 202], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L191_C0", "vector": [14, 1, 1.0, 0.005, 1, 0.29, 1.0, 951, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "HTMLParser.HTMLParser.unescape", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " HTMLParser.HTMLParser.unescape = unescape_from_py25"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99881:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Expr_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:For_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:For_L47_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Expr_L48_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Expr_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Expr_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L57_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Expr_L58_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L62_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Expr_L63_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L65_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L66_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Return_L67_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L65_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L68_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L69_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L65_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Expr_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L72_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L72_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Expr_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L76_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L77_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Return_L78_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L76_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Try_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:Try_L79_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L80_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:Try_L79_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Return_L82_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L76_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L83_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Return_L84_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L76_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Return_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L87_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Expr_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L91_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Try_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:Try_L92_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Return_L93_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:Try_L92_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Return_L95_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L97_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L98_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L99_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L99_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L100_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L107_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L108_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L109_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L110_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L112_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L112_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L113_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L113_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Expr_L114_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L112_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L115_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L117_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L117_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L118_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L118_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Expr_L119_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L117_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L120_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L122_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L122_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L123_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L123_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Return_L124_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L122_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L125_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L125_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Expr_L126_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L122_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L127_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L127_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L128_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L128_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L129_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L129_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L130_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L129_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L132_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L128_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L134_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L127_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L135_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L135_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Expr_L136_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L122_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L137_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L139_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L139_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L140_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L140_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Expr_L141_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L139_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L142_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L142_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Expr_L143_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L139_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L144_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L146_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L146_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L147_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L147_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L148_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L147_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Expr_L149_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L146_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L150_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L152_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L152_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L153_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L153_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Expr_L154_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L156_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L156_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L157_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L156_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L158_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L158_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L159_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L161_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L161_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L162_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L161_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L163_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L161_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:For_L164_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:For_L164_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L165_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:For_L164_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L166_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L166_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L167_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:For_L164_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L168_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L168_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:For_L169_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:For_L169_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L170_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:For_L169_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L171_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L171_C20", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L172_C24"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L161_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Return_L173_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L175_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L175_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L176_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L175_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L177_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L177_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Return_L178_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L175_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L179_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L179_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L180_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L175_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:For_L181_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:For_L181_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L182_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L182_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L183_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L182_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L184_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L184_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L185_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L182_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Return_L186_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L175_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Return_L187_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L191_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L192_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L192_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L193_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L193_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Return_L194_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L192_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L195_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L192_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L196_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L192_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L197_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L192_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L198_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L192_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L199_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:FunctionDef_L192_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Return_L200_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99881:If_L191_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99881:Assign_L202_C4"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# TODO: Various tasks
# - Rename this module so that it is not confused with standard json module
# - Consider moving under utils
# - Cleanup
def encode_basestring(string):
def get_matching_char(c):
val = ord(c)
if val < 127 and val > 31:
return c
return '\\u' + hex(val)[2:].rjust(4,'0')
# TODO: Our log doesn't contain all these control chars
string = string.replace('\\', '\\\\')
string = string.replace('"', '\\"')
string = string.replace('\b', '\\b')
string = string.replace('\f', '\\f')
string = string.replace('\n', '\\n')
string = string.replace('\r', '\\r')
string = string.replace('\t', '\\t')
return '"%s"' % ''.join(get_matching_char(c) for c in string)
def json_dump(data, output, mappings=None):
if data is None:
output.write('null')
elif isinstance(data, dict):
output.write('{')
for index, key in enumerate(sorted(data)):
json_dump(key, output, mappings)
output.write(':')
json_dump(data[key], output, mappings)
if index < len(data)-1:
output.write(',')
output.write('}')
elif isinstance(data, (list, tuple)):
output.write('[')
for index, item in enumerate(data):
json_dump(item, output, mappings)
if index < len(data)-1:
output.write(',')
output.write(']')
elif mappings and data in mappings:
output.write(mappings[data])
elif isinstance(data, (int, long)):
output.write(str(data))
elif isinstance(data, basestring):
output.write(encode_basestring(data))
else:
raise Exception('Data type (%s) serialization not supported' % type(data))
| ajibawa-2023/Python-Code-Large/train/row_99882 | 39 | 64 | 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_99882:FunctionDef_L22_C0", "label": "encode_basestring", "type": "function", "loc": [22, 36], "level": 0, "parent": null, "vector": [2, 0, 0.4531, 0.2344, 0, 0.66, 0.0, 207, 0, 1, 1, 0, 0, 0, 12], "semantic": {"name": "encode_basestring", "arg_names": ["string"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def encode_basestring(string):\n def get_matching_char(c):\n val = ord(c)\n if val < 127 and val > 31:\n return c\n return '\\\\u' + hex(val)[2:].rjust(4,'0')\n # TODO: Our log doesn't contain all these control chars\n string = string.replace('\\\\', '\\\\\\\\')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99882:FunctionDef_L23_C4", "label": "get_matching_char", "type": "function", "loc": [23, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99882:FunctionDef_L22_C0", "vector": [2, 1, 0.3906, 0.0781, 1, 0.47, 0.0, 553, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "get_matching_char", "arg_names": ["c"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_matching_char(c):\n val = ord(c)\n if val < 127 and val > 31:\n return c\n return '\\\\u' + hex(val)[2:].rjust(4,'0')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99882:Assign_L24_C8", "label": "val = ord()", "type": "assigned_variable", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99882:FunctionDef_L23_C4", "vector": [14, 2, 0.375, 0.0156, 2, 0.36, 0.0, 618, 3, 1, 0, 0, 171, 10, 1], "semantic": {"name": "val", "arg_names": [], "import_names": [], "rhs_call_name": "ord", "annotation": ""}, "snippet": " val = ord(c)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99882:If_L25_C8", "label": "if", "type": "if", "loc": [25, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99882:FunctionDef_L23_C4", "vector": [4, 2, 0.3984, 0.0312, 2, 0.36, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if val < 127 and val > 31:\n return c"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99882:Return_L26_C12", "label": "return", "type": "return", "loc": [26, 26], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99882:If_L25_C8", "vector": [13, 3, 0.4062, 0.0156, 3, 0.08, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return c"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99882:Return_L27_C8", "label": "return", "type": "return", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99882:FunctionDef_L23_C4", "vector": [13, 2, 0.4219, 0.0156, 2, 0.36, 1.0, 0, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '\\\\u' + hex(val)[2:].rjust(4,'0')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99882:Assign_L29_C4", "label": "string = replace()", "type": "assigned_variable", "loc": [29, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99882:FunctionDef_L22_C0", "vector": [14, 1, 0.4531, 0.0156, 1, 0.47, 0.125, 890, 3, 2, 0, 0, 293, 10, 1], "semantic": {"name": "string", "arg_names": [], "import_names": [], "rhs_call_name": "replace", "annotation": ""}, "snippet": " string = string.replace('\\\\', '\\\\\\\\')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99882:Assign_L30_C4", "label": "string = replace()", "type": "assigned_variable", "loc": [30, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99882:FunctionDef_L22_C0", "vector": [14, 1, 0.4688, 0.0156, 1, 0.47, 0.25, 890, 3, 2, 0, 0, 293, 10, 1], "semantic": {"name": "string", "arg_names": [], "import_names": [], "rhs_call_name": "replace", "annotation": ""}, "snippet": " string = string.replace('\"', '\\\\\"')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99882:Assign_L31_C4", "label": "string = replace()", "type": "assigned_variable", "loc": [31, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99882:FunctionDef_L22_C0", "vector": [14, 1, 0.4844, 0.0156, 1, 0.47, 0.375, 890, 3, 2, 0, 0, 293, 10, 1], "semantic": {"name": "string", "arg_names": [], "import_names": [], "rhs_call_name": "replace", "annotation": ""}, "snippet": " string = string.replace('\\b', '\\\\b')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99882:Assign_L32_C4", "label": "string = replace()", "type": "assigned_variable", "loc": [32, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99882:FunctionDef_L22_C0", "vector": [14, 1, 0.5, 0.0156, 1, 0.47, 0.5, 890, 3, 2, 0, 0, 293, 10, 1], "semantic": {"name": "string", "arg_names": [], "import_names": [], "rhs_call_name": "replace", "annotation": ""}, "snippet": " string = string.replace('\\f', '\\\\f')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99882:Assign_L33_C4", "label": "string = replace()", "type": "assigned_variable", "loc": [33, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99882:FunctionDef_L22_C0", "vector": [14, 1, 0.5156, 0.0156, 1, 0.47, 0.625, 890, 3, 2, 0, 0, 293, 10, 1], "semantic": {"name": "string", "arg_names": [], "import_names": [], "rhs_call_name": "replace", "annotation": ""}, "snippet": " string = string.replace('\\n', '\\\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99882:Assign_L34_C4", "label": "string = replace()", "type": "assigned_variable", "loc": [34, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99882:FunctionDef_L22_C0", "vector": [14, 1, 0.5312, 0.0156, 1, 0.47, 0.75, 890, 3, 2, 0, 0, 293, 10, 1], "semantic": {"name": "string", "arg_names": [], "import_names": [], "rhs_call_name": "replace", "annotation": ""}, "snippet": " string = string.replace('\\r', '\\\\r')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99882:Assign_L35_C4", "label": "string = replace()", "type": "assigned_variable", "loc": [35, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99882:FunctionDef_L22_C0", "vector": [14, 1, 0.5469, 0.0156, 1, 0.47, 0.875, 890, 3, 2, 0, 0, 293, 10, 1], "semantic": {"name": "string", "arg_names": [], "import_names": [], "rhs_call_name": "replace", "annotation": ""}, "snippet": " string = string.replace('\\t', '\\\\t')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99882:Return_L36_C4", "label": "return", "type": "return", "loc": [36, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99882:FunctionDef_L22_C0", "vector": [13, 1, 0.5625, 0.0156, 1, 0.47, 1.0, 0, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '\"%s\"' % ''.join(get_matching_char(c) for c in string)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99882:FunctionDef_L38_C0", "label": "json_dump", "type": "function", "loc": [38, 64], "level": 0, "parent": null, "vector": [2, 0, 0.7969, 0.4219, 0, 0.66, 1.0, 665, 0, 3, 0, 0, 0, 0, 27], "semantic": {"name": "json_dump", "arg_names": ["data", "output", "mappings"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def json_dump(data, output, mappings=None):\n if data is None:\n output.write('null')\n elif isinstance(data, dict):\n output.write('{')\n for index, key in enumerate(sorted(data)):\n json_dump(key, output, mappings)\n output.write(':')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99882:If_L39_C4", "label": "if", "type": "if", "loc": [39, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99882:FunctionDef_L38_C0", "vector": [4, 1, 0.8047, 0.4062, 1, 0.8, 0.0, 0, 0, 0, 0, 0, 0, 0, 27], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if data is None:\n output.write('null')\n elif isinstance(data, dict):\n output.write('{')\n for index, key in enumerate(sorted(data)):\n json_dump(key, output, mappings)\n output.write(':')\n json_dump(data[key], output, mappings)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99882:Expr_L40_C8", "label": "write()", "type": "expression", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99882:If_L39_C4", "vector": [8, 2, 0.625, 0.0156, 2, 0.28, 0.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " output.write('null')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99882:If_L41_C4", "label": "if", "type": "if", "loc": [41, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99882:If_L39_C4", "vector": [4, 2, 0.8203, 0.375, 2, 0.28, 1.0, 0, 3, 0, 0, 0, 0, 0, 26], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif isinstance(data, dict):\n output.write('{')\n for index, key in enumerate(sorted(data)):\n json_dump(key, output, mappings)\n output.write(':')\n json_dump(data[key], output, mappings)\n if index < len(data)-1:\n output.write(',')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99882:Expr_L42_C8", "label": "write()", "type": "expression", "loc": [42, 42], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99882:If_L41_C4", "vector": [8, 3, 0.6562, 0.0156, 3, 0.43, 0.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " output.write('{')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99882:For_L43_C8", "label": "for index, key", "type": "for", "loc": [43, 48], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99882:If_L41_C4", "vector": [6, 3, 0.7109, 0.0938, 3, 0.43, 0.3333, 370, 3, 0, 0, 0, 0, 0, 7], "semantic": {"name": "index, key", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for index, key in enumerate(sorted(data)):\n json_dump(key, output, mappings)\n output.write(':')\n json_dump(data[key], output, mappings)\n if index < len(data)-1:\n output.write(',')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99882:Expr_L44_C12", "label": "json_dump()", "type": "expression", "loc": [44, 44], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99882:For_L43_C8", "vector": [8, 4, 0.6875, 0.0156, 4, 0.64, 0.0, 665, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "json_dump", "arg_names": [], "import_names": [], "rhs_call_name": "json_dump", "annotation": ""}, "snippet": " json_dump(key, output, mappings)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99882:Expr_L45_C12", "label": "write()", "type": "expression", "loc": [45, 45], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99882:For_L43_C8", "vector": [8, 4, 0.7031, 0.0156, 4, 0.64, 0.3333, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " output.write(':')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99882:Expr_L46_C12", "label": "json_dump()", "type": "expression", "loc": [46, 46], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99882:For_L43_C8", "vector": [8, 4, 0.7188, 0.0156, 4, 0.64, 0.6667, 665, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "json_dump", "arg_names": [], "import_names": [], "rhs_call_name": "json_dump", "annotation": ""}, "snippet": " json_dump(data[key], output, mappings)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99882:If_L47_C12", "label": "if", "type": "if", "loc": [47, 48], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99882:For_L43_C8", "vector": [4, 4, 0.7422, 0.0312, 4, 0.64, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if index < len(data)-1:\n output.write(',')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99882:Expr_L48_C16", "label": "write()", "type": "expression", "loc": [48, 48], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99882:If_L47_C12", "vector": [8, 5, 0.75, 0.0156, 5, 0.46, 0.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " output.write(',')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99882:Expr_L49_C8", "label": "write()", "type": "expression", "loc": [49, 49], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99882:If_L41_C4", "vector": [8, 3, 0.7656, 0.0156, 3, 0.43, 0.6667, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " output.write('}')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99882:If_L50_C4", "label": "if", "type": "if", "loc": [50, 64], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99882:If_L41_C4", "vector": [4, 3, 0.8906, 0.2344, 3, 0.43, 1.0, 0, 3, 0, 0, 0, 0, 0, 16], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif isinstance(data, (list, tuple)):\n output.write('[')\n for index, item in enumerate(data):\n json_dump(item, output, mappings)\n if index < len(data)-1:\n output.write(',')\n output.write(']')\n elif mappings and data in mappings:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99882:Expr_L51_C8", "label": "write()", "type": "expression", "loc": [51, 51], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99882:If_L50_C4", "vector": [8, 4, 0.7969, 0.0156, 4, 0.45, 0.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " output.write('[')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99882:For_L52_C8", "label": "for index, item", "type": "for", "loc": [52, 55], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99882:If_L50_C4", "vector": [6, 4, 0.8359, 0.0625, 4, 0.45, 0.3333, 387, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "index, item", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for index, item in enumerate(data):\n json_dump(item, output, mappings)\n if index < len(data)-1:\n output.write(',')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99882:Expr_L53_C12", "label": "json_dump()", "type": "expression", "loc": [53, 53], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99882:For_L52_C8", "vector": [8, 5, 0.8281, 0.0156, 5, 0.15, 0.0, 665, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "json_dump", "arg_names": [], "import_names": [], "rhs_call_name": "json_dump", "annotation": ""}, "snippet": " json_dump(item, output, mappings)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99882:If_L54_C12", "label": "if", "type": "if", "loc": [54, 55], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99882:For_L52_C8", "vector": [4, 5, 0.8516, 0.0312, 5, 0.15, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if index < len(data)-1:\n output.write(',')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99882:Expr_L55_C16", "label": "write()", "type": "expression", "loc": [55, 55], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99882:If_L54_C12", "vector": [8, 6, 0.8594, 0.0156, 6, 0.46, 0.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " output.write(',')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99882:Expr_L56_C8", "label": "write()", "type": "expression", "loc": [56, 56], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99882:If_L50_C4", "vector": [8, 4, 0.875, 0.0156, 4, 0.45, 0.6667, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " output.write(']')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99882:If_L57_C4", "label": "if", "type": "if", "loc": [57, 64], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99882:If_L50_C4", "vector": [4, 4, 0.9453, 0.125, 4, 0.45, 1.0, 0, 0, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif mappings and data in mappings:\n output.write(mappings[data])\n elif isinstance(data, (int, long)):\n output.write(str(data))\n elif isinstance(data, basestring):\n output.write(encode_basestring(data))\n else:\n raise Exception('Data type (%s) serialization not supported' % type(data))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99882:Expr_L58_C8", "label": "write()", "type": "expression", "loc": [58, 58], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99882:If_L57_C4", "vector": [8, 5, 0.9062, 0.0156, 5, 0.29, 0.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " output.write(mappings[data])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99882:If_L59_C4", "label": "if", "type": "if", "loc": [59, 64], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99882:If_L57_C4", "vector": [4, 5, 0.9609, 0.0938, 5, 0.29, 1.0, 0, 3, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif isinstance(data, (int, long)):\n output.write(str(data))\n elif isinstance(data, basestring):\n output.write(encode_basestring(data))\n else:\n raise Exception('Data type (%s) serialization not supported' % type(data))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99882:Expr_L60_C8", "label": "write()", "type": "expression", "loc": [60, 60], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99882:If_L59_C4", "vector": [8, 6, 0.9375, 0.0156, 6, 0.51, 0.0, 837, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " output.write(str(data))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99882:If_L61_C4", "label": "if", "type": "if", "loc": [61, 64], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99882:If_L59_C4", "vector": [4, 6, 0.9766, 0.0625, 6, 0.51, 1.0, 0, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif isinstance(data, basestring):\n output.write(encode_basestring(data))\n else:\n raise Exception('Data type (%s) serialization not supported' % type(data))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99882:Expr_L62_C8", "label": "write()", "type": "expression", "loc": [62, 62], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99882:If_L61_C4", "vector": [8, 7, 0.9688, 0.0156, 7, 0.02, 0.0, 837, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " output.write(encode_basestring(data))"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99882:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99882:FunctionDef_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99882:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99882:Assign_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99882:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99882:If_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99882:If_L25_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99882:Return_L26_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99882:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99882:Return_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99882:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99882:Assign_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99882:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99882:Assign_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99882:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99882:Assign_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99882:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99882:Assign_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99882:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99882:Assign_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99882:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99882:Assign_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99882:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99882:Assign_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99882:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99882:Return_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99882:FunctionDef_L38_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99882:If_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99882:If_L39_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99882:Expr_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99882:If_L39_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99882:If_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99882:If_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99882:Expr_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99882:If_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99882:For_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99882:For_L43_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99882:Expr_L44_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99882:For_L43_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99882:Expr_L45_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99882:For_L43_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99882:Expr_L46_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99882:For_L43_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99882:If_L47_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99882:If_L47_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99882:Expr_L48_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99882:If_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99882:Expr_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99882:If_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99882:If_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99882:If_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99882:Expr_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99882:If_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99882:For_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99882:For_L52_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99882:Expr_L53_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99882:For_L52_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99882:If_L54_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99882:If_L54_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99882:Expr_L55_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99882:If_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99882:Expr_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99882:If_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99882:If_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99882:If_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99882:Expr_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99882:If_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99882:If_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99882:If_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99882:Expr_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99882:If_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99882:If_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99882:If_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99882:Expr_L62_C8"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from robot import utils
class XUnitWriter:
"""Provides an xUnit-compatible result file.
Attempts to adhere to the de facto schema guessed by Peter Reilly, see:
http://marc.info/?l=ant-dev&m=123551933508682
"""
def __init__(self, output):
self._writer = utils.XmlWriter(output)
self._root_suite = None
self._detail_serializer = _NopSerializer()
def close(self):
self._writer.close()
def start_suite(self, suite):
if self._root_suite:
return
self._root_suite = suite
attrs = {'name': suite.name,
'tests': str(suite.get_test_count()),
'errors': '0',
'failures': str(suite.all_stats.failed),
'skip': '0'}
self._writer.start('testsuite', attrs)
def end_suite(self, suite):
if suite is self._root_suite:
self._writer.end('testsuite')
def start_test(self, test):
attrs = {'classname': test.parent.get_long_name(),
'name': test.name,
'time': self._time_as_seconds(test.elapsedtime)}
self._writer.start('testcase', attrs)
if test.status == 'FAIL':
self._detail_serializer = _FailedTestSerializer(self._writer, test)
def _time_as_seconds(self, millis):
return str(int(round(millis, -3) / 1000))
def end_test(self, test):
self._detail_serializer.end_test()
self._detail_serializer = _NopSerializer()
self._writer.end('testcase')
def start_keyword(self, kw):
pass
def end_keyword(self, kw):
pass
def message(self, msg):
self._detail_serializer.message(msg)
class _FailedTestSerializer:
"""Specific policy to serialize a failed test case details"""
def __init__(self, writer, test):
self._writer = writer
self._writer.start('failure',
{'message': test.message, 'type': 'AssertionError'})
def end_test(self):
self._writer.end('failure')
def message(self, msg):
"""Populates the <failure> section, normally only with a 'Stacktrace'.
There is a weakness here because filtering is based on message level:
- DEBUG level is used by RF for 'Tracebacks' (what is expected here)
- INFO and TRACE are used for keywords and arguments (not errors)
- first FAIL message is already reported as <failure> attribute
"""
if msg.level == 'DEBUG':
self._writer.content(msg.message)
class _NopSerializer:
"""Default policy when there's no detail to serialize"""
def end_test(self):
pass
def message(self, msg):
pass
| ajibawa-2023/Python-Code-Large/train/row_99883 | 48 | 105 | 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_99883:ImportFrom_L16_C0", "label": "from robot import utils", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.1524, 0.0095, 0, 0.66, 0.0, 735, 0, 1, 0, 0, 735, 0, 0], "semantic": {"name": "robot", "arg_names": [], "import_names": ["utils"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot import utils"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99883:ClassDef_L19_C0", "label": "XUnitWriter", "type": "class", "loc": [19, 72], "level": 0, "parent": null, "vector": [3, 0, 0.4333, 0.5143, 0, 0.66, 0.3333, 553, 0, 10, 0, 0, 0, 0, 19], "semantic": {"name": "XUnitWriter", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class XUnitWriter:\n \"\"\"Provides an xUnit-compatible result file.\n\n Attempts to adhere to the de facto schema guessed by Peter Reilly, see:\n http://marc.info/?l=ant-dev&m=123551933508682\n \"\"\"\n\n def __init__(self, output):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99883:Expr_L20_C4", "label": "expression", "type": "expression", "loc": [20, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99883:ClassDef_L19_C0", "vector": [8, 1, 0.2095, 0.0476, 1, 0.25, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Provides an xUnit-compatible result file.\n\n Attempts to adhere to the de facto schema guessed by Peter Reilly, see:\n http://marc.info/?l=ant-dev&m=123551933508682\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L26_C4", "label": "__init__", "type": "function", "loc": [26, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99883:ClassDef_L19_C0", "vector": [2, 1, 0.2619, 0.0381, 1, 0.25, 0.1, 555, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "output"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, output):\n self._writer = utils.XmlWriter(output)\n self._root_suite = None\n self._detail_serializer = _NopSerializer()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99883:Assign_L27_C8", "label": "self._writer = XmlWriter()", "type": "assigned_variable", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L26_C4", "vector": [14, 2, 0.2571, 0.0095, 2, 0.94, 0.0, 446, 3, 1, 0, 0, 730, 10, 1], "semantic": {"name": "self._writer", "arg_names": [], "import_names": [], "rhs_call_name": "XmlWriter", "annotation": ""}, "snippet": " self._writer = utils.XmlWriter(output)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99883:Assign_L28_C8", "label": "self._root_suite =", "type": "assigned_variable", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L26_C4", "vector": [14, 2, 0.2667, 0.0095, 2, 0.94, 0.5, 284, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self._root_suite", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._root_suite = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99883:Assign_L29_C8", "label": "self._detail_serializer = _NopSerializer()", "type": "assigned_variable", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L26_C4", "vector": [14, 2, 0.2762, 0.0095, 2, 0.94, 1.0, 864, 3, 0, 0, 0, 140, 10, 1], "semantic": {"name": "self._detail_serializer", "arg_names": [], "import_names": [], "rhs_call_name": "_NopSerializer", "annotation": ""}, "snippet": " self._detail_serializer = _NopSerializer()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L31_C4", "label": "close", "type": "function", "loc": [31, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99883:ClassDef_L19_C0", "vector": [2, 1, 0.3, 0.019, 1, 0.25, 0.2, 77, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def close(self):\n self._writer.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99883:Expr_L32_C8", "label": "close()", "type": "expression", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L31_C4", "vector": [8, 2, 0.3048, 0.0095, 2, 0.38, 0.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " self._writer.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L34_C4", "label": "start_suite", "type": "function", "loc": [34, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99883:ClassDef_L19_C0", "vector": [2, 1, 0.3667, 0.0952, 1, 0.25, 0.3, 38, 0, 2, 0, 0, 0, 0, 4], "semantic": {"name": "start_suite", "arg_names": ["self", "suite"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start_suite(self, suite):\n if self._root_suite:\n return\n self._root_suite = suite\n attrs = {'name': suite.name,\n 'tests': str(suite.get_test_count()),\n 'errors': '0',\n 'failures': str(suite.all_stats.failed),"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99883:If_L35_C8", "label": "if", "type": "if", "loc": [35, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L34_C4", "vector": [4, 2, 0.3381, 0.019, 2, 0.34, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._root_suite:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99883:Return_L36_C12", "label": "return", "type": "return", "loc": [36, 36], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99883:If_L35_C8", "vector": [13, 3, 0.3429, 0.0095, 3, 0.53, 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_99883:Assign_L37_C8", "label": "self._root_suite =", "type": "assigned_variable", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L34_C4", "vector": [14, 2, 0.3524, 0.0095, 2, 0.34, 0.3333, 284, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._root_suite", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._root_suite = suite"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99883:Assign_L38_C8", "label": "attrs =", "type": "assigned_variable", "loc": [38, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L34_C4", "vector": [14, 2, 0.381, 0.0476, 2, 0.34, 0.6667, 251, 0, 0, 0, 0, 0, 6, 3], "semantic": {"name": "attrs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " attrs = {'name': suite.name,\n 'tests': str(suite.get_test_count()),\n 'errors': '0',\n 'failures': str(suite.all_stats.failed),\n 'skip': '0'}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99883:Expr_L43_C8", "label": "start()", "type": "expression", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L34_C4", "vector": [8, 2, 0.4095, 0.0095, 2, 0.34, 1.0, 511, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " self._writer.start('testsuite', attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L45_C4", "label": "end_suite", "type": "function", "loc": [45, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99883:ClassDef_L19_C0", "vector": [2, 1, 0.4381, 0.0286, 1, 0.25, 0.4, 81, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "end_suite", "arg_names": ["self", "suite"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end_suite(self, suite):\n if suite is self._root_suite:\n self._writer.end('testsuite')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99883:If_L46_C8", "label": "if", "type": "if", "loc": [46, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L45_C4", "vector": [4, 2, 0.4429, 0.019, 2, 0.23, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if suite is self._root_suite:\n self._writer.end('testsuite')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99883:Expr_L47_C12", "label": "end()", "type": "expression", "loc": [47, 47], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99883:If_L46_C8", "vector": [8, 3, 0.4476, 0.0095, 3, 0.79, 0.0, 128, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "end", "arg_names": [], "import_names": [], "rhs_call_name": "end", "annotation": ""}, "snippet": " self._writer.end('testsuite')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L49_C4", "label": "start_test", "type": "function", "loc": [49, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99883:ClassDef_L19_C0", "vector": [2, 1, 0.4952, 0.0667, 1, 0.25, 0.5, 246, 0, 2, 0, 0, 0, 0, 4], "semantic": {"name": "start_test", "arg_names": ["self", "test"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start_test(self, test):\n attrs = {'classname': test.parent.get_long_name(),\n 'name': test.name,\n 'time': self._time_as_seconds(test.elapsedtime)}\n self._writer.start('testcase', attrs)\n if test.status == 'FAIL':\n self._detail_serializer = _FailedTestSerializer(self._writer, test)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99883:Assign_L50_C8", "label": "attrs =", "type": "assigned_variable", "loc": [50, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L49_C4", "vector": [14, 2, 0.4857, 0.0286, 2, 0.68, 0.0, 251, 0, 0, 0, 0, 0, 6, 2], "semantic": {"name": "attrs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " attrs = {'classname': test.parent.get_long_name(),\n 'name': test.name,\n 'time': self._time_as_seconds(test.elapsedtime)}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99883:Expr_L53_C8", "label": "start()", "type": "expression", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L49_C4", "vector": [8, 2, 0.5048, 0.0095, 2, 0.68, 0.5, 511, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " self._writer.start('testcase', attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99883:If_L54_C8", "label": "if", "type": "if", "loc": [54, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L49_C4", "vector": [4, 2, 0.519, 0.019, 2, 0.68, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if test.status == 'FAIL':\n self._detail_serializer = _FailedTestSerializer(self._writer, test)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99883:Assign_L55_C12", "label": "self._detail_serializer = _FailedTestSerializer()", "type": "assigned_variable", "loc": [55, 55], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99883:If_L54_C8", "vector": [14, 3, 0.5238, 0.0095, 3, 0.55, 0.0, 864, 3, 2, 0, 0, 215, 10, 1], "semantic": {"name": "self._detail_serializer", "arg_names": [], "import_names": [], "rhs_call_name": "_FailedTestSerializer", "annotation": ""}, "snippet": " self._detail_serializer = _FailedTestSerializer(self._writer, test)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L57_C4", "label": "_time_as_seconds", "type": "function", "loc": [57, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99883:ClassDef_L19_C0", "vector": [2, 1, 0.5476, 0.019, 1, 0.25, 0.6, 758, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "_time_as_seconds", "arg_names": ["self", "millis"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _time_as_seconds(self, millis):\n return str(int(round(millis, -3) / 1000))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99883:Return_L58_C8", "label": "return", "type": "return", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L57_C4", "vector": [13, 2, 0.5524, 0.0095, 2, 0.6, 0.0, 0, 3, 0, 0, 0, 0, 10, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return str(int(round(millis, -3) / 1000))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L60_C4", "label": "end_test", "type": "function", "loc": [60, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99883:ClassDef_L19_C0", "vector": [2, 1, 0.5857, 0.0381, 1, 0.25, 0.7, 220, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "end_test", "arg_names": ["self", "test"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end_test(self, test):\n self._detail_serializer.end_test()\n self._detail_serializer = _NopSerializer()\n self._writer.end('testcase')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99883:Expr_L61_C8", "label": "end_test()", "type": "expression", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L60_C4", "vector": [8, 2, 0.581, 0.0095, 2, 0.68, 0.0, 220, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "end_test", "arg_names": [], "import_names": [], "rhs_call_name": "end_test", "annotation": ""}, "snippet": " self._detail_serializer.end_test()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99883:Assign_L62_C8", "label": "self._detail_serializer = _NopSerializer()", "type": "assigned_variable", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L60_C4", "vector": [14, 2, 0.5905, 0.0095, 2, 0.68, 0.5, 864, 3, 0, 0, 0, 140, 10, 1], "semantic": {"name": "self._detail_serializer", "arg_names": [], "import_names": [], "rhs_call_name": "_NopSerializer", "annotation": ""}, "snippet": " self._detail_serializer = _NopSerializer()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99883:Expr_L63_C8", "label": "end()", "type": "expression", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L60_C4", "vector": [8, 2, 0.6, 0.0095, 2, 0.68, 1.0, 128, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "end", "arg_names": [], "import_names": [], "rhs_call_name": "end", "annotation": ""}, "snippet": " self._writer.end('testcase')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L65_C4", "label": "start_keyword", "type": "function", "loc": [65, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99883:ClassDef_L19_C0", "vector": [2, 1, 0.6238, 0.019, 1, 0.25, 0.8, 776, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "start_keyword", "arg_names": ["self", "kw"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start_keyword(self, kw):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L68_C4", "label": "end_keyword", "type": "function", "loc": [68, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99883:ClassDef_L19_C0", "vector": [2, 1, 0.6524, 0.019, 1, 0.25, 0.9, 959, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "end_keyword", "arg_names": ["self", "kw"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end_keyword(self, kw):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L71_C4", "label": "message", "type": "function", "loc": [71, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99883:ClassDef_L19_C0", "vector": [2, 1, 0.681, 0.019, 1, 0.25, 1.0, 635, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "message", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def message(self, msg):\n self._detail_serializer.message(msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99883:Expr_L72_C8", "label": "message()", "type": "expression", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L71_C4", "vector": [8, 2, 0.6857, 0.0095, 2, 0.04, 0.0, 635, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "message", "arg_names": [], "import_names": [], "rhs_call_name": "message", "annotation": ""}, "snippet": " self._detail_serializer.message(msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99883:ClassDef_L75_C0", "label": "_FailedTestSerializer", "type": "class", "loc": [75, 95], "level": 0, "parent": null, "vector": [3, 0, 0.8095, 0.2, 0, 0.66, 0.6667, 215, 0, 3, 0, 0, 0, 0, 3], "semantic": {"name": "_FailedTestSerializer", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _FailedTestSerializer:\n \"\"\"Specific policy to serialize a failed test case details\"\"\"\n\n def __init__(self, writer, test):\n self._writer = writer\n self._writer.start('failure',\n {'message': test.message, 'type': 'AssertionError'})\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99883:Expr_L76_C4", "label": "expression", "type": "expression", "loc": [76, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99883:ClassDef_L75_C0", "vector": [8, 1, 0.7238, 0.0095, 1, 0.04, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Specific policy to serialize a failed test case details\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L78_C4", "label": "__init__", "type": "function", "loc": [78, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99883:ClassDef_L75_C0", "vector": [2, 1, 0.7571, 0.0381, 1, 0.04, 0.3333, 555, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "writer", "test"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, writer, test):\n self._writer = writer\n self._writer.start('failure',\n {'message': test.message, 'type': 'AssertionError'})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99883:Assign_L79_C8", "label": "self._writer =", "type": "assigned_variable", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L78_C4", "vector": [14, 2, 0.7524, 0.0095, 2, 0.4, 0.0, 446, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._writer", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._writer = writer"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99883:Expr_L80_C8", "label": "start()", "type": "expression", "loc": [80, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L78_C4", "vector": [8, 2, 0.7667, 0.019, 2, 0.4, 1.0, 511, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " self._writer.start('failure',\n {'message': test.message, 'type': 'AssertionError'})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L83_C4", "label": "end_test", "type": "function", "loc": [83, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99883:ClassDef_L75_C0", "vector": [2, 1, 0.7952, 0.019, 1, 0.04, 0.6667, 220, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "end_test", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end_test(self):\n self._writer.end('failure')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99883:Expr_L84_C8", "label": "end()", "type": "expression", "loc": [84, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L83_C4", "vector": [8, 2, 0.8, 0.0095, 2, 0.05, 0.0, 128, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "end", "arg_names": [], "import_names": [], "rhs_call_name": "end", "annotation": ""}, "snippet": " self._writer.end('failure')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L86_C4", "label": "message", "type": "function", "loc": [86, 95], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99883:ClassDef_L75_C0", "vector": [2, 1, 0.8619, 0.0952, 1, 0.04, 1.0, 635, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "message", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def message(self, msg):\n \"\"\"Populates the <failure> section, normally only with a 'Stacktrace'.\n\n There is a weakness here because filtering is based on message level:\n - DEBUG level is used by RF for 'Tracebacks' (what is expected here)\n - INFO and TRACE are used for keywords and arguments (not errors)\n - first FAIL message is already reported as <failure> attribute\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99883:Expr_L87_C8", "label": "expression", "type": "expression", "loc": [87, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L86_C4", "vector": [8, 2, 0.8571, 0.0667, 2, 0.53, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Populates the <failure> section, normally only with a 'Stacktrace'.\n\n There is a weakness here because filtering is based on message level:\n - DEBUG level is used by RF for 'Tracebacks' (what is expected here)\n - INFO and TRACE are used for keywords and arguments (not errors)\n - first FAIL message is already reported as <failure> attribute\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99883:If_L94_C8", "label": "if", "type": "if", "loc": [94, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L86_C4", "vector": [4, 2, 0.9, 0.019, 2, 0.53, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if msg.level == 'DEBUG':\n self._writer.content(msg.message)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99883:Expr_L95_C12", "label": "content()", "type": "expression", "loc": [95, 95], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99883:If_L94_C8", "vector": [8, 3, 0.9048, 0.0095, 3, 0.9, 0.0, 273, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "content", "arg_names": [], "import_names": [], "rhs_call_name": "content", "annotation": ""}, "snippet": " self._writer.content(msg.message)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99883:ClassDef_L98_C0", "label": "_NopSerializer", "type": "class", "loc": [98, 105], "level": 0, "parent": null, "vector": [3, 0, 0.9667, 0.0762, 0, 0.66, 1.0, 140, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "_NopSerializer", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _NopSerializer:\n \"\"\"Default policy when there's no detail to serialize\"\"\"\n\n def end_test(self):\n pass\n\n def message(self, msg):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99883:Expr_L99_C4", "label": "expression", "type": "expression", "loc": [99, 99], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99883:ClassDef_L98_C0", "vector": [8, 1, 0.9429, 0.0095, 1, 0.88, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Default policy when there's no detail to serialize\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L101_C4", "label": "end_test", "type": "function", "loc": [101, 102], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99883:ClassDef_L98_C0", "vector": [2, 1, 0.9667, 0.019, 1, 0.88, 0.5, 220, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "end_test", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end_test(self):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L104_C4", "label": "message", "type": "function", "loc": [104, 105], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99883:ClassDef_L98_C0", "vector": [2, 1, 0.9952, 0.019, 1, 0.88, 1.0, 635, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "message", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def message(self, msg):\n pass"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99883:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99883:Expr_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99883:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99883:Assign_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99883:Assign_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99883:Assign_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99883:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99883:Expr_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99883:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99883:If_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99883:If_L35_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99883:Return_L36_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99883:Assign_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99883:Assign_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99883:Expr_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99883:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99883:If_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99883:If_L46_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99883:Expr_L47_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99883:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99883:Assign_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99883:Expr_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99883:If_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99883:If_L54_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99883:Assign_L55_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99883:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99883:Return_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99883:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99883:Expr_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99883:Assign_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99883:Expr_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99883:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99883:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99883:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99883:Expr_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99883:ClassDef_L75_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99883:Expr_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99883:ClassDef_L75_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99883:Assign_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99883:Expr_L80_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99883:ClassDef_L75_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L83_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99883:Expr_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99883:ClassDef_L75_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L86_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L86_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99883:Expr_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L86_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99883:If_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99883:If_L94_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99883:Expr_L95_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99883:ClassDef_L98_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99883:Expr_L99_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99883:ClassDef_L98_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L101_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99883:ClassDef_L98_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99883:FunctionDef_L104_C4"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from robot.common import Statistics
from robot.output import LOGGER, process_outputs
from outputwriter import OutputWriter
from xunitwriter import XUnitWriter
from builders import LogBuilder, ReportBuilder, XUnitBuilder, OutputBuilder
import jsparser
class ResultWriter(object):
def __init__(self, settings):
self._xml_result = None
self._suite = None
self._settings = settings
self._data_sources = None
def write_robot_results(self, data_source):
self._data_sources = [data_source]
self._data_model = None
LogBuilder(self).build()
ReportBuilder(self).build()
XUnitBuilder(self).build()
@property
def data_model(self):
if self._data_model is None:
self._data_model = jsparser.create_datamodel_from(self._data_sources[0], self._settings['SplitLog'])
return self._data_model
@property
def settings(self):
return self._settings
@property
def result_from_xml(self):
if self._xml_result is None:
self._suite, errs = process_outputs(self._data_sources, self._settings)
self._suite.set_options(self._settings)
self._xml_result = ResultFromXML(self._suite, errs, self._settings)
return self._xml_result
def write_rebot_results(self, *data_sources):
self._data_sources = data_sources
builder = OutputBuilder(self)
self.write_robot_results(builder.build())
builder.finalize()
return self._suite
class ResultFromXML(object):
def __init__(self, suite, exec_errors, settings=None):
self.suite = suite
self.exec_errors = exec_errors
if settings:
params = (settings['SuiteStatLevel'], settings['TagStatInclude'],
settings['TagStatExclude'], settings['TagStatCombine'],
settings['TagDoc'], settings['TagStatLink'])
else:
params = ()
self.statistics = Statistics(suite, *params)
self._generator = 'Robot'
def serialize_output(self, path, log=True):
if path == 'NONE':
return
serializer = OutputWriter(path)
self.suite.serialize(serializer)
self.statistics.serialize(serializer)
self.exec_errors.serialize(serializer)
serializer.close()
if log:
LOGGER.output_file('Output', path)
def serialize_xunit(self, path):
if path == 'NONE':
return
serializer = XUnitWriter(path)
try:
self.suite.serialize(serializer)
finally:
serializer.close()
LOGGER.output_file('XUnit', path)
| ajibawa-2023/Python-Code-Large/train/row_99884 | 63 | 99 | 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_99884:ImportFrom_L15_C0", "label": "from robot.common import Statistics", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.1515, 0.0101, 0, 0.66, 0.0, 355, 0, 1, 0, 0, 355, 0, 0], "semantic": {"name": "robot.common", "arg_names": [], "import_names": ["Statistics"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot.common import Statistics"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99884:ImportFrom_L16_C0", "label": "from robot.output import LOGGER, process_outputs", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.1616, 0.0101, 0, 0.66, 0.1429, 596, 0, 2, 0, 0, 596, 0, 0], "semantic": {"name": "robot.output", "arg_names": [], "import_names": ["LOGGER", "process_outputs"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot.output import LOGGER, process_outputs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99884:ImportFrom_L18_C0", "label": "from outputwriter import OutputWriter", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.1818, 0.0101, 0, 0.66, 0.2857, 455, 0, 1, 0, 0, 455, 0, 0], "semantic": {"name": "outputwriter", "arg_names": [], "import_names": ["OutputWriter"], "rhs_call_name": "", "annotation": ""}, "snippet": "from outputwriter import OutputWriter"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99884:ImportFrom_L19_C0", "label": "from xunitwriter import XUnitWriter", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.1919, 0.0101, 0, 0.66, 0.4286, 107, 0, 1, 0, 0, 107, 0, 0], "semantic": {"name": "xunitwriter", "arg_names": [], "import_names": ["XUnitWriter"], "rhs_call_name": "", "annotation": ""}, "snippet": "from xunitwriter import XUnitWriter"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99884:ImportFrom_L20_C0", "label": "from builders import LogBuilder, ReportBuilder, XUnitBuilder\u2026", "type": "import", "loc": [20, 20], "level": 0, "parent": null, "vector": [1, 0, 0.202, 0.0101, 0, 0.66, 0.5714, 306, 0, 4, 0, 0, 306, 0, 0], "semantic": {"name": "builders", "arg_names": [], "import_names": ["LogBuilder", "ReportBuilder", "XUnitBuilder", "OutputBuilder"], "rhs_call_name": "", "annotation": ""}, "snippet": "from builders import LogBuilder, ReportBuilder, XUnitBuilder, OutputBuilder"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99884:Import_L21_C0", "label": "jsparser import jsparser", "type": "import", "loc": [21, 21], "level": 0, "parent": null, "vector": [1, 0, 0.2121, 0.0101, 0, 0.66, 0.7143, 180, 0, 1, 0, 0, 180, 0, 0], "semantic": {"name": "jsparser", "arg_names": [], "import_names": ["jsparser"], "rhs_call_name": "", "annotation": ""}, "snippet": "import jsparser"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99884:ClassDef_L24_C0", "label": "ResultWriter", "type": "class", "loc": [24, 62], "level": 0, "parent": null, "vector": [3, 0, 0.4343, 0.3939, 0, 0.66, 0.8571, 490, 0, 6, 0, 0, 186, 0, 14], "semantic": {"name": "ResultWriter", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ResultWriter(object):\n\n def __init__(self, settings):\n self._xml_result = None\n self._suite = None\n self._settings = settings\n self._data_sources = None\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L26_C4", "label": "__init__", "type": "function", "loc": [26, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99884:ClassDef_L24_C0", "vector": [2, 1, 0.2828, 0.0505, 1, 0.32, 0.0, 555, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "settings"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, settings):\n self._xml_result = None\n self._suite = None\n self._settings = settings\n self._data_sources = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99884:Assign_L27_C8", "label": "self._xml_result =", "type": "assigned_variable", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L26_C4", "vector": [14, 2, 0.2727, 0.0101, 2, 0.8, 0.0, 352, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self._xml_result", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._xml_result = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99884:Assign_L28_C8", "label": "self._suite =", "type": "assigned_variable", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L26_C4", "vector": [14, 2, 0.2828, 0.0101, 2, 0.8, 0.3333, 755, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self._suite", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._suite = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99884:Assign_L29_C8", "label": "self._settings =", "type": "assigned_variable", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L26_C4", "vector": [14, 2, 0.2929, 0.0101, 2, 0.8, 0.6667, 417, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._settings", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._settings = settings"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99884:Assign_L30_C8", "label": "self._data_sources =", "type": "assigned_variable", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L26_C4", "vector": [14, 2, 0.303, 0.0101, 2, 0.8, 1.0, 609, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self._data_sources", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._data_sources = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L32_C4", "label": "write_robot_results", "type": "function", "loc": [32, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99884:ClassDef_L24_C0", "vector": [2, 1, 0.3485, 0.0606, 1, 0.32, 0.2, 671, 0, 2, 0, 0, 0, 0, 6], "semantic": {"name": "write_robot_results", "arg_names": ["self", "data_source"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def write_robot_results(self, data_source):\n self._data_sources = [data_source]\n self._data_model = None\n LogBuilder(self).build()\n ReportBuilder(self).build()\n XUnitBuilder(self).build()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99884:Assign_L33_C8", "label": "self._data_sources =", "type": "assigned_variable", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L32_C4", "vector": [14, 2, 0.3333, 0.0101, 2, 0.8, 0.0, 609, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self._data_sources", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._data_sources = [data_source]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99884:Assign_L34_C8", "label": "self._data_model =", "type": "assigned_variable", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L32_C4", "vector": [14, 2, 0.3434, 0.0101, 2, 0.8, 0.25, 380, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self._data_model", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._data_model = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99884:Expr_L35_C8", "label": "build()", "type": "expression", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L32_C4", "vector": [8, 2, 0.3535, 0.0101, 2, 0.8, 0.5, 448, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "build", "arg_names": [], "import_names": [], "rhs_call_name": "build", "annotation": ""}, "snippet": " LogBuilder(self).build()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99884:Expr_L36_C8", "label": "build()", "type": "expression", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L32_C4", "vector": [8, 2, 0.3636, 0.0101, 2, 0.8, 0.75, 448, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "build", "arg_names": [], "import_names": [], "rhs_call_name": "build", "annotation": ""}, "snippet": " ReportBuilder(self).build()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99884:Expr_L37_C8", "label": "build()", "type": "expression", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L32_C4", "vector": [8, 2, 0.3737, 0.0101, 2, 0.8, 1.0, 448, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "build", "arg_names": [], "import_names": [], "rhs_call_name": "build", "annotation": ""}, "snippet": " XUnitBuilder(self).build()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L40_C4", "label": "data_model", "type": "function", "loc": [40, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99884:ClassDef_L24_C0", "vector": [2, 1, 0.4192, 0.0404, 1, 0.32, 0.4, 790, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "data_model", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def data_model(self):\n if self._data_model is None:\n self._data_model = jsparser.create_datamodel_from(self._data_sources[0], self._settings['SplitLog'])\n return self._data_model"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99884:If_L41_C8", "label": "if", "type": "if", "loc": [41, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L40_C4", "vector": [4, 2, 0.4192, 0.0202, 2, 0.35, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._data_model is None:\n self._data_model = jsparser.create_datamodel_from(self._data_sources[0], self._settings['SplitLog'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99884:Assign_L42_C12", "label": "self._data_model = create_datamodel_from()", "type": "assigned_variable", "loc": [42, 42], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99884:If_L41_C8", "vector": [14, 3, 0.4242, 0.0101, 3, 0.39, 0.0, 380, 3, 2, 0, 0, 209, 10, 1], "semantic": {"name": "self._data_model", "arg_names": [], "import_names": [], "rhs_call_name": "create_datamodel_from", "annotation": ""}, "snippet": " self._data_model = jsparser.create_datamodel_from(self._data_sources[0], self._settings['SplitLog'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99884:Return_L43_C8", "label": "return", "type": "return", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L40_C4", "vector": [13, 2, 0.4343, 0.0101, 2, 0.35, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._data_model"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L46_C4", "label": "settings", "type": "function", "loc": [46, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99884:ClassDef_L24_C0", "vector": [2, 1, 0.4697, 0.0202, 1, 0.32, 0.6, 168, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "settings", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def settings(self):\n return self._settings"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99884:Return_L47_C8", "label": "return", "type": "return", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L46_C4", "vector": [13, 2, 0.4747, 0.0101, 2, 0.6, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._settings"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L50_C4", "label": "result_from_xml", "type": "function", "loc": [50, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99884:ClassDef_L24_C0", "vector": [2, 1, 0.5303, 0.0606, 1, 0.32, 0.8, 699, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "result_from_xml", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def result_from_xml(self):\n if self._xml_result is None:\n self._suite, errs = process_outputs(self._data_sources, self._settings)\n self._suite.set_options(self._settings)\n self._xml_result = ResultFromXML(self._suite, errs, self._settings)\n return self._xml_result"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99884:If_L51_C8", "label": "if", "type": "if", "loc": [51, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L50_C4", "vector": [4, 2, 0.5303, 0.0404, 2, 0.42, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._xml_result is None:\n self._suite, errs = process_outputs(self._data_sources, self._settings)\n self._suite.set_options(self._settings)\n self._xml_result = ResultFromXML(self._suite, errs, self._settings)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99884:Assign_L52_C12", "label": "errs = process_outputs()", "type": "assigned_variable", "loc": [52, 52], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99884:If_L51_C8", "vector": [14, 3, 0.5253, 0.0101, 3, 0.74, 0.0, 190, 3, 2, 0, 0, 210, 10, 1], "semantic": {"name": "errs", "arg_names": [], "import_names": [], "rhs_call_name": "process_outputs", "annotation": ""}, "snippet": " self._suite, errs = process_outputs(self._data_sources, self._settings)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99884:Expr_L53_C12", "label": "set_options()", "type": "expression", "loc": [53, 53], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99884:If_L51_C8", "vector": [8, 3, 0.5354, 0.0101, 3, 0.74, 0.5, 961, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_options", "arg_names": [], "import_names": [], "rhs_call_name": "set_options", "annotation": ""}, "snippet": " self._suite.set_options(self._settings)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99884:Assign_L54_C12", "label": "self._xml_result = ResultFromXML()", "type": "assigned_variable", "loc": [54, 54], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99884:If_L51_C8", "vector": [14, 3, 0.5455, 0.0101, 3, 0.74, 1.0, 352, 3, 3, 0, 0, 52, 10, 1], "semantic": {"name": "self._xml_result", "arg_names": [], "import_names": [], "rhs_call_name": "ResultFromXML", "annotation": ""}, "snippet": " self._xml_result = ResultFromXML(self._suite, errs, self._settings)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99884:Return_L55_C8", "label": "return", "type": "return", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L50_C4", "vector": [13, 2, 0.5556, 0.0101, 2, 0.42, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._xml_result"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L57_C4", "label": "write_rebot_results", "type": "function", "loc": [57, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99884:ClassDef_L24_C0", "vector": [2, 1, 0.601, 0.0606, 1, 0.32, 1.0, 908, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "write_rebot_results", "arg_names": ["self", "data_sources"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def write_rebot_results(self, *data_sources):\n self._data_sources = data_sources\n builder = OutputBuilder(self)\n self.write_robot_results(builder.build())\n builder.finalize()\n return self._suite"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99884:Assign_L58_C8", "label": "self._data_sources =", "type": "assigned_variable", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L57_C4", "vector": [14, 2, 0.5859, 0.0101, 2, 0.24, 0.0, 609, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._data_sources", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._data_sources = data_sources"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99884:Assign_L59_C8", "label": "builder = OutputBuilder()", "type": "assigned_variable", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L57_C4", "vector": [14, 2, 0.596, 0.0101, 2, 0.24, 0.25, 656, 3, 1, 0, 0, 781, 10, 1], "semantic": {"name": "builder", "arg_names": [], "import_names": [], "rhs_call_name": "OutputBuilder", "annotation": ""}, "snippet": " builder = OutputBuilder(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99884:Expr_L60_C8", "label": "write_robot_results()", "type": "expression", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L57_C4", "vector": [8, 2, 0.6061, 0.0101, 2, 0.24, 0.5, 671, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write_robot_results", "arg_names": [], "import_names": [], "rhs_call_name": "write_robot_results", "annotation": ""}, "snippet": " self.write_robot_results(builder.build())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99884:Expr_L61_C8", "label": "finalize()", "type": "expression", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L57_C4", "vector": [8, 2, 0.6162, 0.0101, 2, 0.24, 0.75, 716, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "finalize", "arg_names": [], "import_names": [], "rhs_call_name": "finalize", "annotation": ""}, "snippet": " builder.finalize()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99884:Return_L62_C8", "label": "return", "type": "return", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L57_C4", "vector": [13, 2, 0.6263, 0.0101, 2, 0.24, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._suite"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99884:ClassDef_L65_C0", "label": "ResultFromXML", "type": "class", "loc": [65, 98], "level": 0, "parent": null, "vector": [3, 0, 0.8232, 0.3434, 0, 0.66, 1.0, 52, 0, 3, 0, 0, 186, 0, 11], "semantic": {"name": "ResultFromXML", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ResultFromXML(object):\n\n def __init__(self, suite, exec_errors, settings=None):\n self.suite = suite\n self.exec_errors = exec_errors\n if settings:\n params = (settings['SuiteStatLevel'], settings['TagStatInclude'],\n settings['TagStatExclude'], settings['TagStatCombine'],"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L67_C4", "label": "__init__", "type": "function", "loc": [67, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99884:ClassDef_L65_C0", "vector": [2, 1, 0.7273, 0.1111, 1, 0.58, 0.0, 555, 0, 4, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "suite", "exec_errors", "settings"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, suite, exec_errors, settings=None):\n self.suite = suite\n self.exec_errors = exec_errors\n if settings:\n params = (settings['SuiteStatLevel'], settings['TagStatInclude'],\n settings['TagStatExclude'], settings['TagStatCombine'],\n settings['TagDoc'], settings['TagStatLink'])\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99884:Assign_L68_C8", "label": "self.suite =", "type": "assigned_variable", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L67_C4", "vector": [14, 2, 0.6869, 0.0101, 2, 0.6, 0.0, 360, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.suite", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.suite = suite"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99884:Assign_L69_C8", "label": "self.exec_errors =", "type": "assigned_variable", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L67_C4", "vector": [14, 2, 0.697, 0.0101, 2, 0.6, 0.25, 566, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.exec_errors", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.exec_errors = exec_errors"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99884:If_L70_C8", "label": "if", "type": "if", "loc": [70, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L67_C4", "vector": [4, 2, 0.7323, 0.0606, 2, 0.6, 0.5, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if settings:\n params = (settings['SuiteStatLevel'], settings['TagStatInclude'],\n settings['TagStatExclude'], settings['TagStatCombine'],\n settings['TagDoc'], settings['TagStatLink'])\n else:\n params = ()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99884:Assign_L71_C12", "label": "params =", "type": "assigned_variable", "loc": [71, 73], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99884:If_L70_C8", "vector": [14, 3, 0.7273, 0.0303, 3, 0.23, 0.0, 206, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "params", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " params = (settings['SuiteStatLevel'], settings['TagStatInclude'],\n settings['TagStatExclude'], settings['TagStatCombine'],\n settings['TagDoc'], settings['TagStatLink'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99884:Assign_L75_C12", "label": "params =", "type": "assigned_variable", "loc": [75, 75], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99884:If_L70_C8", "vector": [14, 3, 0.7576, 0.0101, 3, 0.23, 1.0, 206, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "params", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " params = ()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99884:Assign_L76_C8", "label": "self.statistics = Statistics()", "type": "assigned_variable", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L67_C4", "vector": [14, 2, 0.7677, 0.0101, 2, 0.6, 0.75, 267, 3, 2, 0, 0, 138, 10, 1], "semantic": {"name": "self.statistics", "arg_names": [], "import_names": [], "rhs_call_name": "Statistics", "annotation": ""}, "snippet": " self.statistics = Statistics(suite, *params)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99884:Assign_L77_C8", "label": "self._generator =", "type": "assigned_variable", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L67_C4", "vector": [14, 2, 0.7778, 0.0101, 2, 0.6, 1.0, 457, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self._generator", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._generator = 'Robot'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L79_C4", "label": "serialize_output", "type": "function", "loc": [79, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99884:ClassDef_L65_C0", "vector": [2, 1, 0.8434, 0.101, 1, 0.58, 0.5, 936, 0, 3, 0, 0, 0, 0, 6], "semantic": {"name": "serialize_output", "arg_names": ["self", "path", "log"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def serialize_output(self, path, log=True):\n if path == 'NONE':\n return\n serializer = OutputWriter(path)\n self.suite.serialize(serializer)\n self.statistics.serialize(serializer)\n self.exec_errors.serialize(serializer)\n serializer.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99884:If_L80_C8", "label": "if", "type": "if", "loc": [80, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L79_C4", "vector": [4, 2, 0.8131, 0.0202, 2, 0.86, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if path == 'NONE':\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99884:Return_L81_C12", "label": "return", "type": "return", "loc": [81, 81], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99884:If_L80_C8", "vector": [13, 3, 0.8182, 0.0101, 3, 0.35, 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_99884:Assign_L82_C8", "label": "serializer = OutputWriter()", "type": "assigned_variable", "loc": [82, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L79_C4", "vector": [14, 2, 0.8283, 0.0101, 2, 0.86, 0.1667, 593, 3, 1, 0, 0, 416, 10, 1], "semantic": {"name": "serializer", "arg_names": [], "import_names": [], "rhs_call_name": "OutputWriter", "annotation": ""}, "snippet": " serializer = OutputWriter(path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99884:Expr_L83_C8", "label": "serialize()", "type": "expression", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L79_C4", "vector": [8, 2, 0.8384, 0.0101, 2, 0.86, 0.3333, 50, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "serialize", "arg_names": [], "import_names": [], "rhs_call_name": "serialize", "annotation": ""}, "snippet": " self.suite.serialize(serializer)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99884:Expr_L84_C8", "label": "serialize()", "type": "expression", "loc": [84, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L79_C4", "vector": [8, 2, 0.8485, 0.0101, 2, 0.86, 0.5, 50, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "serialize", "arg_names": [], "import_names": [], "rhs_call_name": "serialize", "annotation": ""}, "snippet": " self.statistics.serialize(serializer)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99884:Expr_L85_C8", "label": "serialize()", "type": "expression", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L79_C4", "vector": [8, 2, 0.8586, 0.0101, 2, 0.86, 0.6667, 50, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "serialize", "arg_names": [], "import_names": [], "rhs_call_name": "serialize", "annotation": ""}, "snippet": " self.exec_errors.serialize(serializer)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99884:Expr_L86_C8", "label": "close()", "type": "expression", "loc": [86, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L79_C4", "vector": [8, 2, 0.8687, 0.0101, 2, 0.86, 0.8333, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " serializer.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99884:If_L87_C8", "label": "if", "type": "if", "loc": [87, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L79_C4", "vector": [4, 2, 0.8838, 0.0202, 2, 0.86, 1.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if log:\n LOGGER.output_file('Output', path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99884:Expr_L88_C12", "label": "output_file()", "type": "expression", "loc": [88, 88], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99884:If_L87_C8", "vector": [8, 3, 0.8889, 0.0101, 3, 0.86, 0.0, 395, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "output_file", "arg_names": [], "import_names": [], "rhs_call_name": "output_file", "annotation": ""}, "snippet": " LOGGER.output_file('Output', path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L90_C4", "label": "serialize_xunit", "type": "function", "loc": [90, 98], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99884:ClassDef_L65_C0", "vector": [2, 1, 0.9495, 0.0909, 1, 0.58, 1.0, 509, 0, 2, 0, 0, 0, 0, 4], "semantic": {"name": "serialize_xunit", "arg_names": ["self", "path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def serialize_xunit(self, path):\n if path == 'NONE':\n return\n serializer = XUnitWriter(path)\n try:\n self.suite.serialize(serializer)\n finally:\n serializer.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99884:If_L91_C8", "label": "if", "type": "if", "loc": [91, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L90_C4", "vector": [4, 2, 0.9242, 0.0202, 2, 0.38, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if path == 'NONE':\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99884:Return_L92_C12", "label": "return", "type": "return", "loc": [92, 92], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99884:If_L91_C8", "vector": [13, 3, 0.9293, 0.0101, 3, 0.74, 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_99884:Assign_L93_C8", "label": "serializer = XUnitWriter()", "type": "assigned_variable", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L90_C4", "vector": [14, 2, 0.9394, 0.0101, 2, 0.38, 0.3333, 593, 3, 1, 0, 0, 553, 10, 1], "semantic": {"name": "serializer", "arg_names": [], "import_names": [], "rhs_call_name": "XUnitWriter", "annotation": ""}, "snippet": " serializer = XUnitWriter(path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99884:Try_L94_C8", "label": "try", "type": "try", "loc": [94, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L90_C4", "vector": [7, 2, 0.9646, 0.0404, 2, 0.38, 0.6667, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n self.suite.serialize(serializer)\n finally:\n serializer.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99884:Expr_L95_C12", "label": "serialize()", "type": "expression", "loc": [95, 95], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99884:Try_L94_C8", "vector": [8, 3, 0.9596, 0.0101, 3, 0.78, 0.0, 50, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "serialize", "arg_names": [], "import_names": [], "rhs_call_name": "serialize", "annotation": ""}, "snippet": " self.suite.serialize(serializer)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99884:Expr_L97_C12", "label": "close()", "type": "expression", "loc": [97, 97], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99884:Try_L94_C8", "vector": [8, 3, 0.9798, 0.0101, 3, 0.78, 1.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " serializer.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99884:Expr_L98_C8", "label": "output_file()", "type": "expression", "loc": [98, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L90_C4", "vector": [8, 2, 0.9899, 0.0101, 2, 0.38, 1.0, 395, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "output_file", "arg_names": [], "import_names": [], "rhs_call_name": "output_file", "annotation": ""}, "snippet": " LOGGER.output_file('XUnit', path)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99884:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99884:Assign_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99884:Assign_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99884:Assign_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99884:Assign_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99884:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99884:Assign_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99884:Assign_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99884:Expr_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99884:Expr_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99884:Expr_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99884:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99884:If_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99884:If_L41_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99884:Assign_L42_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99884:Return_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99884:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99884:Return_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99884:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99884:If_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99884:If_L51_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99884:Assign_L52_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99884:If_L51_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99884:Expr_L53_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99884:If_L51_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99884:Assign_L54_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99884:Return_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99884:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99884:Assign_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99884:Assign_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99884:Expr_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99884:Expr_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99884:Return_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99884:ClassDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L67_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99884:Assign_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L67_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99884:Assign_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L67_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99884:If_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99884:If_L70_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99884:Assign_L71_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99884:If_L70_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99884:Assign_L75_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L67_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99884:Assign_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L67_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99884:Assign_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99884:ClassDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L79_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L79_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99884:If_L80_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99884:If_L80_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99884:Return_L81_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L79_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99884:Assign_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L79_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99884:Expr_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L79_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99884:Expr_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L79_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99884:Expr_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L79_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99884:Expr_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L79_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99884:If_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99884:If_L87_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99884:Expr_L88_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99884:ClassDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99884:If_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99884:If_L91_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99884:Return_L92_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99884:Assign_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99884:Try_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99884:Try_L94_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99884:Expr_L95_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99884:Try_L94_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99884:Expr_L97_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99884:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99884:Expr_L98_C8"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import zlib
import base64
from operator import itemgetter
from robot import utils
class _Handler(object):
def __init__(self, context, attrs=None):
self._context = context
self._data_from_children = []
self._handlers = {
'robot' : _RobotHandler,
'suite' : _SuiteHandler,
'test' : _TestHandler,
'statistics' : _StatisticsHandler,
'stat' : _StatItemHandler,
'errors' : _Handler,
'doc' : _HtmlTextHandler,
'kw' : _KeywordHandler,
'arg' : _ArgumentHandler,
'arguments' : _ArgumentsHandler,
'tag' : _TextHandler,
'tags' : _Handler,
'msg' : _MsgHandler,
'status' : _StatusHandler,
'metadata' : _MetadataHandler,
'item' : _MetadataItemHandler,
}
def get_handler_for(self, name, attrs):
return self._handlers[name](self._context, attrs)
def add_child_data(self, data):
self._data_from_children.append(data)
def end_element(self, text):
return self._data_from_children
def _get_id(self, item):
return self._context.get_id(item)
def _get_ids(self, items):
return [self._context.get_id(i) for i in items]
class RootHandler(_Handler):
# TODO: Combine _RootHandler and _RobotHandler
@property
def data(self):
return self._data_from_children[0]
class _RobotHandler(_Handler):
def __init__(self, context, attrs):
_Handler.__init__(self, context)
self._generator = attrs.get('generator')
def end_element(self, text):
return {'generator': self._generator,
'suite': self._data_from_children[0],
'stats': self._data_from_children[1],
'errors': self._data_from_children[2],
'baseMillis': self._context.basemillis,
'strings': self._context.dump_texts()}
class _SuiteHandler(_Handler):
def __init__(self, context, attrs):
_Handler.__init__(self, context)
self._name = attrs.get('name')
self._source = attrs.get('source') or ''
self._suites = []
self._tests = []
self._keywords = []
self._current_children = None
self._context.start_suite(self._name)
self._context.collect_stats()
def get_handler_for(self, name, attrs):
self._current_children = {
'suite': self._suites,
'test': self._tests,
'kw': self._keywords
}.get(name, self._data_from_children)
return _Handler.get_handler_for(self, name, attrs)
def add_child_data(self, data):
self._current_children.append(data)
def end_element(self, text):
result = self._get_ids([self._source, self._name]) + \
self._data_from_children + [self._suites] + \
[self._tests] + [self._keywords] + \
[self._get_ids(self._context.dump_stats())]
self._context.end_suite()
return result
class _TestHandler(_Handler):
def __init__(self, context, attrs):
_Handler.__init__(self, context)
self._name = attrs.get('name')
self._timeout = attrs.get('timeout')
self._keywords = []
self._current_children = None
self._context.start_test(self._name)
def get_handler_for(self, name, attrs):
if name == 'status':
# TODO: Use 1/0 instead of Y/N. Possibly also 1/0/-1 instead of P/F/N.
self._critical = 'Y' if attrs.get('critical') == 'yes' else 'N'
self._current_children = {
'kw': self._keywords
}.get(name, self._data_from_children)
return _Handler.get_handler_for(self, name, attrs)
def add_child_data(self, data):
self._current_children.append(data)
def end_element(self, text):
# TODO: refactor
self._context.add_test(self._critical == 'Y', self._data_from_children[-1][0] == self._get_id('P'))
kws = self._context.end_test(self._keywords)
result = self._get_ids([self._name, self._timeout, self._critical]) + self._data_from_children
result.append(kws)
return result
class _KeywordHandler(_Handler):
def __init__(self, context, attrs):
_Handler.__init__(self, context)
self._context.start_keyword()
self._type = attrs.get('type')
if self._type == 'for': self._type = 'forloop'
self._name = attrs.get('name')
self._timeout = attrs.get('timeout')
self._keywords = []
self._messages = []
self._current_children = None
def get_handler_for(self, name, attrs):
if name == 'status':
# TODO: Use 1/0 instead of Y/N. Possibly also 1/0/-1 instead of P/F/N.
self._critical = 'Y' if attrs.get('critical') == 'yes' else 'N'
self._current_children = {
'kw': self._keywords,
'msg': self._messages
}.get(name, self._data_from_children)
return _Handler.get_handler_for(self, name, attrs)
def add_child_data(self, data):
self._current_children.append(data)
def end_element(self, text):
if self._type == 'teardown' and self._data_from_children[-1][0] == self._get_id('F'):
self._context.teardown_failed()
result = self._get_ids([self._type, self._name, self._timeout]) + \
self._data_from_children + [self._keywords] + [self._messages]
self._context.end_keyword()
return result
# TODO: StatisticsHandler and StatItemHandler should be separated somehow from suite handlers
class _StatisticsHandler(_Handler):
def get_handler_for(self, name, attrs):
return _Handler(self._context, attrs)
class _StatItemHandler(_Handler):
def __init__(self, context, attrs):
_Handler.__init__(self, context)
self._attrs = dict(attrs)
self._attrs['pass'] = int(self._attrs['pass'])
self._attrs['fail'] = int(self._attrs['fail'])
if 'doc' in self._attrs:
self._attrs['doc'] = utils.html_format(self._attrs['doc'])
# TODO: Should we only dump attrs that have value?
# Tag stats have many attrs that are normally empty
def end_element(self, text):
self._attrs.update(label=text)
return self._attrs
class _StatusHandler(_Handler):
def __init__(self, context, attrs):
self._context = context
self._status = attrs.get('status')[0]
self._starttime = self._context.timestamp(attrs.get('starttime'))
self._elapsed = self._calculate_elapsed(attrs)
def _calculate_elapsed(self, attrs):
endtime = self._context.timestamp(attrs.get('endtime'))
# Must compare against None because either start and end may be 0.
if self._starttime is not None or endtime is not None:
return endtime - self._starttime
# Only RF 2.6+ outputs have elapsedtime when start or end is N/A.
return int(attrs.get('elapsedtime', 0))
def end_element(self, text):
result = [self._status, self._starttime, self._elapsed]
if text:
result.append(text)
return self._get_ids(result)
class _ArgumentHandler(_Handler):
def end_element(self, text):
return text
class _ArgumentsHandler(_Handler):
def end_element(self, text):
return self._get_id(', '.join(self._data_from_children))
class _TextHandler(_Handler):
def end_element(self, text):
return self._get_id(text)
class _HtmlTextHandler(_Handler):
def end_element(self, text):
return self._get_id(utils.html_format(text))
class _MetadataHandler(_Handler):
def __init__(self, context, attrs):
_Handler.__init__(self, context)
self._metadata = []
def add_child_data(self, data):
self._metadata.extend(data)
def end_element(self, text):
return self._metadata
class _MetadataItemHandler(_Handler):
def __init__(self, context, attrs):
_Handler.__init__(self, context)
self._name = attrs.get('name')
def end_element(self, text):
return self._get_ids([self._name, utils.html_format(text)])
class _MsgHandler(_Handler):
def __init__(self, context, attrs):
_Handler.__init__(self, context)
self._msg = [self._context.timestamp(attrs.get('timestamp')),
attrs.get('level')[0]]
self._is_html = attrs.get('html')
self._is_linkable = attrs.get("linkable") == "yes"
def end_element(self, text):
self._msg.append(text if self._is_html else utils.html_escape(text))
self._handle_warning_linking()
return self._get_ids(self._msg)
def _handle_warning_linking(self):
# TODO: should perhaps use the id version of this list for indexing?
if self._is_linkable:
self._msg.append(self._context.link_to(self._msg))
elif self._msg[1] == 'W':
self._context.create_link_to_current_location(self._msg)
class Context(object):
def __init__(self, split_tests=False):
self._main_text_cache = TextCache()
self._current_texts = self._main_text_cache
self._split_text_caches = []
self._basemillis = 0
self._stats = Stats()
self._current_place = []
self._kw_index = []
self._links = {}
self._split_tests = split_tests
self._split_results = []
@property
def basemillis(self):
return self._basemillis
@property
def split_results(self):
return self._split_results
def collect_stats(self):
self._stats = self._stats.new_child()
return self
def dump_stats(self):
try:
return self._stats.dump()
finally:
self._stats = self._stats.parent
def get_id(self, value):
if value is None:
return None
if isinstance(value, basestring):
return self._get_text_id(value)
if isinstance(value, (int, long)):
return value
raise TypeError('Unsupported type %s' % type(value))
def _get_text_id(self, text):
return self._current_texts.add(text)
def dump_texts(self):
return self._current_texts.dump()
def timestamp(self, time):
if time == 'N/A':
return None
millis = int(utils.timestamp_to_secs(time, millis=True) * 1000)
if not self._basemillis:
self._basemillis = millis
return millis - self.basemillis
def start_suite(self, name):
self._current_place.append(('suite', name))
self._kw_index.append(0)
def end_suite(self):
self._current_place.pop()
self._kw_index.pop()
def start_test(self, name):
if self._split_tests:
self._split_text_caches.append(TextCache())
self._current_place.append(('test', name))
self._kw_index.append(0)
def end_test(self, kw_data=None):
self._current_place.pop()
self._kw_index.pop()
if self._split_tests:
self._split_results.append((kw_data, self._split_text_caches[-1].dump()))
return len(self._split_results)
return kw_data
def start_keyword(self):
if self._split_tests and self._current_place[-1][0] == 'test':
self._current_texts = self._split_text_caches[-1]
self._current_place.append(('keyword', self._kw_index[-1]))
self._kw_index[-1] += 1
self._kw_index.append(0)
def end_keyword(self):
self._current_place.pop()
self._kw_index.pop()
if self._split_tests and self._current_place[-1][0] == 'test':
self._current_texts = self._main_text_cache
def create_link_to_current_location(self, key):
self._links[tuple(key)] = self._create_link()
def _create_link(self):
return "keyword_"+".".join(str(v) for _, v in self._current_place)
def link_to(self, key):
return self._links[tuple(key)]
def add_test(self, critical, passed):
self._stats.add_test(critical, passed)
def teardown_failed(self):
self._stats.fail_all()
class Stats(object):
TOTAL = 0
TOTAL_PASSED = 1
CRITICAL = 2
CRITICAL_PASSED = 3
def __init__(self, parent=None):
self.parent = parent
self._stats = [0,0,0,0]
self._children = []
def new_child(self):
self._children.append(Stats(self))
return self._children[-1]
def add_test(self, critical, passed):
self._stats[Stats.TOTAL] += 1
if passed:
self._stats[Stats.TOTAL_PASSED] +=1
if critical:
self._stats[Stats.CRITICAL] += 1
if passed:
self._stats[Stats.CRITICAL_PASSED] += 1
def dump(self):
if self.parent:
for i in range(4):
self.parent._stats[i] += self._stats[i]
return self._stats
def fail_all(self):
self._stats[1] = 0
self._stats[3] = 0
for child in self._children:
child.fail_all()
class TextIndex(int):
pass
ZERO_TEXT_INDEX = TextIndex(0)
class TextCache(object):
# TODO: Tune compressing thresholds
_compress_threshold = 20
_use_compressed_threshold = 1.1
def __init__(self):
self.texts = {'*': ZERO_TEXT_INDEX}
self.index = 1
def add(self, text):
if not text:
return 0
text = self._encode(text)
if text not in self.texts:
self.texts[text] = TextIndex(self.index)
self.index += 1
return self.texts[text]
def _encode(self, text):
raw = self._raw(text)
if raw in self.texts or len(raw) < self._compress_threshold:
return raw
compressed = self._compress(text)
if len(compressed) * self._use_compressed_threshold < len(raw):
return compressed
return raw
def _compress(self, text):
return base64.b64encode(zlib.compress(text.encode('UTF-8'), 9))
def _raw(self, text):
return '*'+text
def dump(self):
# TODO: Could we yield or return an iterator?
# TODO: Duplicate with IntegerCache.dump
return [item[0] for item in sorted(self.texts.iteritems(),
key=itemgetter(1))]
| ajibawa-2023/Python-Code-Large/train/row_99885 | 298 | 486 | 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_99885:Import_L15_C0", "label": "zlib import zlib", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.0309, 0.0021, 0, 0.66, 0.0, 373, 0, 1, 0, 0, 373, 0, 0], "semantic": {"name": "zlib", "arg_names": [], "import_names": ["zlib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import zlib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Import_L16_C0", "label": "base64 import base64", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.0329, 0.0021, 0, 0.66, 0.0417, 177, 0, 1, 0, 0, 177, 0, 0], "semantic": {"name": "base64", "arg_names": [], "import_names": ["base64"], "rhs_call_name": "", "annotation": ""}, "snippet": "import base64"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:ImportFrom_L17_C0", "label": "from operator import itemgetter", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.035, 0.0021, 0, 0.66, 0.0833, 616, 0, 1, 0, 0, 616, 0, 0], "semantic": {"name": "operator", "arg_names": [], "import_names": ["itemgetter"], "rhs_call_name": "", "annotation": ""}, "snippet": "from operator import itemgetter"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:ImportFrom_L19_C0", "label": "from robot import utils", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.0391, 0.0021, 0, 0.66, 0.125, 735, 0, 1, 0, 0, 735, 0, 0], "semantic": {"name": "robot", "arg_names": [], "import_names": ["utils"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot import utils"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L22_C0", "label": "_Handler", "type": "class", "loc": [22, 59], "level": 0, "parent": null, "vector": [3, 0, 0.0833, 0.0782, 0, 0.66, 0.1667, 557, 0, 6, 0, 0, 186, 0, 4], "semantic": {"name": "_Handler", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _Handler(object):\n\n def __init__(self, context, attrs=None):\n self._context = context\n self._data_from_children = []\n self._handlers = {\n 'robot' : _RobotHandler,\n 'suite' : _SuiteHandler,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L24_C4", "label": "__init__", "type": "function", "loc": [24, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L22_C0", "vector": [2, 1, 0.07, 0.0432, 1, 0.83, 0.0, 555, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "context", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, context, attrs=None):\n self._context = context\n self._data_from_children = []\n self._handlers = {\n 'robot' : _RobotHandler,\n 'suite' : _SuiteHandler,\n 'test' : _TestHandler,\n 'statistics' : _StatisticsHandler,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L25_C8", "label": "self._context =", "type": "assigned_variable", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L24_C4", "vector": [14, 2, 0.0514, 0.0021, 2, 0.68, 0.0, 962, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._context", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._context = context"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L26_C8", "label": "self._data_from_children =", "type": "assigned_variable", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L24_C4", "vector": [14, 2, 0.0535, 0.0021, 2, 0.68, 0.5, 94, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self._data_from_children", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._data_from_children = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L27_C8", "label": "self._handlers =", "type": "assigned_variable", "loc": [27, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L24_C4", "vector": [14, 2, 0.073, 0.037, 2, 0.68, 1.0, 893, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self._handlers", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._handlers = {\n 'robot' : _RobotHandler,\n 'suite' : _SuiteHandler,\n 'test' : _TestHandler,\n 'statistics' : _StatisticsHandler,\n 'stat' : _StatItemHandler,\n 'errors' : _Handler,\n 'doc' : _HtmlTextHandler,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L46_C4", "label": "get_handler_for", "type": "function", "loc": [46, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L22_C0", "vector": [2, 1, 0.0957, 0.0041, 1, 0.83, 0.2, 198, 0, 3, 1, 0, 0, 0, 1], "semantic": {"name": "get_handler_for", "arg_names": ["self", "name", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_handler_for(self, name, attrs):\n return self._handlers[name](self._context, attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L47_C8", "label": "return", "type": "return", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L46_C4", "vector": [13, 2, 0.0967, 0.0021, 2, 0.01, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._handlers[name](self._context, attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L49_C4", "label": "add_child_data", "type": "function", "loc": [49, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L22_C0", "vector": [2, 1, 0.1019, 0.0041, 1, 0.83, 0.4, 224, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "add_child_data", "arg_names": ["self", "data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add_child_data(self, data):\n self._data_from_children.append(data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L50_C8", "label": "append()", "type": "expression", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L49_C4", "vector": [8, 2, 0.1029, 0.0021, 2, 0.64, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self._data_from_children.append(data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L52_C4", "label": "end_element", "type": "function", "loc": [52, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L22_C0", "vector": [2, 1, 0.108, 0.0041, 1, 0.83, 0.6, 513, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "end_element", "arg_names": ["self", "text"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end_element(self, text):\n return self._data_from_children"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L53_C8", "label": "return", "type": "return", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L52_C4", "vector": [13, 2, 0.1091, 0.0021, 2, 0.62, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._data_from_children"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L55_C4", "label": "_get_id", "type": "function", "loc": [55, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L22_C0", "vector": [2, 1, 0.1142, 0.0041, 1, 0.83, 0.8, 83, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "_get_id", "arg_names": ["self", "item"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_id(self, item):\n return self._context.get_id(item)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L56_C8", "label": "return", "type": "return", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L55_C4", "vector": [13, 2, 0.1152, 0.0021, 2, 0.61, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._context.get_id(item)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L58_C4", "label": "_get_ids", "type": "function", "loc": [58, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L22_C0", "vector": [2, 1, 0.1204, 0.0041, 1, 0.83, 1.0, 412, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "_get_ids", "arg_names": ["self", "items"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_ids(self, items):\n return [self._context.get_id(i) for i in items]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L59_C8", "label": "return", "type": "return", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L58_C4", "vector": [13, 2, 0.1214, 0.0021, 2, 0.06, 0.0, 0, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [self._context.get_id(i) for i in items]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L62_C0", "label": "RootHandler", "type": "class", "loc": [62, 67], "level": 0, "parent": null, "vector": [3, 0, 0.1327, 0.0123, 0, 0.66, 0.2083, 892, 0, 1, 0, 0, 557, 0, 0], "semantic": {"name": "RootHandler", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class RootHandler(_Handler):\n # TODO: Combine _RootHandler and _RobotHandler\n\n @property\n def data(self):\n return self._data_from_children[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L66_C4", "label": "data", "type": "function", "loc": [66, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L62_C0", "vector": [2, 1, 0.1368, 0.0041, 1, 0.37, 0.0, 929, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "data", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def data(self):\n return self._data_from_children[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L67_C8", "label": "return", "type": "return", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L66_C4", "vector": [13, 2, 0.1379, 0.0021, 2, 0.27, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._data_from_children[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L70_C0", "label": "_RobotHandler", "type": "class", "loc": [70, 82], "level": 0, "parent": null, "vector": [3, 0, 0.1564, 0.0267, 0, 0.66, 0.25, 827, 0, 2, 0, 0, 557, 0, 3], "semantic": {"name": "_RobotHandler", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _RobotHandler(_Handler):\n\n def __init__(self, context, attrs):\n _Handler.__init__(self, context)\n self._generator = attrs.get('generator')\n\n def end_element(self, text):\n return {'generator': self._generator,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L72_C4", "label": "__init__", "type": "function", "loc": [72, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L70_C0", "vector": [2, 1, 0.1502, 0.0062, 1, 0.16, 0.0, 555, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "context", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, context, attrs):\n _Handler.__init__(self, context)\n self._generator = attrs.get('generator')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L73_C8", "label": "__init__()", "type": "expression", "loc": [73, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L72_C4", "vector": [8, 2, 0.1502, 0.0021, 2, 0.93, 0.0, 555, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " _Handler.__init__(self, context)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L74_C8", "label": "self._generator = get()", "type": "assigned_variable", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L72_C4", "vector": [14, 2, 0.1523, 0.0021, 2, 0.93, 1.0, 457, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "self._generator", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " self._generator = attrs.get('generator')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L76_C4", "label": "end_element", "type": "function", "loc": [76, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L70_C0", "vector": [2, 1, 0.1626, 0.0144, 1, 0.16, 1.0, 513, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "end_element", "arg_names": ["self", "text"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end_element(self, text):\n return {'generator': self._generator,\n 'suite': self._data_from_children[0],\n 'stats': self._data_from_children[1],\n 'errors': self._data_from_children[2],\n 'baseMillis': self._context.basemillis,\n 'strings': self._context.dump_texts()}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L77_C8", "label": "return", "type": "return", "loc": [77, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L76_C4", "vector": [13, 2, 0.1636, 0.0123, 2, 0.55, 0.0, 0, 0, 0, 0, 0, 0, 6, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return {'generator': self._generator,\n 'suite': self._data_from_children[0],\n 'stats': self._data_from_children[1],\n 'errors': self._data_from_children[2],\n 'baseMillis': self._context.basemillis,\n 'strings': self._context.dump_texts()}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L85_C0", "label": "_SuiteHandler", "type": "class", "loc": [85, 115], "level": 0, "parent": null, "vector": [3, 0, 0.2058, 0.0638, 0, 0.66, 0.2917, 536, 0, 4, 0, 0, 557, 0, 12], "semantic": {"name": "_SuiteHandler", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _SuiteHandler(_Handler):\n\n def __init__(self, context, attrs):\n _Handler.__init__(self, context)\n self._name = attrs.get('name')\n self._source = attrs.get('source') or ''\n self._suites = []\n self._tests = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L87_C4", "label": "__init__", "type": "function", "loc": [87, 96], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L85_C0", "vector": [2, 1, 0.1883, 0.0206, 1, 0.76, 0.0, 555, 0, 3, 0, 0, 0, 0, 5], "semantic": {"name": "__init__", "arg_names": ["self", "context", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, context, attrs):\n _Handler.__init__(self, context)\n self._name = attrs.get('name')\n self._source = attrs.get('source') or ''\n self._suites = []\n self._tests = []\n self._keywords = []\n self._current_children = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L88_C8", "label": "__init__()", "type": "expression", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L87_C4", "vector": [8, 2, 0.1811, 0.0021, 2, 0.3, 0.0, 555, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " _Handler.__init__(self, context)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L89_C8", "label": "self._name = get()", "type": "assigned_variable", "loc": [89, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L87_C4", "vector": [14, 2, 0.1831, 0.0021, 2, 0.3, 0.125, 257, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "self._name", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " self._name = attrs.get('name')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L90_C8", "label": "self._source =", "type": "assigned_variable", "loc": [90, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L87_C4", "vector": [14, 2, 0.1852, 0.0021, 2, 0.3, 0.25, 361, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self._source", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._source = attrs.get('source') or ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L91_C8", "label": "self._suites =", "type": "assigned_variable", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L87_C4", "vector": [14, 2, 0.1872, 0.0021, 2, 0.3, 0.375, 303, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self._suites", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._suites = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L92_C8", "label": "self._tests =", "type": "assigned_variable", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L87_C4", "vector": [14, 2, 0.1893, 0.0021, 2, 0.3, 0.5, 482, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self._tests", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._tests = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L93_C8", "label": "self._keywords =", "type": "assigned_variable", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L87_C4", "vector": [14, 2, 0.1914, 0.0021, 2, 0.3, 0.625, 404, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self._keywords", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._keywords = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L94_C8", "label": "self._current_children =", "type": "assigned_variable", "loc": [94, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L87_C4", "vector": [14, 2, 0.1934, 0.0021, 2, 0.3, 0.75, 619, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self._current_children", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._current_children = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L95_C8", "label": "start_suite()", "type": "expression", "loc": [95, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L87_C4", "vector": [8, 2, 0.1955, 0.0021, 2, 0.3, 0.875, 38, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "start_suite", "arg_names": [], "import_names": [], "rhs_call_name": "start_suite", "annotation": ""}, "snippet": " self._context.start_suite(self._name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L96_C8", "label": "collect_stats()", "type": "expression", "loc": [96, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L87_C4", "vector": [8, 2, 0.1975, 0.0021, 2, 0.3, 1.0, 727, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "collect_stats", "arg_names": [], "import_names": [], "rhs_call_name": "collect_stats", "annotation": ""}, "snippet": " self._context.collect_stats()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L98_C4", "label": "get_handler_for", "type": "function", "loc": [98, 104], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L85_C0", "vector": [2, 1, 0.2078, 0.0144, 1, 0.76, 0.3333, 198, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "get_handler_for", "arg_names": ["self", "name", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_handler_for(self, name, attrs):\n self._current_children = {\n 'suite': self._suites,\n 'test': self._tests,\n 'kw': self._keywords\n }.get(name, self._data_from_children)\n return _Handler.get_handler_for(self, name, attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L99_C8", "label": "self._current_children = get()", "type": "assigned_variable", "loc": [99, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L98_C4", "vector": [14, 2, 0.2078, 0.0103, 2, 0.74, 0.0, 619, 3, 2, 0, 0, 607, 10, 1], "semantic": {"name": "self._current_children", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " self._current_children = {\n 'suite': self._suites,\n 'test': self._tests,\n 'kw': self._keywords\n }.get(name, self._data_from_children)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L104_C8", "label": "return", "type": "return", "loc": [104, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L98_C4", "vector": [13, 2, 0.214, 0.0021, 2, 0.74, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return _Handler.get_handler_for(self, name, attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L106_C4", "label": "add_child_data", "type": "function", "loc": [106, 107], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L85_C0", "vector": [2, 1, 0.2191, 0.0041, 1, 0.76, 0.6667, 224, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "add_child_data", "arg_names": ["self", "data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add_child_data(self, data):\n self._current_children.append(data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L107_C8", "label": "append()", "type": "expression", "loc": [107, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L106_C4", "vector": [8, 2, 0.2202, 0.0021, 2, 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": " self._current_children.append(data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L109_C4", "label": "end_element", "type": "function", "loc": [109, 115], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L85_C0", "vector": [2, 1, 0.2305, 0.0144, 1, 0.76, 1.0, 513, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "end_element", "arg_names": ["self", "text"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end_element(self, text):\n result = self._get_ids([self._source, self._name]) + \\\n self._data_from_children + [self._suites] + \\\n [self._tests] + [self._keywords] + \\\n [self._get_ids(self._context.dump_stats())]\n self._context.end_suite()\n return result"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L110_C8", "label": "result =", "type": "assigned_variable", "loc": [110, 113], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L109_C4", "vector": [14, 2, 0.2294, 0.0082, 2, 0.4, 0.0, 51, 4, 0, 0, 0, 0, 0, 3], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " result = self._get_ids([self._source, self._name]) + \\\n self._data_from_children + [self._suites] + \\\n [self._tests] + [self._keywords] + \\\n [self._get_ids(self._context.dump_stats())]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L114_C8", "label": "end_suite()", "type": "expression", "loc": [114, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L109_C4", "vector": [8, 2, 0.2346, 0.0021, 2, 0.4, 0.5, 81, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "end_suite", "arg_names": [], "import_names": [], "rhs_call_name": "end_suite", "annotation": ""}, "snippet": " self._context.end_suite()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L115_C8", "label": "return", "type": "return", "loc": [115, 115], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L109_C4", "vector": [13, 2, 0.2366, 0.0021, 2, 0.4, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return result"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L118_C0", "label": "_TestHandler", "type": "class", "loc": [118, 146], "level": 0, "parent": null, "vector": [3, 0, 0.2716, 0.0597, 0, 0.66, 0.3333, 506, 0, 4, 0, 0, 557, 0, 13], "semantic": {"name": "_TestHandler", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _TestHandler(_Handler):\n\n def __init__(self, context, attrs):\n _Handler.__init__(self, context)\n self._name = attrs.get('name')\n self._timeout = attrs.get('timeout')\n self._keywords = []\n self._current_children = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L120_C4", "label": "__init__", "type": "function", "loc": [120, 126], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L118_C0", "vector": [2, 1, 0.2531, 0.0144, 1, 0.16, 0.0, 555, 0, 3, 0, 0, 0, 0, 4], "semantic": {"name": "__init__", "arg_names": ["self", "context", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, context, attrs):\n _Handler.__init__(self, context)\n self._name = attrs.get('name')\n self._timeout = attrs.get('timeout')\n self._keywords = []\n self._current_children = None\n self._context.start_test(self._name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L121_C8", "label": "__init__()", "type": "expression", "loc": [121, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L120_C4", "vector": [8, 2, 0.249, 0.0021, 2, 0.42, 0.0, 555, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " _Handler.__init__(self, context)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L122_C8", "label": "self._name = get()", "type": "assigned_variable", "loc": [122, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L120_C4", "vector": [14, 2, 0.251, 0.0021, 2, 0.42, 0.2, 257, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "self._name", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " self._name = attrs.get('name')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L123_C8", "label": "self._timeout = get()", "type": "assigned_variable", "loc": [123, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L120_C4", "vector": [14, 2, 0.2531, 0.0021, 2, 0.42, 0.4, 347, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "self._timeout", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " self._timeout = attrs.get('timeout')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L124_C8", "label": "self._keywords =", "type": "assigned_variable", "loc": [124, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L120_C4", "vector": [14, 2, 0.2551, 0.0021, 2, 0.42, 0.6, 404, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self._keywords", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._keywords = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L125_C8", "label": "self._current_children =", "type": "assigned_variable", "loc": [125, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L120_C4", "vector": [14, 2, 0.2572, 0.0021, 2, 0.42, 0.8, 619, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self._current_children", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._current_children = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L126_C8", "label": "start_test()", "type": "expression", "loc": [126, 126], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L120_C4", "vector": [8, 2, 0.2593, 0.0021, 2, 0.42, 1.0, 246, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "start_test", "arg_names": [], "import_names": [], "rhs_call_name": "start_test", "annotation": ""}, "snippet": " self._context.start_test(self._name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L128_C4", "label": "get_handler_for", "type": "function", "loc": [128, 135], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L118_C0", "vector": [2, 1, 0.2706, 0.0165, 1, 0.16, 0.3333, 198, 0, 3, 1, 0, 0, 0, 3], "semantic": {"name": "get_handler_for", "arg_names": ["self", "name", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_handler_for(self, name, attrs):\n if name == 'status':\n # TODO: Use 1/0 instead of Y/N. Possibly also 1/0/-1 instead of P/F/N.\n self._critical = 'Y' if attrs.get('critical') == 'yes' else 'N'\n self._current_children = {\n 'kw': self._keywords\n }.get(name, self._data_from_children)\n return _Handler.get_handler_for(self, name, attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L129_C8", "label": "if", "type": "if", "loc": [129, 131], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L128_C4", "vector": [4, 2, 0.2675, 0.0062, 2, 0.86, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if name == 'status':\n # TODO: Use 1/0 instead of Y/N. Possibly also 1/0/-1 instead of P/F/N.\n self._critical = 'Y' if attrs.get('critical') == 'yes' else 'N'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L131_C12", "label": "self._critical =", "type": "assigned_variable", "loc": [131, 131], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L129_C8", "vector": [14, 3, 0.2695, 0.0021, 3, 0.93, 0.0, 993, 8, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self._critical", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._critical = 'Y' if attrs.get('critical') == 'yes' else 'N'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L132_C8", "label": "self._current_children = get()", "type": "assigned_variable", "loc": [132, 134], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L128_C4", "vector": [14, 2, 0.2737, 0.0062, 2, 0.86, 0.5, 619, 3, 2, 0, 0, 607, 10, 1], "semantic": {"name": "self._current_children", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " self._current_children = {\n 'kw': self._keywords\n }.get(name, self._data_from_children)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L135_C8", "label": "return", "type": "return", "loc": [135, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L128_C4", "vector": [13, 2, 0.2778, 0.0021, 2, 0.86, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return _Handler.get_handler_for(self, name, attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L137_C4", "label": "add_child_data", "type": "function", "loc": [137, 138], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L118_C0", "vector": [2, 1, 0.2829, 0.0041, 1, 0.16, 0.6667, 224, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "add_child_data", "arg_names": ["self", "data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add_child_data(self, data):\n self._current_children.append(data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L138_C8", "label": "append()", "type": "expression", "loc": [138, 138], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L137_C4", "vector": [8, 2, 0.284, 0.0021, 2, 0.08, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self._current_children.append(data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L140_C4", "label": "end_element", "type": "function", "loc": [140, 146], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L118_C0", "vector": [2, 1, 0.2942, 0.0144, 1, 0.16, 1.0, 513, 0, 2, 1, 0, 0, 0, 5], "semantic": {"name": "end_element", "arg_names": ["self", "text"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end_element(self, text):\n # TODO: refactor\n self._context.add_test(self._critical == 'Y', self._data_from_children[-1][0] == self._get_id('P'))\n kws = self._context.end_test(self._keywords)\n result = self._get_ids([self._name, self._timeout, self._critical]) + self._data_from_children\n result.append(kws)\n return result"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L142_C8", "label": "add_test()", "type": "expression", "loc": [142, 142], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L140_C4", "vector": [8, 2, 0.2922, 0.0021, 2, 0.78, 0.0, 653, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "add_test", "arg_names": [], "import_names": [], "rhs_call_name": "add_test", "annotation": ""}, "snippet": " self._context.add_test(self._critical == 'Y', self._data_from_children[-1][0] == self._get_id('P'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L143_C8", "label": "kws = end_test()", "type": "assigned_variable", "loc": [143, 143], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L140_C4", "vector": [14, 2, 0.2942, 0.0021, 2, 0.78, 0.25, 47, 3, 1, 0, 0, 220, 10, 1], "semantic": {"name": "kws", "arg_names": [], "import_names": [], "rhs_call_name": "end_test", "annotation": ""}, "snippet": " kws = self._context.end_test(self._keywords)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L144_C8", "label": "result =", "type": "assigned_variable", "loc": [144, 144], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L140_C4", "vector": [14, 2, 0.2963, 0.0021, 2, 0.78, 0.5, 51, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " result = self._get_ids([self._name, self._timeout, self._critical]) + self._data_from_children"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L145_C8", "label": "append()", "type": "expression", "loc": [145, 145], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L140_C4", "vector": [8, 2, 0.2984, 0.0021, 2, 0.78, 0.75, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " result.append(kws)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L146_C8", "label": "return", "type": "return", "loc": [146, 146], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L140_C4", "vector": [13, 2, 0.3004, 0.0021, 2, 0.78, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return result"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L149_C0", "label": "_KeywordHandler", "type": "class", "loc": [149, 181], "level": 0, "parent": null, "vector": [3, 0, 0.3395, 0.0679, 0, 0.66, 0.375, 337, 0, 4, 0, 0, 557, 0, 13], "semantic": {"name": "_KeywordHandler", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _KeywordHandler(_Handler):\n\n def __init__(self, context, attrs):\n _Handler.__init__(self, context)\n self._context.start_keyword()\n self._type = attrs.get('type')\n if self._type == 'for': self._type = 'forloop'\n self._name = attrs.get('name')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L151_C4", "label": "__init__", "type": "function", "loc": [151, 160], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L149_C0", "vector": [2, 1, 0.32, 0.0206, 1, 0.99, 0.0, 555, 0, 3, 0, 0, 0, 0, 5], "semantic": {"name": "__init__", "arg_names": ["self", "context", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, context, attrs):\n _Handler.__init__(self, context)\n self._context.start_keyword()\n self._type = attrs.get('type')\n if self._type == 'for': self._type = 'forloop'\n self._name = attrs.get('name')\n self._timeout = attrs.get('timeout')\n self._keywords = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L152_C8", "label": "__init__()", "type": "expression", "loc": [152, 152], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L151_C4", "vector": [8, 2, 0.3128, 0.0021, 2, 0.16, 0.0, 555, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " _Handler.__init__(self, context)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L153_C8", "label": "start_keyword()", "type": "expression", "loc": [153, 153], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L151_C4", "vector": [8, 2, 0.3148, 0.0021, 2, 0.16, 0.125, 776, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start_keyword", "arg_names": [], "import_names": [], "rhs_call_name": "start_keyword", "annotation": ""}, "snippet": " self._context.start_keyword()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L154_C8", "label": "self._type = get()", "type": "assigned_variable", "loc": [154, 154], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L151_C4", "vector": [14, 2, 0.3169, 0.0021, 2, 0.16, 0.25, 313, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "self._type", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " self._type = attrs.get('type')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L155_C8", "label": "if", "type": "if", "loc": [155, 155], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L151_C4", "vector": [4, 2, 0.3189, 0.0021, 2, 0.16, 0.375, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._type == 'for': self._type = 'forloop'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L155_C32", "label": "self._type =", "type": "assigned_variable", "loc": [155, 155], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L155_C8", "vector": [14, 3, 0.3189, 0.0021, 3, 0.73, 0.0, 313, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self._type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._type == 'for': self._type = 'forloop'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L156_C8", "label": "self._name = get()", "type": "assigned_variable", "loc": [156, 156], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L151_C4", "vector": [14, 2, 0.321, 0.0021, 2, 0.16, 0.5, 257, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "self._name", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " self._name = attrs.get('name')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L157_C8", "label": "self._timeout = get()", "type": "assigned_variable", "loc": [157, 157], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L151_C4", "vector": [14, 2, 0.323, 0.0021, 2, 0.16, 0.625, 347, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "self._timeout", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " self._timeout = attrs.get('timeout')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L158_C8", "label": "self._keywords =", "type": "assigned_variable", "loc": [158, 158], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L151_C4", "vector": [14, 2, 0.3251, 0.0021, 2, 0.16, 0.75, 404, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self._keywords", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._keywords = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L159_C8", "label": "self._messages =", "type": "assigned_variable", "loc": [159, 159], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L151_C4", "vector": [14, 2, 0.3272, 0.0021, 2, 0.16, 0.875, 812, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self._messages", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._messages = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L160_C8", "label": "self._current_children =", "type": "assigned_variable", "loc": [160, 160], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L151_C4", "vector": [14, 2, 0.3292, 0.0021, 2, 0.16, 1.0, 619, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self._current_children", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._current_children = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L162_C4", "label": "get_handler_for", "type": "function", "loc": [162, 170], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L149_C0", "vector": [2, 1, 0.3416, 0.0185, 1, 0.99, 0.3333, 198, 0, 3, 1, 0, 0, 0, 3], "semantic": {"name": "get_handler_for", "arg_names": ["self", "name", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_handler_for(self, name, attrs):\n if name == 'status':\n # TODO: Use 1/0 instead of Y/N. Possibly also 1/0/-1 instead of P/F/N.\n self._critical = 'Y' if attrs.get('critical') == 'yes' else 'N'\n self._current_children = {\n 'kw': self._keywords,\n 'msg': self._messages\n }.get(name, self._data_from_children)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L163_C8", "label": "if", "type": "if", "loc": [163, 165], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L162_C4", "vector": [4, 2, 0.3374, 0.0062, 2, 0.74, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if name == 'status':\n # TODO: Use 1/0 instead of Y/N. Possibly also 1/0/-1 instead of P/F/N.\n self._critical = 'Y' if attrs.get('critical') == 'yes' else 'N'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L165_C12", "label": "self._critical =", "type": "assigned_variable", "loc": [165, 165], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L163_C8", "vector": [14, 3, 0.3395, 0.0021, 3, 0.02, 0.0, 993, 8, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self._critical", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._critical = 'Y' if attrs.get('critical') == 'yes' else 'N'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L166_C8", "label": "self._current_children = get()", "type": "assigned_variable", "loc": [166, 169], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L162_C4", "vector": [14, 2, 0.3447, 0.0082, 2, 0.74, 0.5, 619, 3, 2, 0, 0, 607, 10, 1], "semantic": {"name": "self._current_children", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " self._current_children = {\n 'kw': self._keywords,\n 'msg': self._messages\n }.get(name, self._data_from_children)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L170_C8", "label": "return", "type": "return", "loc": [170, 170], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L162_C4", "vector": [13, 2, 0.3498, 0.0021, 2, 0.74, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return _Handler.get_handler_for(self, name, attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L172_C4", "label": "add_child_data", "type": "function", "loc": [172, 173], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L149_C0", "vector": [2, 1, 0.3549, 0.0041, 1, 0.99, 0.6667, 224, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "add_child_data", "arg_names": ["self", "data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add_child_data(self, data):\n self._current_children.append(data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L173_C8", "label": "append()", "type": "expression", "loc": [173, 173], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L172_C4", "vector": [8, 2, 0.356, 0.0021, 2, 0.66, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self._current_children.append(data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L175_C4", "label": "end_element", "type": "function", "loc": [175, 181], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L149_C0", "vector": [2, 1, 0.3663, 0.0144, 1, 0.99, 1.0, 513, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "end_element", "arg_names": ["self", "text"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end_element(self, text):\n if self._type == 'teardown' and self._data_from_children[-1][0] == self._get_id('F'):\n self._context.teardown_failed()\n result = self._get_ids([self._type, self._name, self._timeout]) + \\\n self._data_from_children + [self._keywords] + [self._messages]\n self._context.end_keyword()\n return result"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L176_C8", "label": "if", "type": "if", "loc": [176, 177], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L175_C4", "vector": [4, 2, 0.3632, 0.0041, 2, 0.03, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._type == 'teardown' and self._data_from_children[-1][0] == self._get_id('F'):\n self._context.teardown_failed()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L177_C12", "label": "teardown_failed()", "type": "expression", "loc": [177, 177], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L176_C8", "vector": [8, 3, 0.3642, 0.0021, 3, 0.04, 0.0, 218, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "teardown_failed", "arg_names": [], "import_names": [], "rhs_call_name": "teardown_failed", "annotation": ""}, "snippet": " self._context.teardown_failed()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L178_C8", "label": "result =", "type": "assigned_variable", "loc": [178, 179], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L175_C4", "vector": [14, 2, 0.3673, 0.0041, 2, 0.03, 0.3333, 51, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " result = self._get_ids([self._type, self._name, self._timeout]) + \\\n self._data_from_children + [self._keywords] + [self._messages]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L180_C8", "label": "end_keyword()", "type": "expression", "loc": [180, 180], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L175_C4", "vector": [8, 2, 0.3704, 0.0021, 2, 0.03, 0.6667, 959, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "end_keyword", "arg_names": [], "import_names": [], "rhs_call_name": "end_keyword", "annotation": ""}, "snippet": " self._context.end_keyword()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L181_C8", "label": "return", "type": "return", "loc": [181, 181], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L175_C4", "vector": [13, 2, 0.3724, 0.0021, 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 result"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L186_C0", "label": "_StatisticsHandler", "type": "class", "loc": [186, 189], "level": 0, "parent": null, "vector": [3, 0, 0.3858, 0.0082, 0, 0.66, 0.4167, 680, 0, 1, 0, 0, 557, 0, 1], "semantic": {"name": "_StatisticsHandler", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _StatisticsHandler(_Handler):\n\n def get_handler_for(self, name, attrs):\n return _Handler(self._context, attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L188_C4", "label": "get_handler_for", "type": "function", "loc": [188, 189], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L186_C0", "vector": [2, 1, 0.3879, 0.0041, 1, 0.78, 0.0, 198, 0, 3, 1, 0, 0, 0, 1], "semantic": {"name": "get_handler_for", "arg_names": ["self", "name", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_handler_for(self, name, attrs):\n return _Handler(self._context, attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L189_C8", "label": "return", "type": "return", "loc": [189, 189], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L188_C4", "vector": [13, 2, 0.3889, 0.0021, 2, 0.55, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return _Handler(self._context, attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L192_C0", "label": "_StatItemHandler", "type": "class", "loc": [192, 206], "level": 0, "parent": null, "vector": [3, 0, 0.4095, 0.0309, 0, 0.66, 0.4583, 207, 0, 2, 0, 0, 557, 0, 6], "semantic": {"name": "_StatItemHandler", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _StatItemHandler(_Handler):\n\n def __init__(self, context, attrs):\n _Handler.__init__(self, context)\n self._attrs = dict(attrs)\n self._attrs['pass'] = int(self._attrs['pass'])\n self._attrs['fail'] = int(self._attrs['fail'])\n if 'doc' in self._attrs:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L194_C4", "label": "__init__", "type": "function", "loc": [194, 200], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L192_C0", "vector": [2, 1, 0.4053, 0.0144, 1, 0.54, 0.0, 555, 0, 3, 0, 0, 0, 0, 5], "semantic": {"name": "__init__", "arg_names": ["self", "context", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, context, attrs):\n _Handler.__init__(self, context)\n self._attrs = dict(attrs)\n self._attrs['pass'] = int(self._attrs['pass'])\n self._attrs['fail'] = int(self._attrs['fail'])\n if 'doc' in self._attrs:\n self._attrs['doc'] = utils.html_format(self._attrs['doc'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L195_C8", "label": "__init__()", "type": "expression", "loc": [195, 195], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L194_C4", "vector": [8, 2, 0.4012, 0.0021, 2, 0.07, 0.0, 555, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " _Handler.__init__(self, context)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L196_C8", "label": "self._attrs = dict()", "type": "assigned_variable", "loc": [196, 196], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L194_C4", "vector": [14, 2, 0.4033, 0.0021, 2, 0.07, 0.25, 182, 3, 1, 0, 0, 827, 10, 1], "semantic": {"name": "self._attrs", "arg_names": [], "import_names": [], "rhs_call_name": "dict", "annotation": ""}, "snippet": " self._attrs = dict(attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L197_C8", "label": " = int()", "type": "assigned_variable", "loc": [197, 197], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L194_C4", "vector": [14, 2, 0.4053, 0.0021, 2, 0.07, 0.5, 0, 3, 1, 0, 0, 901, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " self._attrs['pass'] = int(self._attrs['pass'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L198_C8", "label": " = int()", "type": "assigned_variable", "loc": [198, 198], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L194_C4", "vector": [14, 2, 0.4074, 0.0021, 2, 0.07, 0.75, 0, 3, 1, 0, 0, 901, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " self._attrs['fail'] = int(self._attrs['fail'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L199_C8", "label": "if", "type": "if", "loc": [199, 200], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L194_C4", "vector": [4, 2, 0.4105, 0.0041, 2, 0.07, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'doc' in self._attrs:\n self._attrs['doc'] = utils.html_format(self._attrs['doc'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L200_C12", "label": " = html_format()", "type": "assigned_variable", "loc": [200, 200], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L199_C8", "vector": [14, 3, 0.4115, 0.0021, 3, 0.27, 0.0, 0, 3, 1, 0, 0, 440, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "html_format", "annotation": ""}, "snippet": " self._attrs['doc'] = utils.html_format(self._attrs['doc'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L204_C4", "label": "end_element", "type": "function", "loc": [204, 206], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L192_C0", "vector": [2, 1, 0.4218, 0.0062, 1, 0.54, 1.0, 513, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "end_element", "arg_names": ["self", "text"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end_element(self, text):\n self._attrs.update(label=text)\n return self._attrs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L205_C8", "label": "update()", "type": "expression", "loc": [205, 205], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L204_C4", "vector": [8, 2, 0.4218, 0.0021, 2, 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": " self._attrs.update(label=text)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L206_C8", "label": "return", "type": "return", "loc": [206, 206], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L204_C4", "vector": [13, 2, 0.4239, 0.0021, 2, 0.81, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._attrs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L209_C0", "label": "_StatusHandler", "type": "class", "loc": [209, 229], "level": 0, "parent": null, "vector": [3, 0, 0.4506, 0.0432, 0, 0.66, 0.5, 885, 0, 3, 0, 0, 557, 0, 10], "semantic": {"name": "_StatusHandler", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _StatusHandler(_Handler):\n\n def __init__(self, context, attrs):\n self._context = context\n self._status = attrs.get('status')[0]\n self._starttime = self._context.timestamp(attrs.get('starttime'))\n self._elapsed = self._calculate_elapsed(attrs)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L211_C4", "label": "__init__", "type": "function", "loc": [211, 215], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L209_C0", "vector": [2, 1, 0.4383, 0.0103, 1, 0.56, 0.0, 555, 0, 3, 0, 0, 0, 0, 4], "semantic": {"name": "__init__", "arg_names": ["self", "context", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, context, attrs):\n self._context = context\n self._status = attrs.get('status')[0]\n self._starttime = self._context.timestamp(attrs.get('starttime'))\n self._elapsed = self._calculate_elapsed(attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L212_C8", "label": "self._context =", "type": "assigned_variable", "loc": [212, 212], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L211_C4", "vector": [14, 2, 0.4362, 0.0021, 2, 0.99, 0.0, 962, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._context", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._context = context"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L213_C8", "label": "self._status =", "type": "assigned_variable", "loc": [213, 213], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L211_C4", "vector": [14, 2, 0.4383, 0.0021, 2, 0.99, 0.3333, 891, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self._status", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._status = attrs.get('status')[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L214_C8", "label": "self._starttime = timestamp()", "type": "assigned_variable", "loc": [214, 214], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L211_C4", "vector": [14, 2, 0.4403, 0.0021, 2, 0.99, 0.6667, 167, 3, 1, 0, 0, 834, 10, 2], "semantic": {"name": "self._starttime", "arg_names": [], "import_names": [], "rhs_call_name": "timestamp", "annotation": ""}, "snippet": " self._starttime = self._context.timestamp(attrs.get('starttime'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L215_C8", "label": "self._elapsed = _calculate_elapsed()", "type": "assigned_variable", "loc": [215, 215], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L211_C4", "vector": [14, 2, 0.4424, 0.0021, 2, 0.99, 1.0, 538, 3, 1, 0, 0, 279, 10, 1], "semantic": {"name": "self._elapsed", "arg_names": [], "import_names": [], "rhs_call_name": "_calculate_elapsed", "annotation": ""}, "snippet": " self._elapsed = self._calculate_elapsed(attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L217_C4", "label": "_calculate_elapsed", "type": "function", "loc": [217, 223], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L209_C0", "vector": [2, 1, 0.4527, 0.0144, 1, 0.56, 0.5, 279, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "_calculate_elapsed", "arg_names": ["self", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _calculate_elapsed(self, attrs):\n endtime = self._context.timestamp(attrs.get('endtime'))\n # Must compare against None because either start and end may be 0.\n if self._starttime is not None or endtime is not None:\n return endtime - self._starttime\n # Only RF 2.6+ outputs have elapsedtime when start or end is N/A.\n return int(attrs.get('elapsedtime', 0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L218_C8", "label": "endtime = timestamp()", "type": "assigned_variable", "loc": [218, 218], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L217_C4", "vector": [14, 2, 0.4486, 0.0021, 2, 0.65, 0.0, 975, 3, 1, 0, 0, 834, 10, 2], "semantic": {"name": "endtime", "arg_names": [], "import_names": [], "rhs_call_name": "timestamp", "annotation": ""}, "snippet": " endtime = self._context.timestamp(attrs.get('endtime'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L220_C8", "label": "if", "type": "if", "loc": [220, 221], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L217_C4", "vector": [4, 2, 0.4537, 0.0041, 2, 0.65, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._starttime is not None or endtime is not None:\n return endtime - self._starttime"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L221_C12", "label": "return", "type": "return", "loc": [221, 221], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L220_C8", "vector": [13, 3, 0.4547, 0.0021, 3, 0.34, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return endtime - self._starttime"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L223_C8", "label": "return", "type": "return", "loc": [223, 223], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L217_C4", "vector": [13, 2, 0.4588, 0.0021, 2, 0.65, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return int(attrs.get('elapsedtime', 0))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L225_C4", "label": "end_element", "type": "function", "loc": [225, 229], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L209_C0", "vector": [2, 1, 0.4671, 0.0103, 1, 0.56, 1.0, 513, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "end_element", "arg_names": ["self", "text"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end_element(self, text):\n result = [self._status, self._starttime, self._elapsed]\n if text:\n result.append(text)\n return self._get_ids(result)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L226_C8", "label": "result =", "type": "assigned_variable", "loc": [226, 226], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L225_C4", "vector": [14, 2, 0.465, 0.0021, 2, 0.34, 0.0, 51, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " result = [self._status, self._starttime, self._elapsed]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L227_C8", "label": "if", "type": "if", "loc": [227, 228], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L225_C4", "vector": [4, 2, 0.4681, 0.0041, 2, 0.34, 0.5, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if text:\n result.append(text)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L228_C12", "label": "append()", "type": "expression", "loc": [228, 228], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L227_C8", "vector": [8, 3, 0.4691, 0.0021, 3, 0.52, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " result.append(text)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L229_C8", "label": "return", "type": "return", "loc": [229, 229], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L225_C4", "vector": [13, 2, 0.4712, 0.0021, 2, 0.34, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._get_ids(result)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L232_C0", "label": "_ArgumentHandler", "type": "class", "loc": [232, 235], "level": 0, "parent": null, "vector": [3, 0, 0.4805, 0.0082, 0, 0.66, 0.5417, 234, 0, 1, 0, 0, 557, 0, 0], "semantic": {"name": "_ArgumentHandler", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _ArgumentHandler(_Handler):\n\n def end_element(self, text):\n return text"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L234_C4", "label": "end_element", "type": "function", "loc": [234, 235], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L232_C0", "vector": [2, 1, 0.4825, 0.0041, 1, 0.51, 0.0, 513, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "end_element", "arg_names": ["self", "text"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end_element(self, text):\n return text"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L235_C8", "label": "return", "type": "return", "loc": [235, 235], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L234_C4", "vector": [13, 2, 0.4835, 0.0021, 2, 0.33, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return text"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L238_C0", "label": "_ArgumentsHandler", "type": "class", "loc": [238, 241], "level": 0, "parent": null, "vector": [3, 0, 0.4928, 0.0082, 0, 0.66, 0.5833, 995, 0, 1, 0, 0, 557, 0, 2], "semantic": {"name": "_ArgumentsHandler", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _ArgumentsHandler(_Handler):\n\n def end_element(self, text):\n return self._get_id(', '.join(self._data_from_children))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L240_C4", "label": "end_element", "type": "function", "loc": [240, 241], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L238_C0", "vector": [2, 1, 0.4949, 0.0041, 1, 0.64, 0.0, 513, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "end_element", "arg_names": ["self", "text"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end_element(self, text):\n return self._get_id(', '.join(self._data_from_children))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L241_C8", "label": "return", "type": "return", "loc": [241, 241], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L240_C4", "vector": [13, 2, 0.4959, 0.0021, 2, 0.55, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._get_id(', '.join(self._data_from_children))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L244_C0", "label": "_TextHandler", "type": "class", "loc": [244, 247], "level": 0, "parent": null, "vector": [3, 0, 0.5051, 0.0082, 0, 0.66, 0.625, 794, 0, 1, 0, 0, 557, 0, 1], "semantic": {"name": "_TextHandler", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _TextHandler(_Handler):\n\n def end_element(self, text):\n return self._get_id(text)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L246_C4", "label": "end_element", "type": "function", "loc": [246, 247], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L244_C0", "vector": [2, 1, 0.5072, 0.0041, 1, 0.79, 0.0, 513, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "end_element", "arg_names": ["self", "text"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end_element(self, text):\n return self._get_id(text)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L247_C8", "label": "return", "type": "return", "loc": [247, 247], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L246_C4", "vector": [13, 2, 0.5082, 0.0021, 2, 0.23, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._get_id(text)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L250_C0", "label": "_HtmlTextHandler", "type": "class", "loc": [250, 253], "level": 0, "parent": null, "vector": [3, 0, 0.5175, 0.0082, 0, 0.66, 0.6667, 178, 0, 1, 0, 0, 557, 0, 2], "semantic": {"name": "_HtmlTextHandler", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _HtmlTextHandler(_Handler):\n\n def end_element(self, text):\n return self._get_id(utils.html_format(text))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L252_C4", "label": "end_element", "type": "function", "loc": [252, 253], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L250_C0", "vector": [2, 1, 0.5195, 0.0041, 1, 0.62, 0.0, 513, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "end_element", "arg_names": ["self", "text"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end_element(self, text):\n return self._get_id(utils.html_format(text))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L253_C8", "label": "return", "type": "return", "loc": [253, 253], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L252_C4", "vector": [13, 2, 0.5206, 0.0021, 2, 0.61, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._get_id(utils.html_format(text))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L256_C0", "label": "_MetadataHandler", "type": "class", "loc": [256, 266], "level": 0, "parent": null, "vector": [3, 0, 0.537, 0.0226, 0, 0.66, 0.7083, 260, 0, 3, 0, 0, 557, 0, 2], "semantic": {"name": "_MetadataHandler", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _MetadataHandler(_Handler):\n\n def __init__(self, context, attrs):\n _Handler.__init__(self, context)\n self._metadata = []\n\n def add_child_data(self, data):\n self._metadata.extend(data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L258_C4", "label": "__init__", "type": "function", "loc": [258, 260], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L256_C0", "vector": [2, 1, 0.5329, 0.0062, 1, 0.94, 0.0, 555, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "context", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, context, attrs):\n _Handler.__init__(self, context)\n self._metadata = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L259_C8", "label": "__init__()", "type": "expression", "loc": [259, 259], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L258_C4", "vector": [8, 2, 0.5329, 0.0021, 2, 0.11, 0.0, 555, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " _Handler.__init__(self, context)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L260_C8", "label": "self._metadata =", "type": "assigned_variable", "loc": [260, 260], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L258_C4", "vector": [14, 2, 0.535, 0.0021, 2, 0.11, 1.0, 257, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self._metadata", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._metadata = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L262_C4", "label": "add_child_data", "type": "function", "loc": [262, 263], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L256_C0", "vector": [2, 1, 0.5401, 0.0041, 1, 0.94, 0.5, 224, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "add_child_data", "arg_names": ["self", "data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add_child_data(self, data):\n self._metadata.extend(data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L263_C8", "label": "extend()", "type": "expression", "loc": [263, 263], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L262_C4", "vector": [8, 2, 0.5412, 0.0021, 2, 0.09, 0.0, 660, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "extend", "arg_names": [], "import_names": [], "rhs_call_name": "extend", "annotation": ""}, "snippet": " self._metadata.extend(data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L265_C4", "label": "end_element", "type": "function", "loc": [265, 266], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L256_C0", "vector": [2, 1, 0.5463, 0.0041, 1, 0.94, 1.0, 513, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "end_element", "arg_names": ["self", "text"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end_element(self, text):\n return self._metadata"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L266_C8", "label": "return", "type": "return", "loc": [266, 266], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L265_C4", "vector": [13, 2, 0.5473, 0.0021, 2, 0.39, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._metadata"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L269_C0", "label": "_MetadataItemHandler", "type": "class", "loc": [269, 276], "level": 0, "parent": null, "vector": [3, 0, 0.5607, 0.0165, 0, 0.66, 0.75, 415, 0, 2, 0, 0, 557, 0, 4], "semantic": {"name": "_MetadataItemHandler", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _MetadataItemHandler(_Handler):\n\n def __init__(self, context, attrs):\n _Handler.__init__(self, context)\n self._name = attrs.get('name')\n\n def end_element(self, text):\n return self._get_ids([self._name, utils.html_format(text)])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L271_C4", "label": "__init__", "type": "function", "loc": [271, 273], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L269_C0", "vector": [2, 1, 0.5597, 0.0062, 1, 0.75, 0.0, 555, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "context", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, context, attrs):\n _Handler.__init__(self, context)\n self._name = attrs.get('name')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L272_C8", "label": "__init__()", "type": "expression", "loc": [272, 272], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L271_C4", "vector": [8, 2, 0.5597, 0.0021, 2, 0.99, 0.0, 555, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " _Handler.__init__(self, context)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L273_C8", "label": "self._name = get()", "type": "assigned_variable", "loc": [273, 273], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L271_C4", "vector": [14, 2, 0.5617, 0.0021, 2, 0.99, 1.0, 257, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "self._name", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " self._name = attrs.get('name')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L275_C4", "label": "end_element", "type": "function", "loc": [275, 276], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L269_C0", "vector": [2, 1, 0.5669, 0.0041, 1, 0.75, 1.0, 513, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "end_element", "arg_names": ["self", "text"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end_element(self, text):\n return self._get_ids([self._name, utils.html_format(text)])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L276_C8", "label": "return", "type": "return", "loc": [276, 276], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L275_C4", "vector": [13, 2, 0.5679, 0.0021, 2, 0.1, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._get_ids([self._name, utils.html_format(text)])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L279_C0", "label": "_MsgHandler", "type": "class", "loc": [279, 298], "level": 0, "parent": null, "vector": [3, 0, 0.5936, 0.0412, 0, 0.66, 0.7917, 48, 0, 3, 0, 0, 557, 0, 13], "semantic": {"name": "_MsgHandler", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _MsgHandler(_Handler):\n\n def __init__(self, context, attrs):\n _Handler.__init__(self, context)\n self._msg = [self._context.timestamp(attrs.get('timestamp')),\n attrs.get('level')[0]]\n self._is_html = attrs.get('html')\n self._is_linkable = attrs.get(\"linkable\") == \"yes\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L281_C4", "label": "__init__", "type": "function", "loc": [281, 286], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L279_C0", "vector": [2, 1, 0.5833, 0.0123, 1, 0.15, 0.0, 555, 0, 3, 0, 0, 0, 0, 6], "semantic": {"name": "__init__", "arg_names": ["self", "context", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, context, attrs):\n _Handler.__init__(self, context)\n self._msg = [self._context.timestamp(attrs.get('timestamp')),\n attrs.get('level')[0]]\n self._is_html = attrs.get('html')\n self._is_linkable = attrs.get(\"linkable\") == \"yes\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L282_C8", "label": "__init__()", "type": "expression", "loc": [282, 282], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L281_C4", "vector": [8, 2, 0.5802, 0.0021, 2, 0.14, 0.0, 555, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " _Handler.__init__(self, context)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L283_C8", "label": "self._msg =", "type": "assigned_variable", "loc": [283, 284], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L281_C4", "vector": [14, 2, 0.5833, 0.0041, 2, 0.14, 0.3333, 405, 0, 0, 0, 0, 0, 5, 3], "semantic": {"name": "self._msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._msg = [self._context.timestamp(attrs.get('timestamp')),\n attrs.get('level')[0]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L285_C8", "label": "self._is_html = get()", "type": "assigned_variable", "loc": [285, 285], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L281_C4", "vector": [14, 2, 0.5864, 0.0021, 2, 0.14, 0.6667, 428, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "self._is_html", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " self._is_html = attrs.get('html')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L286_C8", "label": "self._is_linkable =", "type": "assigned_variable", "loc": [286, 286], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L281_C4", "vector": [14, 2, 0.5885, 0.0021, 2, 0.14, 1.0, 640, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self._is_linkable", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._is_linkable = attrs.get(\"linkable\") == \"yes\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L288_C4", "label": "end_element", "type": "function", "loc": [288, 291], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L279_C0", "vector": [2, 1, 0.5957, 0.0082, 1, 0.15, 0.5, 513, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "end_element", "arg_names": ["self", "text"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end_element(self, text):\n self._msg.append(text if self._is_html else utils.html_escape(text))\n self._handle_warning_linking()\n return self._get_ids(self._msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L289_C8", "label": "append()", "type": "expression", "loc": [289, 289], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L288_C4", "vector": [8, 2, 0.5947, 0.0021, 2, 0.62, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self._msg.append(text if self._is_html else utils.html_escape(text))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L290_C8", "label": "_handle_warning_linking()", "type": "expression", "loc": [290, 290], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L288_C4", "vector": [8, 2, 0.5967, 0.0021, 2, 0.62, 0.5, 106, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_handle_warning_linking", "arg_names": [], "import_names": [], "rhs_call_name": "_handle_warning_linking", "annotation": ""}, "snippet": " self._handle_warning_linking()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L291_C8", "label": "return", "type": "return", "loc": [291, 291], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L288_C4", "vector": [13, 2, 0.5988, 0.0021, 2, 0.62, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._get_ids(self._msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L293_C4", "label": "_handle_warning_linking", "type": "function", "loc": [293, 298], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L279_C0", "vector": [2, 1, 0.608, 0.0123, 1, 0.15, 1.0, 106, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "_handle_warning_linking", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _handle_warning_linking(self):\n # TODO: should perhaps use the id version of this list for indexing?\n if self._is_linkable:\n self._msg.append(self._context.link_to(self._msg))\n elif self._msg[1] == 'W':\n self._context.create_link_to_current_location(self._msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L295_C8", "label": "if", "type": "if", "loc": [295, 298], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L293_C4", "vector": [4, 2, 0.6101, 0.0082, 2, 0.0, 0.0, 0, 7, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._is_linkable:\n self._msg.append(self._context.link_to(self._msg))\n elif self._msg[1] == 'W':\n self._context.create_link_to_current_location(self._msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L296_C12", "label": "append()", "type": "expression", "loc": [296, 296], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L295_C8", "vector": [8, 3, 0.6091, 0.0021, 3, 0.44, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self._msg.append(self._context.link_to(self._msg))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L297_C8", "label": "if", "type": "if", "loc": [297, 298], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L295_C8", "vector": [4, 3, 0.6121, 0.0041, 3, 0.44, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif self._msg[1] == 'W':\n self._context.create_link_to_current_location(self._msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L298_C12", "label": "create_link_to_current_location()", "type": "expression", "loc": [298, 298], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L297_C8", "vector": [8, 4, 0.6132, 0.0021, 4, 0.12, 0.0, 229, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "create_link_to_current_location", "arg_names": [], "import_names": [], "rhs_call_name": "create_link_to_current_location", "annotation": ""}, "snippet": " self._context.create_link_to_current_location(self._msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L301_C0", "label": "Context", "type": "class", "loc": [301, 404], "level": 0, "parent": null, "vector": [3, 0, 0.7253, 0.214, 0, 0.66, 0.8333, 560, 0, 20, 0, 0, 186, 0, 37], "semantic": {"name": "Context", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Context(object):\n\n def __init__(self, split_tests=False):\n self._main_text_cache = TextCache()\n self._current_texts = self._main_text_cache\n self._split_text_caches = []\n self._basemillis = 0\n self._stats = Stats()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L303_C4", "label": "__init__", "type": "function", "loc": [303, 313], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L301_C0", "vector": [2, 1, 0.6337, 0.0226, 1, 0.17, 0.0, 555, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "split_tests"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, split_tests=False):\n self._main_text_cache = TextCache()\n self._current_texts = self._main_text_cache\n self._split_text_caches = []\n self._basemillis = 0\n self._stats = Stats()\n self._current_place = []\n self._kw_index = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L304_C8", "label": "self._main_text_cache = TextCache()", "type": "assigned_variable", "loc": [304, 304], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L303_C4", "vector": [14, 2, 0.6255, 0.0021, 2, 0.57, 0.0, 804, 3, 0, 0, 0, 268, 10, 1], "semantic": {"name": "self._main_text_cache", "arg_names": [], "import_names": [], "rhs_call_name": "TextCache", "annotation": ""}, "snippet": " self._main_text_cache = TextCache()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L305_C8", "label": "self._current_texts =", "type": "assigned_variable", "loc": [305, 305], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L303_C4", "vector": [14, 2, 0.6276, 0.0021, 2, 0.57, 0.1111, 989, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._current_texts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._current_texts = self._main_text_cache"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L306_C8", "label": "self._split_text_caches =", "type": "assigned_variable", "loc": [306, 306], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L303_C4", "vector": [14, 2, 0.6296, 0.0021, 2, 0.57, 0.2222, 46, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self._split_text_caches", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._split_text_caches = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L307_C8", "label": "self._basemillis =", "type": "assigned_variable", "loc": [307, 307], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L303_C4", "vector": [14, 2, 0.6317, 0.0021, 2, 0.57, 0.3333, 665, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self._basemillis", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._basemillis = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L308_C8", "label": "self._stats = Stats()", "type": "assigned_variable", "loc": [308, 308], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L303_C4", "vector": [14, 2, 0.6337, 0.0021, 2, 0.57, 0.4444, 540, 3, 0, 0, 0, 458, 10, 1], "semantic": {"name": "self._stats", "arg_names": [], "import_names": [], "rhs_call_name": "Stats", "annotation": ""}, "snippet": " self._stats = Stats()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L309_C8", "label": "self._current_place =", "type": "assigned_variable", "loc": [309, 309], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L303_C4", "vector": [14, 2, 0.6358, 0.0021, 2, 0.57, 0.5556, 235, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self._current_place", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._current_place = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L310_C8", "label": "self._kw_index =", "type": "assigned_variable", "loc": [310, 310], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L303_C4", "vector": [14, 2, 0.6379, 0.0021, 2, 0.57, 0.6667, 412, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self._kw_index", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._kw_index = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L311_C8", "label": "self._links =", "type": "assigned_variable", "loc": [311, 311], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L303_C4", "vector": [14, 2, 0.6399, 0.0021, 2, 0.57, 0.7778, 497, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self._links", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._links = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L312_C8", "label": "self._split_tests =", "type": "assigned_variable", "loc": [312, 312], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L303_C4", "vector": [14, 2, 0.642, 0.0021, 2, 0.57, 0.8889, 709, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._split_tests", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._split_tests = split_tests"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L313_C8", "label": "self._split_results =", "type": "assigned_variable", "loc": [313, 313], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L303_C4", "vector": [14, 2, 0.644, 0.0021, 2, 0.57, 1.0, 225, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self._split_results", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._split_results = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L316_C4", "label": "basemillis", "type": "function", "loc": [316, 317], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L301_C0", "vector": [2, 1, 0.6512, 0.0041, 1, 0.17, 0.0526, 60, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "basemillis", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def basemillis(self):\n return self._basemillis"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L317_C8", "label": "return", "type": "return", "loc": [317, 317], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L316_C4", "vector": [13, 2, 0.6523, 0.0021, 2, 0.08, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._basemillis"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L320_C4", "label": "split_results", "type": "function", "loc": [320, 321], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L301_C0", "vector": [2, 1, 0.6595, 0.0041, 1, 0.17, 0.1053, 892, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "split_results", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def split_results(self):\n return self._split_results"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L321_C8", "label": "return", "type": "return", "loc": [321, 321], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L320_C4", "vector": [13, 2, 0.6605, 0.0021, 2, 0.87, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._split_results"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L323_C4", "label": "collect_stats", "type": "function", "loc": [323, 325], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L301_C0", "vector": [2, 1, 0.6667, 0.0062, 1, 0.17, 0.1579, 727, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "collect_stats", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def collect_stats(self):\n self._stats = self._stats.new_child()\n return self"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L324_C8", "label": "self._stats = new_child()", "type": "assigned_variable", "loc": [324, 324], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L323_C4", "vector": [14, 2, 0.6667, 0.0021, 2, 0.61, 0.0, 540, 3, 0, 0, 0, 634, 10, 1], "semantic": {"name": "self._stats", "arg_names": [], "import_names": [], "rhs_call_name": "new_child", "annotation": ""}, "snippet": " self._stats = self._stats.new_child()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L325_C8", "label": "return", "type": "return", "loc": [325, 325], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L323_C4", "vector": [13, 2, 0.6687, 0.0021, 2, 0.61, 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_99885:FunctionDef_L327_C4", "label": "dump_stats", "type": "function", "loc": [327, 331], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L301_C0", "vector": [2, 1, 0.677, 0.0103, 1, 0.17, 0.2105, 532, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "dump_stats", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def dump_stats(self):\n try:\n return self._stats.dump()\n finally:\n self._stats = self._stats.parent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Try_L328_C8", "label": "try", "type": "try", "loc": [328, 331], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L327_C4", "vector": [7, 2, 0.678, 0.0082, 2, 0.7, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n return self._stats.dump()\n finally:\n self._stats = self._stats.parent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L329_C12", "label": "return", "type": "return", "loc": [329, 329], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:Try_L328_C8", "vector": [13, 3, 0.677, 0.0021, 3, 0.16, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._stats.dump()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L331_C12", "label": "self._stats =", "type": "assigned_variable", "loc": [331, 331], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:Try_L328_C8", "vector": [14, 3, 0.6811, 0.0021, 3, 0.16, 1.0, 540, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._stats", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._stats = self._stats.parent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L333_C4", "label": "get_id", "type": "function", "loc": [333, 340], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L301_C0", "vector": [2, 1, 0.6924, 0.0165, 1, 0.17, 0.2632, 178, 0, 2, 1, 0, 0, 0, 5], "semantic": {"name": "get_id", "arg_names": ["self", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_id(self, value):\n if value is None:\n return None\n if isinstance(value, basestring):\n return self._get_text_id(value)\n if isinstance(value, (int, long)):\n return value\n raise TypeError('Unsupported type %s' % type(value))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L334_C8", "label": "if", "type": "if", "loc": [334, 335], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L333_C4", "vector": [4, 2, 0.6883, 0.0041, 2, 0.09, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if value is None:\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L335_C12", "label": "return", "type": "return", "loc": [335, 335], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L334_C8", "vector": [13, 3, 0.6893, 0.0021, 3, 0.8, 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_99885:If_L336_C8", "label": "if", "type": "if", "loc": [336, 337], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L333_C4", "vector": [4, 2, 0.6924, 0.0041, 2, 0.09, 0.5, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(value, basestring):\n return self._get_text_id(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L337_C12", "label": "return", "type": "return", "loc": [337, 337], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L336_C8", "vector": [13, 3, 0.6934, 0.0021, 3, 0.35, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._get_text_id(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L338_C8", "label": "if", "type": "if", "loc": [338, 339], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L333_C4", "vector": [4, 2, 0.6965, 0.0041, 2, 0.09, 1.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(value, (int, long)):\n return value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L339_C12", "label": "return", "type": "return", "loc": [339, 339], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L338_C8", "vector": [13, 3, 0.6975, 0.0021, 3, 0.7, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L342_C4", "label": "_get_text_id", "type": "function", "loc": [342, 343], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L301_C0", "vector": [2, 1, 0.7047, 0.0041, 1, 0.17, 0.3158, 781, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "_get_text_id", "arg_names": ["self", "text"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_text_id(self, text):\n return self._current_texts.add(text)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L343_C8", "label": "return", "type": "return", "loc": [343, 343], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L342_C4", "vector": [13, 2, 0.7058, 0.0021, 2, 0.89, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._current_texts.add(text)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L345_C4", "label": "dump_texts", "type": "function", "loc": [345, 346], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L301_C0", "vector": [2, 1, 0.7109, 0.0041, 1, 0.17, 0.3684, 850, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "dump_texts", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def dump_texts(self):\n return self._current_texts.dump()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L346_C8", "label": "return", "type": "return", "loc": [346, 346], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L345_C4", "vector": [13, 2, 0.7119, 0.0021, 2, 0.22, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._current_texts.dump()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L348_C4", "label": "timestamp", "type": "function", "loc": [348, 354], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L301_C0", "vector": [2, 1, 0.7222, 0.0144, 1, 0.17, 0.4211, 834, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "timestamp", "arg_names": ["self", "time"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def timestamp(self, time):\n if time == 'N/A':\n return None\n millis = int(utils.timestamp_to_secs(time, millis=True) * 1000)\n if not self._basemillis:\n self._basemillis = millis\n return millis - self.basemillis"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L349_C8", "label": "if", "type": "if", "loc": [349, 350], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L348_C4", "vector": [4, 2, 0.7191, 0.0041, 2, 0.8, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if time == 'N/A':\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L350_C12", "label": "return", "type": "return", "loc": [350, 350], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L349_C8", "vector": [13, 3, 0.7202, 0.0021, 3, 0.69, 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_99885:Assign_L351_C8", "label": "millis = int()", "type": "assigned_variable", "loc": [351, 351], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L348_C4", "vector": [14, 2, 0.7222, 0.0021, 2, 0.8, 0.3333, 889, 3, 1, 0, 0, 901, 10, 2], "semantic": {"name": "millis", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " millis = int(utils.timestamp_to_secs(time, millis=True) * 1000)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L352_C8", "label": "if", "type": "if", "loc": [352, 353], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L348_C4", "vector": [4, 2, 0.7253, 0.0041, 2, 0.8, 0.6667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self._basemillis:\n self._basemillis = millis"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L353_C12", "label": "self._basemillis =", "type": "assigned_variable", "loc": [353, 353], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L352_C8", "vector": [14, 3, 0.7263, 0.0021, 3, 0.94, 0.0, 665, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._basemillis", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._basemillis = millis"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L354_C8", "label": "return", "type": "return", "loc": [354, 354], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L348_C4", "vector": [13, 2, 0.7284, 0.0021, 2, 0.8, 1.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return millis - self.basemillis"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L356_C4", "label": "start_suite", "type": "function", "loc": [356, 358], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L301_C0", "vector": [2, 1, 0.7346, 0.0062, 1, 0.17, 0.4737, 38, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "start_suite", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start_suite(self, name):\n self._current_place.append(('suite', name))\n self._kw_index.append(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L357_C8", "label": "append()", "type": "expression", "loc": [357, 357], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L356_C4", "vector": [8, 2, 0.7346, 0.0021, 2, 0.64, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self._current_place.append(('suite', name))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L358_C8", "label": "append()", "type": "expression", "loc": [358, 358], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L356_C4", "vector": [8, 2, 0.7366, 0.0021, 2, 0.64, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self._kw_index.append(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L360_C4", "label": "end_suite", "type": "function", "loc": [360, 362], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L301_C0", "vector": [2, 1, 0.7428, 0.0062, 1, 0.17, 0.5263, 81, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "end_suite", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end_suite(self):\n self._current_place.pop()\n self._kw_index.pop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L361_C8", "label": "pop()", "type": "expression", "loc": [361, 361], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L360_C4", "vector": [8, 2, 0.7428, 0.0021, 2, 0.27, 0.0, 969, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pop", "arg_names": [], "import_names": [], "rhs_call_name": "pop", "annotation": ""}, "snippet": " self._current_place.pop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L362_C8", "label": "pop()", "type": "expression", "loc": [362, 362], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L360_C4", "vector": [8, 2, 0.7449, 0.0021, 2, 0.27, 1.0, 969, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pop", "arg_names": [], "import_names": [], "rhs_call_name": "pop", "annotation": ""}, "snippet": " self._kw_index.pop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L364_C4", "label": "start_test", "type": "function", "loc": [364, 368], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L301_C0", "vector": [2, 1, 0.7531, 0.0103, 1, 0.17, 0.5789, 246, 0, 2, 0, 0, 0, 0, 4], "semantic": {"name": "start_test", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start_test(self, name):\n if self._split_tests:\n self._split_text_caches.append(TextCache())\n self._current_place.append(('test', name))\n self._kw_index.append(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L365_C8", "label": "if", "type": "if", "loc": [365, 366], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L364_C4", "vector": [4, 2, 0.7521, 0.0041, 2, 0.76, 0.0, 0, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._split_tests:\n self._split_text_caches.append(TextCache())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L366_C12", "label": "append()", "type": "expression", "loc": [366, 366], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L365_C8", "vector": [8, 3, 0.7531, 0.0021, 3, 0.25, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self._split_text_caches.append(TextCache())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L367_C8", "label": "append()", "type": "expression", "loc": [367, 367], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L364_C4", "vector": [8, 2, 0.7551, 0.0021, 2, 0.76, 0.5, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self._current_place.append(('test', name))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L368_C8", "label": "append()", "type": "expression", "loc": [368, 368], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L364_C4", "vector": [8, 2, 0.7572, 0.0021, 2, 0.76, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self._kw_index.append(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L370_C4", "label": "end_test", "type": "function", "loc": [370, 376], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L301_C0", "vector": [2, 1, 0.7675, 0.0144, 1, 0.17, 0.6316, 220, 0, 2, 1, 0, 0, 0, 5], "semantic": {"name": "end_test", "arg_names": ["self", "kw_data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end_test(self, kw_data=None):\n self._current_place.pop()\n self._kw_index.pop()\n if self._split_tests:\n self._split_results.append((kw_data, self._split_text_caches[-1].dump()))\n return len(self._split_results)\n return kw_data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L371_C8", "label": "pop()", "type": "expression", "loc": [371, 371], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L370_C4", "vector": [8, 2, 0.7634, 0.0021, 2, 0.03, 0.0, 969, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pop", "arg_names": [], "import_names": [], "rhs_call_name": "pop", "annotation": ""}, "snippet": " self._current_place.pop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L372_C8", "label": "pop()", "type": "expression", "loc": [372, 372], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L370_C4", "vector": [8, 2, 0.7654, 0.0021, 2, 0.03, 0.3333, 969, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pop", "arg_names": [], "import_names": [], "rhs_call_name": "pop", "annotation": ""}, "snippet": " self._kw_index.pop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L373_C8", "label": "if", "type": "if", "loc": [373, 375], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L370_C4", "vector": [4, 2, 0.7695, 0.0062, 2, 0.03, 0.6667, 0, 7, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._split_tests:\n self._split_results.append((kw_data, self._split_text_caches[-1].dump()))\n return len(self._split_results)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L374_C12", "label": "append()", "type": "expression", "loc": [374, 374], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L373_C8", "vector": [8, 3, 0.7695, 0.0021, 3, 0.37, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self._split_results.append((kw_data, self._split_text_caches[-1].dump()))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L375_C12", "label": "return", "type": "return", "loc": [375, 375], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L373_C8", "vector": [13, 3, 0.7716, 0.0021, 3, 0.37, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return len(self._split_results)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L376_C8", "label": "return", "type": "return", "loc": [376, 376], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L370_C4", "vector": [13, 2, 0.7737, 0.0021, 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 kw_data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L378_C4", "label": "start_keyword", "type": "function", "loc": [378, 383], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L301_C0", "vector": [2, 1, 0.7829, 0.0123, 1, 0.17, 0.6842, 776, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "start_keyword", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start_keyword(self):\n if self._split_tests and self._current_place[-1][0] == 'test':\n self._current_texts = self._split_text_caches[-1]\n self._current_place.append(('keyword', self._kw_index[-1]))\n self._kw_index[-1] += 1\n self._kw_index.append(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L379_C8", "label": "if", "type": "if", "loc": [379, 380], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L378_C4", "vector": [4, 2, 0.7809, 0.0041, 2, 0.02, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._split_tests and self._current_place[-1][0] == 'test':\n self._current_texts = self._split_text_caches[-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L380_C12", "label": "self._current_texts =", "type": "assigned_variable", "loc": [380, 380], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L379_C8", "vector": [14, 3, 0.7819, 0.0021, 3, 0.73, 0.0, 989, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._current_texts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._current_texts = self._split_text_caches[-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L381_C8", "label": "append()", "type": "expression", "loc": [381, 381], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L378_C4", "vector": [8, 2, 0.784, 0.0021, 2, 0.02, 0.5, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self._current_place.append(('keyword', self._kw_index[-1]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L383_C8", "label": "append()", "type": "expression", "loc": [383, 383], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L378_C4", "vector": [8, 2, 0.7881, 0.0021, 2, 0.02, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self._kw_index.append(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L385_C4", "label": "end_keyword", "type": "function", "loc": [385, 389], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L301_C0", "vector": [2, 1, 0.7963, 0.0103, 1, 0.17, 0.7368, 959, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "end_keyword", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end_keyword(self):\n self._current_place.pop()\n self._kw_index.pop()\n if self._split_tests and self._current_place[-1][0] == 'test':\n self._current_texts = self._main_text_cache"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L386_C8", "label": "pop()", "type": "expression", "loc": [386, 386], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L385_C4", "vector": [8, 2, 0.7942, 0.0021, 2, 0.16, 0.0, 969, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pop", "arg_names": [], "import_names": [], "rhs_call_name": "pop", "annotation": ""}, "snippet": " self._current_place.pop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L387_C8", "label": "pop()", "type": "expression", "loc": [387, 387], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L385_C4", "vector": [8, 2, 0.7963, 0.0021, 2, 0.16, 0.5, 969, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pop", "arg_names": [], "import_names": [], "rhs_call_name": "pop", "annotation": ""}, "snippet": " self._kw_index.pop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L388_C8", "label": "if", "type": "if", "loc": [388, 389], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L385_C4", "vector": [4, 2, 0.7994, 0.0041, 2, 0.16, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._split_tests and self._current_place[-1][0] == 'test':\n self._current_texts = self._main_text_cache"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L389_C12", "label": "self._current_texts =", "type": "assigned_variable", "loc": [389, 389], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L388_C8", "vector": [14, 3, 0.8004, 0.0021, 3, 0.0, 0.0, 989, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._current_texts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._current_texts = self._main_text_cache"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L391_C4", "label": "create_link_to_current_location", "type": "function", "loc": [391, 392], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L301_C0", "vector": [2, 1, 0.8056, 0.0041, 1, 0.17, 0.7895, 229, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "create_link_to_current_location", "arg_names": ["self", "key"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def create_link_to_current_location(self, key):\n self._links[tuple(key)] = self._create_link()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L392_C8", "label": " = _create_link()", "type": "assigned_variable", "loc": [392, 392], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L391_C4", "vector": [14, 2, 0.8066, 0.0021, 2, 0.44, 0.0, 0, 3, 0, 0, 0, 551, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "_create_link", "annotation": ""}, "snippet": " self._links[tuple(key)] = self._create_link()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L394_C4", "label": "_create_link", "type": "function", "loc": [394, 395], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L301_C0", "vector": [2, 1, 0.8117, 0.0041, 1, 0.17, 0.8421, 551, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "_create_link", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _create_link(self):\n return \"keyword_\"+\".\".join(str(v) for _, v in self._current_place)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L395_C8", "label": "return", "type": "return", "loc": [395, 395], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L394_C4", "vector": [13, 2, 0.8128, 0.0021, 2, 0.03, 0.0, 0, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return \"keyword_\"+\".\".join(str(v) for _, v in self._current_place)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L397_C4", "label": "link_to", "type": "function", "loc": [397, 398], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L301_C0", "vector": [2, 1, 0.8179, 0.0041, 1, 0.17, 0.8947, 658, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "link_to", "arg_names": ["self", "key"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def link_to(self, key):\n return self._links[tuple(key)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L398_C8", "label": "return", "type": "return", "loc": [398, 398], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L397_C4", "vector": [13, 2, 0.8189, 0.0021, 2, 0.73, 0.0, 0, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._links[tuple(key)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L400_C4", "label": "add_test", "type": "function", "loc": [400, 401], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L301_C0", "vector": [2, 1, 0.8241, 0.0041, 1, 0.17, 0.9474, 653, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "add_test", "arg_names": ["self", "critical", "passed"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add_test(self, critical, passed):\n self._stats.add_test(critical, passed)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L401_C8", "label": "add_test()", "type": "expression", "loc": [401, 401], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L400_C4", "vector": [8, 2, 0.8251, 0.0021, 2, 0.8, 0.0, 653, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "add_test", "arg_names": [], "import_names": [], "rhs_call_name": "add_test", "annotation": ""}, "snippet": " self._stats.add_test(critical, passed)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L403_C4", "label": "teardown_failed", "type": "function", "loc": [403, 404], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L301_C0", "vector": [2, 1, 0.8302, 0.0041, 1, 0.17, 1.0, 218, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "teardown_failed", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def teardown_failed(self):\n self._stats.fail_all()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L404_C8", "label": "fail_all()", "type": "expression", "loc": [404, 404], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L403_C4", "vector": [8, 2, 0.8313, 0.0021, 2, 0.13, 0.0, 181, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "fail_all", "arg_names": [], "import_names": [], "rhs_call_name": "fail_all", "annotation": ""}, "snippet": " self._stats.fail_all()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L407_C0", "label": "Stats", "type": "class", "loc": [407, 441], "level": 0, "parent": null, "vector": [3, 0, 0.8724, 0.072, 0, 0.66, 0.875, 458, 0, 5, 0, 0, 186, 0, 4], "semantic": {"name": "Stats", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Stats(object):\n TOTAL = 0\n TOTAL_PASSED = 1\n CRITICAL = 2\n CRITICAL_PASSED = 3\n\n def __init__(self, parent=None):\n self.parent = parent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L408_C4", "label": "TOTAL =", "type": "assigned_variable", "loc": [408, 408], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L407_C0", "vector": [14, 1, 0.8395, 0.0021, 1, 0.77, 0.0, 923, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "TOTAL", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " TOTAL = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L409_C4", "label": "TOTAL_PASSED =", "type": "assigned_variable", "loc": [409, 409], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L407_C0", "vector": [14, 1, 0.8416, 0.0021, 1, 0.77, 0.125, 740, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "TOTAL_PASSED", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " TOTAL_PASSED = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L410_C4", "label": "CRITICAL =", "type": "assigned_variable", "loc": [410, 410], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L407_C0", "vector": [14, 1, 0.8436, 0.0021, 1, 0.77, 0.25, 702, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "CRITICAL", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " CRITICAL = 2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L411_C4", "label": "CRITICAL_PASSED =", "type": "assigned_variable", "loc": [411, 411], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L407_C0", "vector": [14, 1, 0.8457, 0.0021, 1, 0.77, 0.375, 322, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "CRITICAL_PASSED", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " CRITICAL_PASSED = 3"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L413_C4", "label": "__init__", "type": "function", "loc": [413, 416], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L407_C0", "vector": [2, 1, 0.8529, 0.0082, 1, 0.77, 0.5, 555, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "parent"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, parent=None):\n self.parent = parent\n self._stats = [0,0,0,0]\n self._children = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L414_C8", "label": "self.parent =", "type": "assigned_variable", "loc": [414, 414], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L413_C4", "vector": [14, 2, 0.8519, 0.0021, 2, 0.43, 0.0, 428, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.parent", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.parent = parent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L415_C8", "label": "self._stats =", "type": "assigned_variable", "loc": [415, 415], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L413_C4", "vector": [14, 2, 0.8539, 0.0021, 2, 0.43, 0.5, 540, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self._stats", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._stats = [0,0,0,0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L416_C8", "label": "self._children =", "type": "assigned_variable", "loc": [416, 416], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L413_C4", "vector": [14, 2, 0.856, 0.0021, 2, 0.43, 1.0, 365, 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_99885:FunctionDef_L418_C4", "label": "new_child", "type": "function", "loc": [418, 420], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L407_C0", "vector": [2, 1, 0.8621, 0.0062, 1, 0.77, 0.625, 634, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "new_child", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def new_child(self):\n self._children.append(Stats(self))\n return self._children[-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L419_C8", "label": "append()", "type": "expression", "loc": [419, 419], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L418_C4", "vector": [8, 2, 0.8621, 0.0021, 2, 0.72, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self._children.append(Stats(self))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L420_C8", "label": "return", "type": "return", "loc": [420, 420], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L418_C4", "vector": [13, 2, 0.8642, 0.0021, 2, 0.72, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._children[-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L422_C4", "label": "add_test", "type": "function", "loc": [422, 429], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L407_C0", "vector": [2, 1, 0.8755, 0.0165, 1, 0.77, 0.75, 653, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "add_test", "arg_names": ["self", "critical", "passed"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add_test(self, critical, passed):\n self._stats[Stats.TOTAL] += 1\n if passed:\n self._stats[Stats.TOTAL_PASSED] +=1\n if critical:\n self._stats[Stats.CRITICAL] += 1\n if passed:\n self._stats[Stats.CRITICAL_PASSED] += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L424_C8", "label": "if", "type": "if", "loc": [424, 425], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L422_C4", "vector": [4, 2, 0.8735, 0.0041, 2, 0.18, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if passed:\n self._stats[Stats.TOTAL_PASSED] +=1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L426_C8", "label": "if", "type": "if", "loc": [426, 429], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L422_C4", "vector": [4, 2, 0.8796, 0.0082, 2, 0.18, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if critical:\n self._stats[Stats.CRITICAL] += 1\n if passed:\n self._stats[Stats.CRITICAL_PASSED] += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L428_C12", "label": "if", "type": "if", "loc": [428, 429], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L426_C8", "vector": [4, 3, 0.8817, 0.0041, 3, 0.23, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if passed:\n self._stats[Stats.CRITICAL_PASSED] += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L431_C4", "label": "dump", "type": "function", "loc": [431, 435], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L407_C0", "vector": [2, 1, 0.8909, 0.0103, 1, 0.77, 0.875, 952, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "dump", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def dump(self):\n if self.parent:\n for i in range(4):\n self.parent._stats[i] += self._stats[i]\n return self._stats"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L432_C8", "label": "if", "type": "if", "loc": [432, 434], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L431_C4", "vector": [4, 2, 0.8909, 0.0062, 2, 0.59, 0.0, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.parent:\n for i in range(4):\n self.parent._stats[i] += self._stats[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:For_L433_C12", "label": "for i", "type": "for", "loc": [433, 434], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L432_C8", "vector": [6, 3, 0.892, 0.0041, 3, 0.6, 0.0, 826, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in range(4):\n self.parent._stats[i] += self._stats[i]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L435_C8", "label": "return", "type": "return", "loc": [435, 435], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L431_C4", "vector": [13, 2, 0.8951, 0.0021, 2, 0.59, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._stats"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L437_C4", "label": "fail_all", "type": "function", "loc": [437, 441], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L407_C0", "vector": [2, 1, 0.9033, 0.0103, 1, 0.77, 1.0, 181, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "fail_all", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def fail_all(self):\n self._stats[1] = 0\n self._stats[3] = 0\n for child in self._children:\n child.fail_all()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L438_C8", "label": "assign", "type": "assigned_variable", "loc": [438, 438], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L437_C4", "vector": [14, 2, 0.9012, 0.0021, 2, 0.0, 0.0, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._stats[1] = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L439_C8", "label": "assign", "type": "assigned_variable", "loc": [439, 439], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L437_C4", "vector": [14, 2, 0.9033, 0.0021, 2, 0.0, 0.5, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._stats[3] = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:For_L440_C8", "label": "for child", "type": "for", "loc": [440, 441], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L437_C4", "vector": [6, 2, 0.9064, 0.0041, 2, 0.0, 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 child.fail_all()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L441_C12", "label": "fail_all()", "type": "expression", "loc": [441, 441], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:For_L440_C8", "vector": [8, 3, 0.9074, 0.0021, 3, 0.17, 0.0, 181, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "fail_all", "arg_names": [], "import_names": [], "rhs_call_name": "fail_all", "annotation": ""}, "snippet": " child.fail_all()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L443_C0", "label": "TextIndex", "type": "class", "loc": [443, 444], "level": 0, "parent": null, "vector": [3, 0, 0.9126, 0.0041, 0, 0.66, 0.9167, 892, 0, 0, 0, 0, 901, 0, 0], "semantic": {"name": "TextIndex", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class TextIndex(int):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L446_C0", "label": "ZERO_TEXT_INDEX = TextIndex()", "type": "assigned_variable", "loc": [446, 446], "level": 0, "parent": null, "vector": [14, 0, 0.9177, 0.0021, 0, 0.66, 0.9583, 566, 3, 1, 0, 0, 892, 10, 1], "semantic": {"name": "ZERO_TEXT_INDEX", "arg_names": [], "import_names": [], "rhs_call_name": "TextIndex", "annotation": ""}, "snippet": "ZERO_TEXT_INDEX = TextIndex(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L448_C0", "label": "TextCache", "type": "class", "loc": [448, 485], "level": 0, "parent": null, "vector": [3, 0, 0.9599, 0.0782, 0, 0.66, 1.0, 268, 0, 6, 0, 0, 186, 0, 13], "semantic": {"name": "TextCache", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class TextCache(object):\n # TODO: Tune compressing thresholds\n _compress_threshold = 20\n _use_compressed_threshold = 1.1\n\n def __init__(self):\n self.texts = {'*': ZERO_TEXT_INDEX}\n self.index = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L450_C4", "label": "_compress_threshold =", "type": "assigned_variable", "loc": [450, 450], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L448_C0", "vector": [14, 1, 0.9259, 0.0021, 1, 0.84, 0.0, 528, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "_compress_threshold", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _compress_threshold = 20"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L451_C4", "label": "_use_compressed_threshold =", "type": "assigned_variable", "loc": [451, 451], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L448_C0", "vector": [14, 1, 0.928, 0.0021, 1, 0.84, 0.1429, 655, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "_use_compressed_threshold", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _use_compressed_threshold = 1.1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L453_C4", "label": "__init__", "type": "function", "loc": [453, 455], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L448_C0", "vector": [2, 1, 0.9342, 0.0062, 1, 0.84, 0.2857, 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.texts = {'*': ZERO_TEXT_INDEX}\n self.index = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L454_C8", "label": "self.texts =", "type": "assigned_variable", "loc": [454, 454], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L453_C4", "vector": [14, 2, 0.9342, 0.0021, 2, 0.49, 0.0, 798, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.texts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.texts = {'*': ZERO_TEXT_INDEX}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L455_C8", "label": "self.index =", "type": "assigned_variable", "loc": [455, 455], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L453_C4", "vector": [14, 2, 0.9362, 0.0021, 2, 0.49, 1.0, 777, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.index", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.index = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L457_C4", "label": "add", "type": "function", "loc": [457, 464], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L448_C0", "vector": [2, 1, 0.9475, 0.0165, 1, 0.84, 0.4286, 241, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "add", "arg_names": ["self", "text"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add(self, text):\n if not text:\n return 0\n text = self._encode(text)\n if text not in self.texts:\n self.texts[text] = TextIndex(self.index)\n self.index += 1\n return self.texts[text]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L458_C8", "label": "if", "type": "if", "loc": [458, 459], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L457_C4", "vector": [4, 2, 0.9434, 0.0041, 2, 0.97, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not text:\n return 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L459_C12", "label": "return", "type": "return", "loc": [459, 459], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L458_C8", "vector": [13, 3, 0.9444, 0.0021, 3, 0.31, 0.0, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L460_C8", "label": "text = _encode()", "type": "assigned_variable", "loc": [460, 460], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L457_C4", "vector": [14, 2, 0.9465, 0.0021, 2, 0.97, 0.3333, 439, 3, 1, 0, 0, 242, 10, 1], "semantic": {"name": "text", "arg_names": [], "import_names": [], "rhs_call_name": "_encode", "annotation": ""}, "snippet": " text = self._encode(text)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L461_C8", "label": "if", "type": "if", "loc": [461, 463], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L457_C4", "vector": [4, 2, 0.9506, 0.0062, 2, 0.97, 0.6667, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if text not in self.texts:\n self.texts[text] = TextIndex(self.index)\n self.index += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L462_C12", "label": " = TextIndex()", "type": "assigned_variable", "loc": [462, 462], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L461_C8", "vector": [14, 3, 0.9506, 0.0021, 3, 0.66, 0.0, 0, 3, 1, 0, 0, 892, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "TextIndex", "annotation": ""}, "snippet": " self.texts[text] = TextIndex(self.index)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L464_C8", "label": "return", "type": "return", "loc": [464, 464], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L457_C4", "vector": [13, 2, 0.9547, 0.0021, 2, 0.97, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.texts[text]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L466_C4", "label": "_encode", "type": "function", "loc": [466, 473], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L448_C0", "vector": [2, 1, 0.966, 0.0165, 1, 0.84, 0.5714, 242, 0, 2, 1, 0, 0, 0, 5], "semantic": {"name": "_encode", "arg_names": ["self", "text"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _encode(self, text):\n raw = self._raw(text)\n if raw in self.texts or len(raw) < self._compress_threshold:\n return raw\n compressed = self._compress(text)\n if len(compressed) * self._use_compressed_threshold < len(raw):\n return compressed\n return raw"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L467_C8", "label": "raw = _raw()", "type": "assigned_variable", "loc": [467, 467], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L466_C4", "vector": [14, 2, 0.9609, 0.0021, 2, 0.02, 0.0, 23, 3, 1, 0, 0, 628, 10, 1], "semantic": {"name": "raw", "arg_names": [], "import_names": [], "rhs_call_name": "_raw", "annotation": ""}, "snippet": " raw = self._raw(text)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L468_C8", "label": "if", "type": "if", "loc": [468, 469], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L466_C4", "vector": [4, 2, 0.964, 0.0041, 2, 0.02, 0.25, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if raw in self.texts or len(raw) < self._compress_threshold:\n return raw"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L469_C12", "label": "return", "type": "return", "loc": [469, 469], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L468_C8", "vector": [13, 3, 0.965, 0.0021, 3, 0.93, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return raw"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L470_C8", "label": "compressed = _compress()", "type": "assigned_variable", "loc": [470, 470], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L466_C4", "vector": [14, 2, 0.9671, 0.0021, 2, 0.02, 0.5, 709, 3, 1, 0, 0, 569, 10, 1], "semantic": {"name": "compressed", "arg_names": [], "import_names": [], "rhs_call_name": "_compress", "annotation": ""}, "snippet": " compressed = self._compress(text)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L471_C8", "label": "if", "type": "if", "loc": [471, 472], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L466_C4", "vector": [4, 2, 0.9702, 0.0041, 2, 0.02, 0.75, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(compressed) * self._use_compressed_threshold < len(raw):\n return compressed"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L472_C12", "label": "return", "type": "return", "loc": [472, 472], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L471_C8", "vector": [13, 3, 0.9712, 0.0021, 3, 0.95, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return compressed"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L473_C8", "label": "return", "type": "return", "loc": [473, 473], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L466_C4", "vector": [13, 2, 0.9733, 0.0021, 2, 0.02, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return raw"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L475_C4", "label": "_compress", "type": "function", "loc": [475, 476], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L448_C0", "vector": [2, 1, 0.9784, 0.0041, 1, 0.84, 0.7143, 569, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "_compress", "arg_names": ["self", "text"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _compress(self, text):\n return base64.b64encode(zlib.compress(text.encode('UTF-8'), 9))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L476_C8", "label": "return", "type": "return", "loc": [476, 476], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L475_C4", "vector": [13, 2, 0.9794, 0.0021, 2, 0.02, 0.0, 0, 3, 0, 0, 0, 0, 10, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return base64.b64encode(zlib.compress(text.encode('UTF-8'), 9))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L478_C4", "label": "_raw", "type": "function", "loc": [478, 479], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L448_C0", "vector": [2, 1, 0.9846, 0.0041, 1, 0.84, 0.8571, 628, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "_raw", "arg_names": ["self", "text"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _raw(self, text):\n return '*'+text"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L479_C8", "label": "return", "type": "return", "loc": [479, 479], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L478_C4", "vector": [13, 2, 0.9856, 0.0021, 2, 0.01, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '*'+text"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L481_C4", "label": "dump", "type": "function", "loc": [481, 485], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L448_C0", "vector": [2, 1, 0.9938, 0.0103, 1, 0.84, 1.0, 952, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "dump", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def dump(self):\n # TODO: Could we yield or return an iterator?\n # TODO: Duplicate with IntegerCache.dump\n return [item[0] for item in sorted(self.texts.iteritems(),\n key=itemgetter(1))]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L484_C8", "label": "return", "type": "return", "loc": [484, 485], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L481_C4", "vector": [13, 2, 0.9969, 0.0041, 2, 0.75, 0.0, 0, 5, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [item[0] for item in sorted(self.texts.iteritems(),\n key=itemgetter(1))]"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L62_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L70_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L72_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L72_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L70_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L76_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L85_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L87_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L95_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L85_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L98_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L98_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L99_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L98_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L104_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L85_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L106_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L106_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L85_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L109_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L110_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L115_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L118_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L120_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L121_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L122_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L123_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L124_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L125_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L126_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L118_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L128_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L128_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L129_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L129_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L131_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L128_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L132_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L128_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L135_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L118_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L137_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L137_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L138_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L118_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L140_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L140_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L142_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L140_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L143_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L140_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L144_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L140_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L145_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L140_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L146_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L149_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L151_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L152_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L153_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L154_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L155_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L155_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L155_C32"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L156_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L157_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L158_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L159_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L160_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L149_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L162_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L162_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L163_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L163_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L165_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L162_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L166_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L162_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L170_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L149_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L172_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L172_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L173_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L149_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L175_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L175_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L176_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L176_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L177_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L175_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L178_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L175_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L180_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L175_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L181_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L186_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L188_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L188_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L189_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L192_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L194_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L194_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L195_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L194_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L196_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L194_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L197_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L194_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L198_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L194_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L199_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L199_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L200_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L192_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L204_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L204_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L205_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L204_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L206_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L209_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L211_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L211_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L212_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L211_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L213_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L211_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L214_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L211_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L215_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L209_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L217_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L217_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L218_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L217_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L220_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L220_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L221_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L217_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L223_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L209_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L225_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L226_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L227_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L227_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L228_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L229_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L232_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L234_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L234_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L235_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L238_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L240_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L240_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L241_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L244_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L246_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L246_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L247_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L250_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L252_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L252_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L253_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L256_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L258_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L258_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L259_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L258_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L260_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L256_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L262_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L262_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L263_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L256_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L265_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L265_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L266_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L269_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L271_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L271_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L272_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L271_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L273_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L269_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L275_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L275_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L276_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L279_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L281_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L281_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L282_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L281_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L283_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L281_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L285_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L281_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L286_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L279_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L288_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L288_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L289_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L288_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L290_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L288_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L291_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L279_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L293_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L293_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L295_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L295_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L296_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L295_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L297_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L297_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L298_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L301_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L303_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L303_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L304_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L303_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L305_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L303_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L306_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L303_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L307_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L303_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L308_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L303_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L309_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L303_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L310_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L303_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L311_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L303_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L312_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L303_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L313_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L301_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L316_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L316_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L317_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L301_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L320_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L320_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L321_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L301_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L323_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L323_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L324_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L323_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L325_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L301_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L327_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L327_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Try_L328_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:Try_L328_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L329_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:Try_L328_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L331_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L301_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L333_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L333_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L334_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L334_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L335_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L333_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L336_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L336_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L337_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L333_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L338_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L338_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L339_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L301_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L342_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L342_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L343_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L301_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L345_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L345_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L346_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L301_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L348_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L348_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L349_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L349_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L350_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L348_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L351_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L348_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L352_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L352_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L353_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L348_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L354_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L301_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L356_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L356_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L357_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L356_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L358_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L301_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L360_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L360_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L361_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L360_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L362_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L301_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L364_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L364_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L365_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L365_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L366_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L364_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L367_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L364_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L368_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L301_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L370_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L370_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L371_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L370_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L372_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L370_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L373_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L373_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L374_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L373_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L375_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L370_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L376_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L301_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L378_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L378_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L379_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L379_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L380_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L378_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L381_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L378_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L383_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L301_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L385_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L385_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L386_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L385_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L387_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L385_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L388_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L388_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L389_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L301_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L391_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L391_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L392_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L301_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L394_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L394_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L395_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L301_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L397_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L397_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L398_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L301_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L400_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L400_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L401_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L301_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L403_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L403_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L404_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L407_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L408_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L407_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L409_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L407_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L410_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L407_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L411_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L407_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L413_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L413_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L414_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L413_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L415_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L413_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L416_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L407_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L418_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L418_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L419_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L418_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L420_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L407_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L422_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L422_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L424_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L422_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L426_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L426_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L428_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L407_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L431_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L431_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L432_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L432_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:For_L433_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L431_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L435_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L407_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L437_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L437_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L438_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L437_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L439_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L437_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:For_L440_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:For_L440_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Expr_L441_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L448_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L450_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L448_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L451_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L448_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L453_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L453_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L454_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L453_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L455_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L448_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L457_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L457_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L458_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L458_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L459_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L457_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L460_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L457_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L461_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L461_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L462_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L457_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L464_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L448_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L466_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L466_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L467_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L466_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L468_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L468_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L469_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L466_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Assign_L470_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L466_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L471_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:If_L471_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L472_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L466_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L473_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L448_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L475_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L475_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L476_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L448_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L478_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L478_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L479_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:ClassDef_L448_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L481_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99885:FunctionDef_L481_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99885:Return_L484_C8"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import time
from robot import utils
import json
from robot.result.elementhandlers import TextIndex
# TODO: Rename to match the responsibility - this isn't really a model but a class writing model to outputs
class DataModel(object):
def __init__(self, robot_data, split_results=None):
self._robot_data = robot_data
self._split_results = split_results
self._settings = None
self._set_generated(time.localtime())
def _set_generated(self, timetuple):
genMillis = long(time.mktime(timetuple) * 1000) -\
self._robot_data['baseMillis']
self._set_attr('generatedMillis', genMillis)
self._set_attr('generatedTimestamp',
utils.format_time(timetuple, gmtsep=' '))
def _set_attr(self, name, value):
self._robot_data[name] = value
def set_settings(self, settings):
self._settings = settings
def write_to(self, output, separator='', split_threshold=9500):
writer = _SeparatingWriter(output, separator)
writer.write('window.output = {};\n')
writer.separator()
for key, value in self._robot_data.items():
self._write_output_element(key, split_threshold, value, writer)
writer.separator()
writer.dump_json('window.settings = ', self._settings)
def _write_output_element(self, key, split_threshold, value, writer):
if key == 'suite':
splitWriter = SplittingSuiteWriter(writer, split_threshold)
data, mapping = splitWriter.write(self._robot_data['suite'])
writer.dump_json('window.output["suite"] = ', data, mapping=mapping)
elif key == 'strings':
self._dump_and_split_strings(split_threshold, writer)
else:
writer.dump_json('window.output["%s"] = ' % key, value)
def _dump_and_split_strings(self, split_threshold, writer):
strings = self._robot_data['strings']
writer.write('window.output["strings"] = [];\n')
while strings:
writer.separator()
writer.dump_json('window.output["strings"] = window.output["strings"].concat(', strings[:split_threshold], ');\n')
strings = strings[split_threshold:]
def remove_keywords(self):
self._robot_data['suite'] = self._remove_keywords_from(self._robot_data['suite'])
self._prune_unused_indices()
# TODO: this and remove_keywords should be removed
# instead there should be a reportify or write_for_report_to method
def remove_errors(self):
self._robot_data.pop('errors')
def _remove_keywords_from(self, data):
if not isinstance(data, list):
return data
return [self._remove_keywords_from(item) for item in data
if not self._is_ignorable_keyword(item)]
def _is_ignorable_keyword(self, item):
# Top level teardown is kept to make tests fail if suite teardown failed
# TODO: Could we store information about failed suite teardown otherwise?
# TODO: Cleanup?
return item and \
isinstance(item, list) and \
(isinstance(item[0], TextIndex)) and \
self._robot_data['strings'][item[0]] in \
['*kw', '*setup', '*forloop', '*foritem']
def _prune_unused_indices(self):
used = self._collect_used_indices(self._robot_data['suite'], set())
remap = {}
self._robot_data['strings'] = \
list(self._prune(self._robot_data['strings'], used, remap))
self._remap_indices(self._robot_data['suite'], remap)
def _prune(self, data, used, index_remap, map_index=None, offset_increment=1):
offset = 0
for index, text in enumerate(data):
index = map_index(index) if map_index else index
if index in used:
index_remap[index] = index - offset
yield text
else:
offset += offset_increment
def _remap_indices(self, data, remap):
for i, item in enumerate(data):
if isinstance(item, TextIndex):
data[i] = remap[item]
elif isinstance(item, list):
self._remap_indices(item, remap)
def _collect_used_indices(self, data, result):
for item in data:
if isinstance(item, (int, long)):
result.add(item)
elif isinstance(item, list):
self._collect_used_indices(item, result)
elif isinstance(item, dict):
self._collect_used_indices(item.values(), result)
self._collect_used_indices(item.keys(), result)
return result
class _SeparatingWriter(object):
def __init__(self, output, separator):
self._output = output
self._separator = separator
def separator(self):
self._output.write(self._separator)
def dump_json(self, prefix, data_block, postfix = ';\n', mapping=None):
if prefix:
self._output.write(prefix)
json.json_dump(data_block, self._output, mappings=mapping)
self._output.write(postfix)
def write(self, string):
self._output.write(string)
class _SubResult(object):
def __init__(self, data_block, size, mapping):
self.data_block = data_block
self.size = size
self.mapping = mapping
def update(self, subresult):
self.data_block += [subresult.data_block]
self.size += subresult.size
if subresult.mapping:
self.mapping.update(subresult.mapping)
def link(self, name):
key = object()
return _SubResult(key, 1, {key:name})
class SplittingSuiteWriter(object):
def __init__(self, writer, split_threshold):
self._index = 0
self._writer = writer
self._split_threshold = split_threshold
def write(self, data_block):
result = self._write(data_block)
return result.data_block, result.mapping
def _write(self, data_block):
if not isinstance(data_block, list):
return _SubResult(data_block, 1, None)
result = _SubResult([], 1, {})
for item in data_block:
result.update(self._write(item))
if result.size > self._split_threshold:
result = self._dump_suite_part(result)
return result
def _list_name(self):
return 'window.sPart%s' % self._index
def _dump_suite_part(self, result):
self._writer.dump_json(self._list_name()+' = ', result.data_block, mapping=result.mapping)
self._writer.separator()
new_result = result.link(self._list_name())
self._index += 1
return new_result
| ajibawa-2023/Python-Code-Large/train/row_99887 | 128 | 196 | 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_99887:Import_L15_C0", "label": "time import time", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.0765, 0.0051, 0, 0.66, 0.0, 654, 0, 1, 0, 0, 654, 0, 0], "semantic": {"name": "time", "arg_names": [], "import_names": ["time"], "rhs_call_name": "", "annotation": ""}, "snippet": "import time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:ImportFrom_L16_C0", "label": "from robot import utils", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.0816, 0.0051, 0, 0.66, 0.1429, 735, 0, 1, 0, 0, 735, 0, 0], "semantic": {"name": "robot", "arg_names": [], "import_names": ["utils"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot import utils"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Import_L18_C0", "label": "json import json", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.0918, 0.0051, 0, 0.66, 0.2857, 463, 0, 1, 0, 0, 463, 0, 0], "semantic": {"name": "json", "arg_names": [], "import_names": ["json"], "rhs_call_name": "", "annotation": ""}, "snippet": "import json"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:ImportFrom_L19_C0", "label": "from robot.result.elementhandlers import TextIndex", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.0969, 0.0051, 0, 0.66, 0.4286, 520, 0, 1, 0, 0, 520, 0, 0], "semantic": {"name": "robot.result.elementhandlers", "arg_names": [], "import_names": ["TextIndex"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot.result.elementhandlers import TextIndex"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:ClassDef_L23_C0", "label": "DataModel", "type": "class", "loc": [23, 129], "level": 0, "parent": null, "vector": [3, 0, 0.3878, 0.5459, 0, 0.66, 0.5714, 263, 0, 15, 0, 0, 186, 0, 50], "semantic": {"name": "DataModel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class DataModel(object):\n\n def __init__(self, robot_data, split_results=None):\n self._robot_data = robot_data\n self._split_results = split_results\n self._settings = None\n self._set_generated(time.localtime())\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L25_C4", "label": "__init__", "type": "function", "loc": [25, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:ClassDef_L23_C0", "vector": [2, 1, 0.1378, 0.0255, 1, 0.25, 0.0, 555, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "robot_data", "split_results"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, robot_data, split_results=None):\n self._robot_data = robot_data\n self._split_results = split_results\n self._settings = None\n self._set_generated(time.localtime())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Assign_L26_C8", "label": "self._robot_data =", "type": "assigned_variable", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L25_C4", "vector": [14, 2, 0.1327, 0.0051, 2, 0.97, 0.0, 644, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._robot_data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._robot_data = robot_data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Assign_L27_C8", "label": "self._split_results =", "type": "assigned_variable", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L25_C4", "vector": [14, 2, 0.1378, 0.0051, 2, 0.97, 0.3333, 225, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._split_results", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._split_results = split_results"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Assign_L28_C8", "label": "self._settings =", "type": "assigned_variable", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L25_C4", "vector": [14, 2, 0.1429, 0.0051, 2, 0.97, 0.6667, 417, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self._settings", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._settings = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Expr_L29_C8", "label": "_set_generated()", "type": "expression", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L25_C4", "vector": [8, 2, 0.148, 0.0051, 2, 0.97, 1.0, 132, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "_set_generated", "arg_names": [], "import_names": [], "rhs_call_name": "_set_generated", "annotation": ""}, "snippet": " self._set_generated(time.localtime())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L31_C4", "label": "_set_generated", "type": "function", "loc": [31, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:ClassDef_L23_C0", "vector": [2, 1, 0.1709, 0.0306, 1, 0.25, 0.0714, 132, 0, 2, 0, 0, 0, 0, 5], "semantic": {"name": "_set_generated", "arg_names": ["self", "timetuple"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _set_generated(self, timetuple):\n genMillis = long(time.mktime(timetuple) * 1000) -\\\n self._robot_data['baseMillis']\n self._set_attr('generatedMillis', genMillis)\n self._set_attr('generatedTimestamp',\n utils.format_time(timetuple, gmtsep=' '))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Assign_L32_C8", "label": "genMillis =", "type": "assigned_variable", "loc": [32, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L31_C4", "vector": [14, 2, 0.1658, 0.0102, 2, 0.25, 0.0, 857, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "genMillis", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " genMillis = long(time.mktime(timetuple) * 1000) -\\\n self._robot_data['baseMillis']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Expr_L34_C8", "label": "_set_attr()", "type": "expression", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L31_C4", "vector": [8, 2, 0.1735, 0.0051, 2, 0.25, 0.5, 995, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_set_attr", "arg_names": [], "import_names": [], "rhs_call_name": "_set_attr", "annotation": ""}, "snippet": " self._set_attr('generatedMillis', genMillis)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Expr_L35_C8", "label": "_set_attr()", "type": "expression", "loc": [35, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L31_C4", "vector": [8, 2, 0.1811, 0.0102, 2, 0.25, 1.0, 995, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "_set_attr", "arg_names": [], "import_names": [], "rhs_call_name": "_set_attr", "annotation": ""}, "snippet": " self._set_attr('generatedTimestamp',\n utils.format_time(timetuple, gmtsep=' '))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L38_C4", "label": "_set_attr", "type": "function", "loc": [38, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:ClassDef_L23_C0", "vector": [2, 1, 0.1964, 0.0102, 1, 0.25, 0.1429, 995, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "_set_attr", "arg_names": ["self", "name", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _set_attr(self, name, value):\n self._robot_data[name] = value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Assign_L39_C8", "label": "assign", "type": "assigned_variable", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L38_C4", "vector": [14, 2, 0.199, 0.0051, 2, 0.04, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._robot_data[name] = value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L41_C4", "label": "set_settings", "type": "function", "loc": [41, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:ClassDef_L23_C0", "vector": [2, 1, 0.2117, 0.0102, 1, 0.25, 0.2143, 759, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "set_settings", "arg_names": ["self", "settings"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_settings(self, settings):\n self._settings = settings"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Assign_L42_C8", "label": "self._settings =", "type": "assigned_variable", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L41_C4", "vector": [14, 2, 0.2143, 0.0051, 2, 0.25, 0.0, 417, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._settings", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._settings = settings"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L44_C4", "label": "write_to", "type": "function", "loc": [44, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:ClassDef_L23_C0", "vector": [2, 1, 0.2423, 0.0408, 1, 0.25, 0.2857, 739, 0, 4, 0, 0, 0, 0, 7], "semantic": {"name": "write_to", "arg_names": ["self", "output", "separator", "split_threshold"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def write_to(self, output, separator='', split_threshold=9500):\n writer = _SeparatingWriter(output, separator)\n writer.write('window.output = {};\\n')\n writer.separator()\n for key, value in self._robot_data.items():\n self._write_output_element(key, split_threshold, value, writer)\n writer.separator()\n writer.dump_json('window.settings = ', self._settings)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Assign_L45_C8", "label": "writer = _SeparatingWriter()", "type": "assigned_variable", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L44_C4", "vector": [14, 2, 0.2296, 0.0051, 2, 0.63, 0.0, 614, 3, 2, 0, 0, 206, 10, 1], "semantic": {"name": "writer", "arg_names": [], "import_names": [], "rhs_call_name": "_SeparatingWriter", "annotation": ""}, "snippet": " writer = _SeparatingWriter(output, separator)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Expr_L46_C8", "label": "write()", "type": "expression", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L44_C4", "vector": [8, 2, 0.2347, 0.0051, 2, 0.63, 0.25, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " writer.write('window.output = {};\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Expr_L47_C8", "label": "separator()", "type": "expression", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L44_C4", "vector": [8, 2, 0.2398, 0.0051, 2, 0.63, 0.5, 539, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "separator", "arg_names": [], "import_names": [], "rhs_call_name": "separator", "annotation": ""}, "snippet": " writer.separator()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:For_L48_C8", "label": "for key, value", "type": "for", "loc": [48, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L44_C4", "vector": [6, 2, 0.25, 0.0153, 2, 0.63, 0.75, 839, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "key, value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for key, value in self._robot_data.items():\n self._write_output_element(key, split_threshold, value, writer)\n writer.separator()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Expr_L49_C12", "label": "_write_output_element()", "type": "expression", "loc": [49, 49], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:For_L48_C8", "vector": [8, 3, 0.25, 0.0051, 3, 0.18, 0.0, 731, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "_write_output_element", "arg_names": [], "import_names": [], "rhs_call_name": "_write_output_element", "annotation": ""}, "snippet": " self._write_output_element(key, split_threshold, value, writer)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Expr_L50_C12", "label": "separator()", "type": "expression", "loc": [50, 50], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:For_L48_C8", "vector": [8, 3, 0.2551, 0.0051, 3, 0.18, 1.0, 539, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "separator", "arg_names": [], "import_names": [], "rhs_call_name": "separator", "annotation": ""}, "snippet": " writer.separator()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Expr_L51_C8", "label": "dump_json()", "type": "expression", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L44_C4", "vector": [8, 2, 0.2602, 0.0051, 2, 0.63, 1.0, 425, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "dump_json", "arg_names": [], "import_names": [], "rhs_call_name": "dump_json", "annotation": ""}, "snippet": " writer.dump_json('window.settings = ', self._settings)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L53_C4", "label": "_write_output_element", "type": "function", "loc": [53, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:ClassDef_L23_C0", "vector": [2, 1, 0.2908, 0.0459, 1, 0.25, 0.3571, 731, 0, 5, 0, 0, 0, 0, 5], "semantic": {"name": "_write_output_element", "arg_names": ["self", "key", "split_threshold", "value", "writer"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _write_output_element(self, key, split_threshold, value, writer):\n if key == 'suite':\n splitWriter = SplittingSuiteWriter(writer, split_threshold)\n data, mapping = splitWriter.write(self._robot_data['suite'])\n writer.dump_json('window.output[\"suite\"] = ', data, mapping=mapping)\n elif key == 'strings':\n self._dump_and_split_strings(split_threshold, writer)\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:If_L54_C8", "label": "if", "type": "if", "loc": [54, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L53_C4", "vector": [4, 2, 0.2934, 0.0408, 2, 0.5, 0.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if key == 'suite':\n splitWriter = SplittingSuiteWriter(writer, split_threshold)\n data, mapping = splitWriter.write(self._robot_data['suite'])\n writer.dump_json('window.output[\"suite\"] = ', data, mapping=mapping)\n elif key == 'strings':\n self._dump_and_split_strings(split_threshold, writer)\n else:\n writer.dump_json('window.output[\"%s\"] = ' % key, value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Assign_L55_C12", "label": "splitWriter = SplittingSuiteWriter()", "type": "assigned_variable", "loc": [55, 55], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:If_L54_C8", "vector": [14, 3, 0.2806, 0.0051, 3, 0.12, 0.0, 830, 3, 2, 0, 0, 615, 10, 1], "semantic": {"name": "splitWriter", "arg_names": [], "import_names": [], "rhs_call_name": "SplittingSuiteWriter", "annotation": ""}, "snippet": " splitWriter = SplittingSuiteWriter(writer, split_threshold)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Assign_L56_C12", "label": "data, mapping = write()", "type": "assigned_variable", "loc": [56, 56], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:If_L54_C8", "vector": [14, 3, 0.2857, 0.0051, 3, 0.12, 0.3333, 946, 3, 1, 0, 0, 837, 10, 1], "semantic": {"name": "data, mapping", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " data, mapping = splitWriter.write(self._robot_data['suite'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Expr_L57_C12", "label": "dump_json()", "type": "expression", "loc": [57, 57], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:If_L54_C8", "vector": [8, 3, 0.2908, 0.0051, 3, 0.12, 0.6667, 425, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "dump_json", "arg_names": [], "import_names": [], "rhs_call_name": "dump_json", "annotation": ""}, "snippet": " writer.dump_json('window.output[\"suite\"] = ', data, mapping=mapping)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:If_L58_C8", "label": "if", "type": "if", "loc": [58, 61], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:If_L54_C8", "vector": [4, 3, 0.3036, 0.0204, 3, 0.12, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif key == 'strings':\n self._dump_and_split_strings(split_threshold, writer)\n else:\n writer.dump_json('window.output[\"%s\"] = ' % key, value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Expr_L59_C12", "label": "_dump_and_split_strings()", "type": "expression", "loc": [59, 59], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:If_L58_C8", "vector": [8, 4, 0.301, 0.0051, 4, 0.43, 0.0, 774, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_dump_and_split_strings", "arg_names": [], "import_names": [], "rhs_call_name": "_dump_and_split_strings", "annotation": ""}, "snippet": " self._dump_and_split_strings(split_threshold, writer)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Expr_L61_C12", "label": "dump_json()", "type": "expression", "loc": [61, 61], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:If_L58_C8", "vector": [8, 4, 0.3112, 0.0051, 4, 0.43, 1.0, 425, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "dump_json", "arg_names": [], "import_names": [], "rhs_call_name": "dump_json", "annotation": ""}, "snippet": " writer.dump_json('window.output[\"%s\"] = ' % key, value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L63_C4", "label": "_dump_and_split_strings", "type": "function", "loc": [63, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:ClassDef_L23_C0", "vector": [2, 1, 0.3367, 0.0357, 1, 0.25, 0.4286, 774, 0, 3, 0, 0, 0, 0, 3], "semantic": {"name": "_dump_and_split_strings", "arg_names": ["self", "split_threshold", "writer"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _dump_and_split_strings(self, split_threshold, writer):\n strings = self._robot_data['strings']\n writer.write('window.output[\"strings\"] = [];\\n')\n while strings:\n writer.separator()\n writer.dump_json('window.output[\"strings\"] = window.output[\"strings\"].concat(', strings[:split_threshold], ');\\n')\n strings = strings[split_threshold:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Assign_L64_C8", "label": "strings =", "type": "assigned_variable", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L63_C4", "vector": [14, 2, 0.3265, 0.0051, 2, 0.74, 0.0, 109, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "strings", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " strings = self._robot_data['strings']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Expr_L65_C8", "label": "write()", "type": "expression", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L63_C4", "vector": [8, 2, 0.3316, 0.0051, 2, 0.74, 0.5, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " writer.write('window.output[\"strings\"] = [];\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:While_L66_C8", "label": "while", "type": "while", "loc": [66, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L63_C4", "vector": [5, 2, 0.3444, 0.0204, 2, 0.74, 1.0, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while strings:\n writer.separator()\n writer.dump_json('window.output[\"strings\"] = window.output[\"strings\"].concat(', strings[:split_threshold], ');\\n')\n strings = strings[split_threshold:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Expr_L67_C12", "label": "separator()", "type": "expression", "loc": [67, 67], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:While_L66_C8", "vector": [8, 3, 0.3418, 0.0051, 3, 0.67, 0.0, 539, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "separator", "arg_names": [], "import_names": [], "rhs_call_name": "separator", "annotation": ""}, "snippet": " writer.separator()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Expr_L68_C12", "label": "dump_json()", "type": "expression", "loc": [68, 68], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:While_L66_C8", "vector": [8, 3, 0.3469, 0.0051, 3, 0.67, 0.5, 425, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "dump_json", "arg_names": [], "import_names": [], "rhs_call_name": "dump_json", "annotation": ""}, "snippet": " writer.dump_json('window.output[\"strings\"] = window.output[\"strings\"].concat(', strings[:split_threshold], ');\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Assign_L69_C12", "label": "strings =", "type": "assigned_variable", "loc": [69, 69], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:While_L66_C8", "vector": [14, 3, 0.352, 0.0051, 3, 0.67, 1.0, 109, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "strings", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " strings = strings[split_threshold:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L71_C4", "label": "remove_keywords", "type": "function", "loc": [71, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:ClassDef_L23_C0", "vector": [2, 1, 0.3673, 0.0153, 1, 0.25, 0.5, 336, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "remove_keywords", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def remove_keywords(self):\n self._robot_data['suite'] = self._remove_keywords_from(self._robot_data['suite'])\n self._prune_unused_indices()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Assign_L72_C8", "label": " = _remove_keywords_from()", "type": "assigned_variable", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L71_C4", "vector": [14, 2, 0.3673, 0.0051, 2, 0.18, 0.0, 0, 3, 1, 0, 0, 794, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "_remove_keywords_from", "annotation": ""}, "snippet": " self._robot_data['suite'] = self._remove_keywords_from(self._robot_data['suite'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Expr_L73_C8", "label": "_prune_unused_indices()", "type": "expression", "loc": [73, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L71_C4", "vector": [8, 2, 0.3724, 0.0051, 2, 0.18, 1.0, 126, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_prune_unused_indices", "arg_names": [], "import_names": [], "rhs_call_name": "_prune_unused_indices", "annotation": ""}, "snippet": " self._prune_unused_indices()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L77_C4", "label": "remove_errors", "type": "function", "loc": [77, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:ClassDef_L23_C0", "vector": [2, 1, 0.3954, 0.0102, 1, 0.25, 0.5714, 6, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "remove_errors", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def remove_errors(self):\n self._robot_data.pop('errors')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Expr_L78_C8", "label": "pop()", "type": "expression", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L77_C4", "vector": [8, 2, 0.398, 0.0051, 2, 0.23, 0.0, 969, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "pop", "arg_names": [], "import_names": [], "rhs_call_name": "pop", "annotation": ""}, "snippet": " self._robot_data.pop('errors')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L80_C4", "label": "_remove_keywords_from", "type": "function", "loc": [80, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:ClassDef_L23_C0", "vector": [2, 1, 0.4184, 0.0255, 1, 0.25, 0.6429, 794, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "_remove_keywords_from", "arg_names": ["self", "data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _remove_keywords_from(self, data):\n if not isinstance(data, list):\n return data\n return [self._remove_keywords_from(item) for item in data\n if not self._is_ignorable_keyword(item)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:If_L81_C8", "label": "if", "type": "if", "loc": [81, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L80_C4", "vector": [4, 2, 0.4158, 0.0102, 2, 0.49, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not isinstance(data, list):\n return data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Return_L82_C12", "label": "return", "type": "return", "loc": [82, 82], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:If_L81_C8", "vector": [13, 3, 0.4184, 0.0051, 3, 0.84, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Return_L83_C8", "label": "return", "type": "return", "loc": [83, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L80_C4", "vector": [13, 2, 0.426, 0.0102, 2, 0.49, 1.0, 0, 5, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [self._remove_keywords_from(item) for item in data\n if not self._is_ignorable_keyword(item)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L86_C4", "label": "_is_ignorable_keyword", "type": "function", "loc": [86, 94], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:ClassDef_L23_C0", "vector": [2, 1, 0.4592, 0.0459, 1, 0.25, 0.7143, 738, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "_is_ignorable_keyword", "arg_names": ["self", "item"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _is_ignorable_keyword(self, item):\n # Top level teardown is kept to make tests fail if suite teardown failed\n # TODO: Could we store information about failed suite teardown otherwise?\n # TODO: Cleanup?\n return item and \\\n isinstance(item, list) and \\\n (isinstance(item[0], TextIndex)) and \\\n self._robot_data['strings'][item[0]] in \\"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Return_L90_C8", "label": "return", "type": "return", "loc": [90, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L86_C4", "vector": [13, 2, 0.4694, 0.0255, 2, 0.54, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return item and \\\n isinstance(item, list) and \\\n (isinstance(item[0], TextIndex)) and \\\n self._robot_data['strings'][item[0]] in \\\n ['*kw', '*setup', '*forloop', '*foritem']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L96_C4", "label": "_prune_unused_indices", "type": "function", "loc": [96, 101], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:ClassDef_L23_C0", "vector": [2, 1, 0.5026, 0.0306, 1, 0.25, 0.7857, 126, 0, 1, 0, 0, 0, 0, 5], "semantic": {"name": "_prune_unused_indices", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _prune_unused_indices(self):\n used = self._collect_used_indices(self._robot_data['suite'], set())\n remap = {}\n self._robot_data['strings'] = \\\n list(self._prune(self._robot_data['strings'], used, remap))\n self._remap_indices(self._robot_data['suite'], remap)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Assign_L97_C8", "label": "used = _collect_used_indices()", "type": "assigned_variable", "loc": [97, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L96_C4", "vector": [14, 2, 0.4949, 0.0051, 2, 0.09, 0.0, 898, 3, 2, 0, 0, 335, 10, 2], "semantic": {"name": "used", "arg_names": [], "import_names": [], "rhs_call_name": "_collect_used_indices", "annotation": ""}, "snippet": " used = self._collect_used_indices(self._robot_data['suite'], set())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Assign_L98_C8", "label": "remap =", "type": "assigned_variable", "loc": [98, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L96_C4", "vector": [14, 2, 0.5, 0.0051, 2, 0.09, 0.3333, 365, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "remap", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " remap = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Assign_L99_C8", "label": " = list()", "type": "assigned_variable", "loc": [99, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L96_C4", "vector": [14, 2, 0.5077, 0.0102, 2, 0.09, 0.6667, 0, 3, 1, 0, 0, 430, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "list", "annotation": ""}, "snippet": " self._robot_data['strings'] = \\\n list(self._prune(self._robot_data['strings'], used, remap))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Expr_L101_C8", "label": "_remap_indices()", "type": "expression", "loc": [101, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L96_C4", "vector": [8, 2, 0.5153, 0.0051, 2, 0.09, 1.0, 702, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_remap_indices", "arg_names": [], "import_names": [], "rhs_call_name": "_remap_indices", "annotation": ""}, "snippet": " self._remap_indices(self._robot_data['suite'], remap)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L103_C4", "label": "_prune", "type": "function", "loc": [103, 111], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:ClassDef_L23_C0", "vector": [2, 1, 0.5459, 0.0459, 1, 0.25, 0.8571, 300, 0, 6, 0, 0, 0, 0, 2], "semantic": {"name": "_prune", "arg_names": ["self", "data", "used", "index_remap", "map_index", "offset_increment"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _prune(self, data, used, index_remap, map_index=None, offset_increment=1):\n offset = 0\n for index, text in enumerate(data):\n index = map_index(index) if map_index else index\n if index in used:\n index_remap[index] = index - offset\n yield text\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Assign_L104_C8", "label": "offset =", "type": "assigned_variable", "loc": [104, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L103_C4", "vector": [14, 2, 0.5306, 0.0051, 2, 0.39, 0.0, 132, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "offset", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " offset = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:For_L105_C8", "label": "for index, text", "type": "for", "loc": [105, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L103_C4", "vector": [6, 2, 0.551, 0.0357, 2, 0.39, 1.0, 565, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "index, text", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for index, text in enumerate(data):\n index = map_index(index) if map_index else index\n if index in used:\n index_remap[index] = index - offset\n yield text\n else:\n offset += offset_increment"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Assign_L106_C12", "label": "index =", "type": "assigned_variable", "loc": [106, 106], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:For_L105_C8", "vector": [14, 3, 0.5408, 0.0051, 3, 0.93, 0.0, 780, 8, 0, 0, 0, 0, 0, 1], "semantic": {"name": "index", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " index = map_index(index) if map_index else index"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:If_L107_C12", "label": "if", "type": "if", "loc": [107, 111], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:For_L105_C8", "vector": [4, 3, 0.5561, 0.0255, 3, 0.93, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if index in used:\n index_remap[index] = index - offset\n yield text\n else:\n offset += offset_increment"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Assign_L108_C16", "label": "assign", "type": "assigned_variable", "loc": [108, 108], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:If_L107_C12", "vector": [14, 4, 0.551, 0.0051, 4, 0.21, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " index_remap[index] = index - offset"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Expr_L109_C16", "label": "expression", "type": "expression", "loc": [109, 109], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:If_L107_C12", "vector": [8, 4, 0.5561, 0.0051, 4, 0.21, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " yield text"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L113_C4", "label": "_remap_indices", "type": "function", "loc": [113, 118], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:ClassDef_L23_C0", "vector": [2, 1, 0.5893, 0.0306, 1, 0.25, 0.9286, 702, 0, 3, 0, 0, 0, 0, 4], "semantic": {"name": "_remap_indices", "arg_names": ["self", "data", "remap"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _remap_indices(self, data, remap):\n for i, item in enumerate(data):\n if isinstance(item, TextIndex):\n data[i] = remap[item]\n elif isinstance(item, list):\n self._remap_indices(item, remap)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:For_L114_C8", "label": "for i, item", "type": "for", "loc": [114, 118], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L113_C4", "vector": [6, 2, 0.5918, 0.0255, 2, 0.57, 0.0, 849, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "i, item", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i, item in enumerate(data):\n if isinstance(item, TextIndex):\n data[i] = remap[item]\n elif isinstance(item, list):\n self._remap_indices(item, remap)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:If_L115_C12", "label": "if", "type": "if", "loc": [115, 118], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:For_L114_C8", "vector": [4, 3, 0.5944, 0.0204, 3, 0.72, 0.0, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(item, TextIndex):\n data[i] = remap[item]\n elif isinstance(item, list):\n self._remap_indices(item, remap)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Assign_L116_C16", "label": "assign", "type": "assigned_variable", "loc": [116, 116], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:If_L115_C12", "vector": [14, 4, 0.5918, 0.0051, 4, 0.78, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " data[i] = remap[item]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:If_L117_C12", "label": "if", "type": "if", "loc": [117, 118], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:If_L115_C12", "vector": [4, 4, 0.5995, 0.0102, 4, 0.78, 1.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif isinstance(item, list):\n self._remap_indices(item, remap)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Expr_L118_C16", "label": "_remap_indices()", "type": "expression", "loc": [118, 118], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:If_L117_C12", "vector": [8, 5, 0.602, 0.0051, 5, 0.8, 0.0, 702, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_remap_indices", "arg_names": [], "import_names": [], "rhs_call_name": "_remap_indices", "annotation": ""}, "snippet": " self._remap_indices(item, remap)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L120_C4", "label": "_collect_used_indices", "type": "function", "loc": [120, 129], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:ClassDef_L23_C0", "vector": [2, 1, 0.6352, 0.051, 1, 0.25, 1.0, 335, 0, 3, 1, 0, 0, 0, 9], "semantic": {"name": "_collect_used_indices", "arg_names": ["self", "data", "result"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _collect_used_indices(self, data, result):\n for item in data:\n if isinstance(item, (int, long)):\n result.add(item)\n elif isinstance(item, list):\n self._collect_used_indices(item, result)\n elif isinstance(item, dict):\n self._collect_used_indices(item.values(), result)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:For_L121_C8", "label": "for item", "type": "for", "loc": [121, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L120_C4", "vector": [6, 2, 0.6352, 0.0408, 2, 0.34, 0.0, 434, 2, 0, 0, 0, 0, 0, 9], "semantic": {"name": "item", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for item in data:\n if isinstance(item, (int, long)):\n result.add(item)\n elif isinstance(item, list):\n self._collect_used_indices(item, result)\n elif isinstance(item, dict):\n self._collect_used_indices(item.values(), result)\n self._collect_used_indices(item.keys(), result)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:If_L122_C12", "label": "if", "type": "if", "loc": [122, 128], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:For_L121_C8", "vector": [4, 3, 0.6378, 0.0357, 3, 0.8, 0.0, 0, 3, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(item, (int, long)):\n result.add(item)\n elif isinstance(item, list):\n self._collect_used_indices(item, result)\n elif isinstance(item, dict):\n self._collect_used_indices(item.values(), result)\n self._collect_used_indices(item.keys(), result)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Expr_L123_C16", "label": "add()", "type": "expression", "loc": [123, 123], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:If_L122_C12", "vector": [8, 4, 0.6276, 0.0051, 4, 0.21, 0.0, 241, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " result.add(item)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:If_L124_C12", "label": "if", "type": "if", "loc": [124, 128], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:If_L122_C12", "vector": [4, 4, 0.6429, 0.0255, 4, 0.21, 1.0, 0, 3, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif isinstance(item, list):\n self._collect_used_indices(item, result)\n elif isinstance(item, dict):\n self._collect_used_indices(item.values(), result)\n self._collect_used_indices(item.keys(), result)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Expr_L125_C16", "label": "_collect_used_indices()", "type": "expression", "loc": [125, 125], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:If_L124_C12", "vector": [8, 5, 0.6378, 0.0051, 5, 0.37, 0.0, 335, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_collect_used_indices", "arg_names": [], "import_names": [], "rhs_call_name": "_collect_used_indices", "annotation": ""}, "snippet": " self._collect_used_indices(item, result)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:If_L126_C12", "label": "if", "type": "if", "loc": [126, 128], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:If_L124_C12", "vector": [4, 5, 0.648, 0.0153, 5, 0.37, 1.0, 0, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif isinstance(item, dict):\n self._collect_used_indices(item.values(), result)\n self._collect_used_indices(item.keys(), result)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Expr_L127_C16", "label": "_collect_used_indices()", "type": "expression", "loc": [127, 127], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:If_L126_C12", "vector": [8, 6, 0.648, 0.0051, 6, 0.67, 0.0, 335, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "_collect_used_indices", "arg_names": [], "import_names": [], "rhs_call_name": "_collect_used_indices", "annotation": ""}, "snippet": " self._collect_used_indices(item.values(), result)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Expr_L128_C16", "label": "_collect_used_indices()", "type": "expression", "loc": [128, 128], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:If_L126_C12", "vector": [8, 6, 0.6531, 0.0051, 6, 0.67, 1.0, 335, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "_collect_used_indices", "arg_names": [], "import_names": [], "rhs_call_name": "_collect_used_indices", "annotation": ""}, "snippet": " self._collect_used_indices(item.keys(), result)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Return_L129_C8", "label": "return", "type": "return", "loc": [129, 129], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L120_C4", "vector": [13, 2, 0.6582, 0.0051, 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 result"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:ClassDef_L131_C0", "label": "_SeparatingWriter", "type": "class", "loc": [131, 147], "level": 0, "parent": null, "vector": [3, 0, 0.7092, 0.0867, 0, 0.66, 0.7143, 206, 0, 4, 0, 0, 186, 0, 5], "semantic": {"name": "_SeparatingWriter", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _SeparatingWriter(object):\n\n def __init__(self, output, separator):\n self._output = output\n self._separator = separator\n\n def separator(self):\n self._output.write(self._separator)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L133_C4", "label": "__init__", "type": "function", "loc": [133, 135], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:ClassDef_L131_C0", "vector": [2, 1, 0.6837, 0.0153, 1, 0.72, 0.0, 555, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "output", "separator"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, output, separator):\n self._output = output\n self._separator = separator"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Assign_L134_C8", "label": "self._output =", "type": "assigned_variable", "loc": [134, 134], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L133_C4", "vector": [14, 2, 0.6837, 0.0051, 2, 0.78, 0.0, 867, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._output", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._output = output"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Assign_L135_C8", "label": "self._separator =", "type": "assigned_variable", "loc": [135, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L133_C4", "vector": [14, 2, 0.6888, 0.0051, 2, 0.78, 1.0, 783, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._separator", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._separator = separator"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L137_C4", "label": "separator", "type": "function", "loc": [137, 138], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:ClassDef_L131_C0", "vector": [2, 1, 0.7015, 0.0102, 1, 0.72, 0.3333, 539, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "separator", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def separator(self):\n self._output.write(self._separator)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Expr_L138_C8", "label": "write()", "type": "expression", "loc": [138, 138], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L137_C4", "vector": [8, 2, 0.7041, 0.0051, 2, 0.36, 0.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " self._output.write(self._separator)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L140_C4", "label": "dump_json", "type": "function", "loc": [140, 144], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:ClassDef_L131_C0", "vector": [2, 1, 0.7245, 0.0255, 1, 0.72, 0.6667, 425, 0, 5, 0, 0, 0, 0, 3], "semantic": {"name": "dump_json", "arg_names": ["self", "prefix", "data_block", "postfix", "mapping"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def dump_json(self, prefix, data_block, postfix = ';\\n', mapping=None):\n if prefix:\n self._output.write(prefix)\n json.json_dump(data_block, self._output, mappings=mapping)\n self._output.write(postfix)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:If_L141_C8", "label": "if", "type": "if", "loc": [141, 142], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L140_C4", "vector": [4, 2, 0.7219, 0.0102, 2, 0.52, 0.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if prefix:\n self._output.write(prefix)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Expr_L142_C12", "label": "write()", "type": "expression", "loc": [142, 142], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:If_L141_C8", "vector": [8, 3, 0.7245, 0.0051, 3, 0.86, 0.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " self._output.write(prefix)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Expr_L143_C8", "label": "json_dump()", "type": "expression", "loc": [143, 143], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L140_C4", "vector": [8, 2, 0.7296, 0.0051, 2, 0.52, 0.5, 665, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "json_dump", "arg_names": [], "import_names": [], "rhs_call_name": "json_dump", "annotation": ""}, "snippet": " json.json_dump(data_block, self._output, mappings=mapping)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Expr_L144_C8", "label": "write()", "type": "expression", "loc": [144, 144], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L140_C4", "vector": [8, 2, 0.7347, 0.0051, 2, 0.52, 1.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " self._output.write(postfix)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L146_C4", "label": "write", "type": "function", "loc": [146, 147], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:ClassDef_L131_C0", "vector": [2, 1, 0.7474, 0.0102, 1, 0.72, 1.0, 837, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": ["self", "string"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def write(self, string):\n self._output.write(string)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Expr_L147_C8", "label": "write()", "type": "expression", "loc": [147, 147], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L146_C4", "vector": [8, 2, 0.75, 0.0051, 2, 0.95, 0.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " self._output.write(string)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:ClassDef_L149_C0", "label": "_SubResult", "type": "class", "loc": [149, 164], "level": 0, "parent": null, "vector": [3, 0, 0.7985, 0.0816, 0, 0.66, 0.8571, 493, 0, 3, 0, 0, 186, 0, 3], "semantic": {"name": "_SubResult", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _SubResult(object):\n\n def __init__(self, data_block, size, mapping):\n self.data_block = data_block\n self.size = size\n self.mapping = mapping\n\n def update(self, subresult):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L151_C4", "label": "__init__", "type": "function", "loc": [151, 154], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:ClassDef_L149_C0", "vector": [2, 1, 0.7781, 0.0204, 1, 0.45, 0.0, 555, 0, 4, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "data_block", "size", "mapping"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, data_block, size, mapping):\n self.data_block = data_block\n self.size = size\n self.mapping = mapping"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Assign_L152_C8", "label": "self.data_block =", "type": "assigned_variable", "loc": [152, 152], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L151_C4", "vector": [14, 2, 0.7755, 0.0051, 2, 0.71, 0.0, 241, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.data_block", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.data_block = data_block"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Assign_L153_C8", "label": "self.size =", "type": "assigned_variable", "loc": [153, 153], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L151_C4", "vector": [14, 2, 0.7806, 0.0051, 2, 0.71, 0.5, 183, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.size", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.size = size"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Assign_L154_C8", "label": "self.mapping =", "type": "assigned_variable", "loc": [154, 154], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L151_C4", "vector": [14, 2, 0.7857, 0.0051, 2, 0.71, 1.0, 45, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.mapping", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.mapping = mapping"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L156_C4", "label": "update", "type": "function", "loc": [156, 160], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:ClassDef_L149_C0", "vector": [2, 1, 0.8061, 0.0255, 1, 0.45, 0.5, 637, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": ["self", "subresult"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def update(self, subresult):\n self.data_block += [subresult.data_block]\n self.size += subresult.size\n if subresult.mapping:\n self.mapping.update(subresult.mapping)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:If_L159_C8", "label": "if", "type": "if", "loc": [159, 160], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L156_C4", "vector": [4, 2, 0.8138, 0.0102, 2, 0.77, 0.0, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if subresult.mapping:\n self.mapping.update(subresult.mapping)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Expr_L160_C12", "label": "update()", "type": "expression", "loc": [160, 160], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:If_L159_C8", "vector": [8, 3, 0.8163, 0.0051, 3, 0.47, 0.0, 637, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " self.mapping.update(subresult.mapping)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L162_C4", "label": "link", "type": "function", "loc": [162, 164], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:ClassDef_L149_C0", "vector": [2, 1, 0.8316, 0.0153, 1, 0.45, 1.0, 880, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "link", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def link(self, name):\n key = object()\n return _SubResult(key, 1, {key:name})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Assign_L163_C8", "label": "key = object()", "type": "assigned_variable", "loc": [163, 163], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L162_C4", "vector": [14, 2, 0.8316, 0.0051, 2, 0.4, 0.0, 230, 3, 0, 0, 0, 186, 10, 1], "semantic": {"name": "key", "arg_names": [], "import_names": [], "rhs_call_name": "object", "annotation": ""}, "snippet": " key = object()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Return_L164_C8", "label": "return", "type": "return", "loc": [164, 164], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L162_C4", "vector": [13, 2, 0.8367, 0.0051, 2, 0.4, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return _SubResult(key, 1, {key:name})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:ClassDef_L167_C0", "label": "SplittingSuiteWriter", "type": "class", "loc": [167, 196], "level": 0, "parent": null, "vector": [3, 0, 0.926, 0.1531, 0, 0.66, 1.0, 615, 0, 5, 0, 0, 186, 0, 12], "semantic": {"name": "SplittingSuiteWriter", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class SplittingSuiteWriter(object):\n\n def __init__(self, writer, split_threshold):\n self._index = 0\n self._writer = writer\n self._split_threshold = split_threshold\n\n def write(self, data_block):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L169_C4", "label": "__init__", "type": "function", "loc": [169, 172], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:ClassDef_L167_C0", "vector": [2, 1, 0.8699, 0.0204, 1, 0.23, 0.0, 555, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "writer", "split_threshold"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, writer, split_threshold):\n self._index = 0\n self._writer = writer\n self._split_threshold = split_threshold"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Assign_L170_C8", "label": "self._index =", "type": "assigned_variable", "loc": [170, 170], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L169_C4", "vector": [14, 2, 0.8673, 0.0051, 2, 0.97, 0.0, 679, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self._index", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._index = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Assign_L171_C8", "label": "self._writer =", "type": "assigned_variable", "loc": [171, 171], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L169_C4", "vector": [14, 2, 0.8724, 0.0051, 2, 0.97, 0.5, 446, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._writer", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._writer = writer"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Assign_L172_C8", "label": "self._split_threshold =", "type": "assigned_variable", "loc": [172, 172], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L169_C4", "vector": [14, 2, 0.8776, 0.0051, 2, 0.97, 1.0, 965, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._split_threshold", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._split_threshold = split_threshold"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L174_C4", "label": "write", "type": "function", "loc": [174, 176], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:ClassDef_L167_C0", "vector": [2, 1, 0.8929, 0.0153, 1, 0.23, 0.25, 837, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": ["self", "data_block"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def write(self, data_block):\n result = self._write(data_block)\n return result.data_block, result.mapping"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Assign_L175_C8", "label": "result = _write()", "type": "assigned_variable", "loc": [175, 175], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L174_C4", "vector": [14, 2, 0.8929, 0.0051, 2, 0.67, 0.0, 51, 3, 1, 0, 0, 961, 10, 1], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "_write", "annotation": ""}, "snippet": " result = self._write(data_block)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Return_L176_C8", "label": "return", "type": "return", "loc": [176, 176], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L174_C4", "vector": [13, 2, 0.898, 0.0051, 2, 0.67, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return result.data_block, result.mapping"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L178_C4", "label": "_write", "type": "function", "loc": [178, 186], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:ClassDef_L167_C0", "vector": [2, 1, 0.9286, 0.0459, 1, 0.23, 0.5, 961, 0, 2, 1, 0, 0, 0, 6], "semantic": {"name": "_write", "arg_names": ["self", "data_block"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _write(self, data_block):\n if not isinstance(data_block, list):\n return _SubResult(data_block, 1, None)\n result = _SubResult([], 1, {})\n for item in data_block:\n result.update(self._write(item))\n if result.size > self._split_threshold:\n result = self._dump_suite_part(result)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:If_L179_C8", "label": "if", "type": "if", "loc": [179, 180], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L178_C4", "vector": [4, 2, 0.9158, 0.0102, 2, 0.13, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not isinstance(data_block, list):\n return _SubResult(data_block, 1, None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Return_L180_C12", "label": "return", "type": "return", "loc": [180, 180], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:If_L179_C8", "vector": [13, 3, 0.9184, 0.0051, 3, 0.03, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return _SubResult(data_block, 1, None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Assign_L181_C8", "label": "result = _SubResult()", "type": "assigned_variable", "loc": [181, 181], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L178_C4", "vector": [14, 2, 0.9235, 0.0051, 2, 0.13, 0.25, 51, 3, 3, 0, 0, 493, 10, 1], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "_SubResult", "annotation": ""}, "snippet": " result = _SubResult([], 1, {})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:For_L182_C8", "label": "for item", "type": "for", "loc": [182, 183], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L178_C4", "vector": [6, 2, 0.9311, 0.0102, 2, 0.13, 0.5, 434, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "item", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for item in data_block:\n result.update(self._write(item))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Expr_L183_C12", "label": "update()", "type": "expression", "loc": [183, 183], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:For_L182_C8", "vector": [8, 3, 0.9337, 0.0051, 3, 0.32, 0.0, 637, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " result.update(self._write(item))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:If_L184_C8", "label": "if", "type": "if", "loc": [184, 185], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L178_C4", "vector": [4, 2, 0.9413, 0.0102, 2, 0.13, 0.75, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if result.size > self._split_threshold:\n result = self._dump_suite_part(result)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Assign_L185_C12", "label": "result = _dump_suite_part()", "type": "assigned_variable", "loc": [185, 185], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:If_L184_C8", "vector": [14, 3, 0.9439, 0.0051, 3, 0.07, 0.0, 51, 3, 1, 0, 0, 812, 10, 1], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "_dump_suite_part", "annotation": ""}, "snippet": " result = self._dump_suite_part(result)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Return_L186_C8", "label": "return", "type": "return", "loc": [186, 186], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L178_C4", "vector": [13, 2, 0.949, 0.0051, 2, 0.13, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return result"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L188_C4", "label": "_list_name", "type": "function", "loc": [188, 189], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:ClassDef_L167_C0", "vector": [2, 1, 0.9617, 0.0102, 1, 0.23, 0.75, 107, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "_list_name", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _list_name(self):\n return 'window.sPart%s' % self._index"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Return_L189_C8", "label": "return", "type": "return", "loc": [189, 189], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L188_C4", "vector": [13, 2, 0.9643, 0.0051, 2, 0.39, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'window.sPart%s' % self._index"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L191_C4", "label": "_dump_suite_part", "type": "function", "loc": [191, 196], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:ClassDef_L167_C0", "vector": [2, 1, 0.9872, 0.0306, 1, 0.23, 1.0, 812, 0, 2, 1, 0, 0, 0, 5], "semantic": {"name": "_dump_suite_part", "arg_names": ["self", "result"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _dump_suite_part(self, result):\n self._writer.dump_json(self._list_name()+' = ', result.data_block, mapping=result.mapping)\n self._writer.separator()\n new_result = result.link(self._list_name())\n self._index += 1\n return new_result"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Expr_L192_C8", "label": "dump_json()", "type": "expression", "loc": [192, 192], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L191_C4", "vector": [8, 2, 0.9796, 0.0051, 2, 0.16, 0.0, 425, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "dump_json", "arg_names": [], "import_names": [], "rhs_call_name": "dump_json", "annotation": ""}, "snippet": " self._writer.dump_json(self._list_name()+' = ', result.data_block, mapping=result.mapping)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Expr_L193_C8", "label": "separator()", "type": "expression", "loc": [193, 193], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L191_C4", "vector": [8, 2, 0.9847, 0.0051, 2, 0.16, 0.3333, 539, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "separator", "arg_names": [], "import_names": [], "rhs_call_name": "separator", "annotation": ""}, "snippet": " self._writer.separator()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Assign_L194_C8", "label": "new_result = link()", "type": "assigned_variable", "loc": [194, 194], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L191_C4", "vector": [14, 2, 0.9898, 0.0051, 2, 0.16, 0.6667, 803, 3, 1, 0, 0, 880, 10, 2], "semantic": {"name": "new_result", "arg_names": [], "import_names": [], "rhs_call_name": "link", "annotation": ""}, "snippet": " new_result = result.link(self._list_name())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99887:Return_L196_C8", "label": "return", "type": "return", "loc": [196, 196], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L191_C4", "vector": [13, 2, 1.0, 0.0051, 2, 0.16, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return new_result"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99887:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Assign_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Assign_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Assign_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Expr_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Assign_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Expr_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Expr_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Assign_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Assign_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Assign_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Expr_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Expr_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:For_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:For_L48_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Expr_L49_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:For_L48_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Expr_L50_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Expr_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:If_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:If_L54_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Assign_L55_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:If_L54_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Assign_L56_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:If_L54_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Expr_L57_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:If_L54_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:If_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:If_L58_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Expr_L59_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:If_L58_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Expr_L61_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Assign_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Expr_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:While_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:While_L66_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Expr_L67_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:While_L66_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Expr_L68_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:While_L66_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Assign_L69_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Assign_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Expr_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L77_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L77_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Expr_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L80_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:If_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:If_L81_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Return_L82_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L80_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Return_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L86_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L86_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Return_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L96_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Assign_L97_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Assign_L98_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Assign_L99_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Expr_L101_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L103_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Assign_L104_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:For_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:For_L105_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Assign_L106_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:For_L105_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:If_L107_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:If_L107_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Assign_L108_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:If_L107_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Expr_L109_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L113_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:For_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:For_L114_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:If_L115_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:If_L115_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Assign_L116_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:If_L115_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:If_L117_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:If_L117_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Expr_L118_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:ClassDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L120_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:For_L121_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:For_L121_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:If_L122_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:If_L122_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Expr_L123_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:If_L122_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:If_L124_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:If_L124_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Expr_L125_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:If_L124_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:If_L126_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:If_L126_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Expr_L127_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:If_L126_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Expr_L128_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Return_L129_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:ClassDef_L131_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L133_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L133_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Assign_L134_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L133_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Assign_L135_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:ClassDef_L131_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L137_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L137_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Expr_L138_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:ClassDef_L131_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L140_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L140_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:If_L141_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:If_L141_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Expr_L142_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L140_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Expr_L143_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L140_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Expr_L144_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:ClassDef_L131_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L146_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L146_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Expr_L147_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:ClassDef_L149_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L151_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Assign_L152_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Assign_L153_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Assign_L154_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:ClassDef_L149_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L156_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L156_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:If_L159_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:If_L159_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Expr_L160_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:ClassDef_L149_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L162_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L162_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Assign_L163_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L162_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Return_L164_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:ClassDef_L167_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L169_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L169_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Assign_L170_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L169_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Assign_L171_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L169_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Assign_L172_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:ClassDef_L167_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L174_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L174_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Assign_L175_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L174_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Return_L176_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:ClassDef_L167_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L178_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L178_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:If_L179_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:If_L179_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Return_L180_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L178_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Assign_L181_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L178_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:For_L182_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:For_L182_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Expr_L183_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L178_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:If_L184_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:If_L184_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Assign_L185_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L178_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Return_L186_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:ClassDef_L167_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L188_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L188_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Return_L189_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:ClassDef_L167_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L191_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L191_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Expr_L192_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L191_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Expr_L193_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L191_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Assign_L194_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99887:FunctionDef_L191_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99887:Return_L196_C8"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import with_statement
from xml import sax
from robot.result.elementhandlers import RootHandler, Context
from robot.result.jsondatamodel import DataModel
def create_datamodel_from(input_filename, split_log=False):
context = Context(split_log)
robot = _RobotOutputHandler(context)
with open(input_filename, 'r') as input:
sax.parse(input, robot)
return robot.datamodel
def parse_js(input_filename, output):
create_datamodel_from(input_filename).write_to(output)
class _RobotOutputHandler(sax.handler.ContentHandler):
def __init__(self, context):
self._context = context
self._root_handler = RootHandler(context)
self._handler_stack = [self._root_handler]
@property
def datamodel(self):
return DataModel(self._root_handler.data, self._context.split_results)
def startElement(self, name, attrs):
handler = self._handler_stack[-1].get_handler_for(name, attrs)
self._charbuffer = []
self._handler_stack.append(handler)
def endElement(self, name):
handler = self._handler_stack.pop()
self._handler_stack[-1].add_child_data(handler.end_element(self.text))
def characters(self, content):
self._charbuffer += [content]
@property
def text(self):
return ''.join(self._charbuffer)
| ajibawa-2023/Python-Code-Large/train/row_99888 | 28 | 60 | 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_99888:ImportFrom_L15_C0", "label": "from __future__ import with_statement", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.25, 0.0167, 0, 0.66, 0.0, 777, 0, 1, 0, 0, 777, 0, 0], "semantic": {"name": "__future__", "arg_names": [], "import_names": ["with_statement"], "rhs_call_name": "", "annotation": ""}, "snippet": "from __future__ import with_statement"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99888:ImportFrom_L16_C0", "label": "from xml import sax", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.2667, 0.0167, 0, 0.66, 0.1667, 324, 0, 1, 0, 0, 324, 0, 0], "semantic": {"name": "xml", "arg_names": [], "import_names": ["sax"], "rhs_call_name": "", "annotation": ""}, "snippet": "from xml import sax"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99888:ImportFrom_L18_C0", "label": "from robot.result.elementhandlers import RootHandler, Context", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.3, 0.0167, 0, 0.66, 0.3333, 520, 0, 2, 0, 0, 520, 0, 0], "semantic": {"name": "robot.result.elementhandlers", "arg_names": [], "import_names": ["RootHandler", "Context"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot.result.elementhandlers import RootHandler, Context"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99888:ImportFrom_L19_C0", "label": "from robot.result.jsondatamodel import DataModel", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.3167, 0.0167, 0, 0.66, 0.5, 926, 0, 1, 0, 0, 926, 0, 0], "semantic": {"name": "robot.result.jsondatamodel", "arg_names": [], "import_names": ["DataModel"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot.result.jsondatamodel import DataModel"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99888:FunctionDef_L22_C0", "label": "create_datamodel_from", "type": "function", "loc": [22, 27], "level": 0, "parent": null, "vector": [2, 0, 0.4083, 0.1, 0, 0.66, 0.6667, 209, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "create_datamodel_from", "arg_names": ["input_filename", "split_log"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def create_datamodel_from(input_filename, split_log=False):\n context = Context(split_log)\n robot = _RobotOutputHandler(context)\n with open(input_filename, 'r') as input:\n sax.parse(input, robot)\n return robot.datamodel"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99888:Assign_L23_C4", "label": "context = Context()", "type": "assigned_variable", "loc": [23, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99888:FunctionDef_L22_C0", "vector": [14, 1, 0.3833, 0.0167, 1, 0.64, 0.0, 954, 3, 1, 0, 0, 560, 10, 1], "semantic": {"name": "context", "arg_names": [], "import_names": [], "rhs_call_name": "Context", "annotation": ""}, "snippet": " context = Context(split_log)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99888:Assign_L24_C4", "label": "robot = _RobotOutputHandler()", "type": "assigned_variable", "loc": [24, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99888:FunctionDef_L22_C0", "vector": [14, 1, 0.4, 0.0167, 1, 0.64, 0.5, 735, 3, 1, 0, 0, 562, 10, 1], "semantic": {"name": "robot", "arg_names": [], "import_names": [], "rhs_call_name": "_RobotOutputHandler", "annotation": ""}, "snippet": " robot = _RobotOutputHandler(context)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99888:Expr_L26_C8", "label": "parse()", "type": "expression", "loc": [26, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99888:FunctionDef_L22_C0", "vector": [8, 1, 0.4333, 0.0167, 1, 0.64, 0.0, 678, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "parse", "arg_names": [], "import_names": [], "rhs_call_name": "parse", "annotation": ""}, "snippet": " sax.parse(input, robot)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99888:Return_L27_C4", "label": "return", "type": "return", "loc": [27, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99888:FunctionDef_L22_C0", "vector": [13, 1, 0.45, 0.0167, 1, 0.64, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return robot.datamodel"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99888:FunctionDef_L30_C0", "label": "parse_js", "type": "function", "loc": [30, 31], "level": 0, "parent": null, "vector": [2, 0, 0.5083, 0.0333, 0, 0.66, 0.8333, 878, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "parse_js", "arg_names": ["input_filename", "output"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def parse_js(input_filename, output):\n create_datamodel_from(input_filename).write_to(output)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99888:Expr_L31_C4", "label": "write_to()", "type": "expression", "loc": [31, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99888:FunctionDef_L30_C0", "vector": [8, 1, 0.5167, 0.0167, 1, 0.52, 0.0, 739, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write_to", "arg_names": [], "import_names": [], "rhs_call_name": "write_to", "annotation": ""}, "snippet": " create_datamodel_from(input_filename).write_to(output)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99888:ClassDef_L34_C0", "label": "_RobotOutputHandler", "type": "class", "loc": [34, 59], "level": 0, "parent": null, "vector": [3, 0, 0.775, 0.4333, 0, 0.66, 1.0, 562, 0, 6, 0, 0, 470, 0, 8], "semantic": {"name": "_RobotOutputHandler", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _RobotOutputHandler(sax.handler.ContentHandler):\n\n def __init__(self, context):\n self._context = context\n self._root_handler = RootHandler(context)\n self._handler_stack = [self._root_handler]\n\n @property"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99888:FunctionDef_L36_C4", "label": "__init__", "type": "function", "loc": [36, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99888:ClassDef_L34_C0", "vector": [2, 1, 0.625, 0.0667, 1, 0.33, 0.0, 555, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "context"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, context):\n self._context = context\n self._root_handler = RootHandler(context)\n self._handler_stack = [self._root_handler]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99888:Assign_L37_C8", "label": "self._context =", "type": "assigned_variable", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99888:FunctionDef_L36_C4", "vector": [14, 2, 0.6167, 0.0167, 2, 0.72, 0.0, 962, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._context", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._context = context"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99888:Assign_L38_C8", "label": "self._root_handler = RootHandler()", "type": "assigned_variable", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99888:FunctionDef_L36_C4", "vector": [14, 2, 0.6333, 0.0167, 2, 0.72, 0.5, 506, 3, 1, 0, 0, 892, 10, 1], "semantic": {"name": "self._root_handler", "arg_names": [], "import_names": [], "rhs_call_name": "RootHandler", "annotation": ""}, "snippet": " self._root_handler = RootHandler(context)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99888:Assign_L39_C8", "label": "self._handler_stack =", "type": "assigned_variable", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99888:FunctionDef_L36_C4", "vector": [14, 2, 0.65, 0.0167, 2, 0.72, 1.0, 273, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self._handler_stack", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._handler_stack = [self._root_handler]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99888:FunctionDef_L42_C4", "label": "datamodel", "type": "function", "loc": [42, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99888:ClassDef_L34_C0", "vector": [2, 1, 0.7083, 0.0333, 1, 0.33, 0.2, 294, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "datamodel", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def datamodel(self):\n return DataModel(self._root_handler.data, self._context.split_results)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99888:Return_L43_C8", "label": "return", "type": "return", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99888:FunctionDef_L42_C4", "vector": [13, 2, 0.7167, 0.0167, 2, 0.49, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return DataModel(self._root_handler.data, self._context.split_results)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99888:FunctionDef_L45_C4", "label": "startElement", "type": "function", "loc": [45, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99888:ClassDef_L34_C0", "vector": [2, 1, 0.775, 0.0667, 1, 0.33, 0.4, 862, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "startElement", "arg_names": ["self", "name", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def startElement(self, name, attrs):\n handler = self._handler_stack[-1].get_handler_for(name, attrs)\n self._charbuffer = []\n self._handler_stack.append(handler)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99888:Assign_L46_C8", "label": "handler = get_handler_for()", "type": "assigned_variable", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99888:FunctionDef_L45_C4", "vector": [14, 2, 0.7667, 0.0167, 2, 0.74, 0.0, 388, 3, 2, 0, 0, 198, 10, 1], "semantic": {"name": "handler", "arg_names": [], "import_names": [], "rhs_call_name": "get_handler_for", "annotation": ""}, "snippet": " handler = self._handler_stack[-1].get_handler_for(name, attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99888:Assign_L47_C8", "label": "self._charbuffer =", "type": "assigned_variable", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99888:FunctionDef_L45_C4", "vector": [14, 2, 0.7833, 0.0167, 2, 0.74, 0.5, 600, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self._charbuffer", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._charbuffer = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99888:Expr_L48_C8", "label": "append()", "type": "expression", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99888:FunctionDef_L45_C4", "vector": [8, 2, 0.8, 0.0167, 2, 0.74, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self._handler_stack.append(handler)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99888:FunctionDef_L50_C4", "label": "endElement", "type": "function", "loc": [50, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99888:ClassDef_L34_C0", "vector": [2, 1, 0.85, 0.05, 1, 0.33, 0.6, 563, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "endElement", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def endElement(self, name):\n handler = self._handler_stack.pop()\n self._handler_stack[-1].add_child_data(handler.end_element(self.text))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99888:Assign_L51_C8", "label": "handler = pop()", "type": "assigned_variable", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99888:FunctionDef_L50_C4", "vector": [14, 2, 0.85, 0.0167, 2, 0.36, 0.0, 388, 3, 0, 0, 0, 969, 10, 1], "semantic": {"name": "handler", "arg_names": [], "import_names": [], "rhs_call_name": "pop", "annotation": ""}, "snippet": " handler = self._handler_stack.pop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99888:Expr_L52_C8", "label": "add_child_data()", "type": "expression", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99888:FunctionDef_L50_C4", "vector": [8, 2, 0.8667, 0.0167, 2, 0.36, 1.0, 224, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "add_child_data", "arg_names": [], "import_names": [], "rhs_call_name": "add_child_data", "annotation": ""}, "snippet": " self._handler_stack[-1].add_child_data(handler.end_element(self.text))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99888:FunctionDef_L54_C4", "label": "characters", "type": "function", "loc": [54, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99888:ClassDef_L34_C0", "vector": [2, 1, 0.9083, 0.0333, 1, 0.33, 0.8, 731, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "characters", "arg_names": ["self", "content"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def characters(self, content):\n self._charbuffer += [content]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99888:FunctionDef_L58_C4", "label": "text", "type": "function", "loc": [58, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99888:ClassDef_L34_C0", "vector": [2, 1, 0.975, 0.0333, 1, 0.33, 1.0, 439, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "text", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def text(self):\n return ''.join(self._charbuffer)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99888:Return_L59_C8", "label": "return", "type": "return", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99888:FunctionDef_L58_C4", "vector": [13, 2, 0.9833, 0.0167, 2, 0.7, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ''.join(self._charbuffer)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99888:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99888:Assign_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99888:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99888:Assign_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99888:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99888:Expr_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99888:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99888:Return_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99888:FunctionDef_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99888:Expr_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99888:ClassDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99888:FunctionDef_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99888:FunctionDef_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99888:Assign_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99888:FunctionDef_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99888:Assign_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99888:FunctionDef_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99888:Assign_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99888:ClassDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99888:FunctionDef_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99888:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99888:Return_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99888:ClassDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99888:FunctionDef_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99888:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99888:Assign_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99888:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99888:Assign_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99888:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99888:Expr_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99888:ClassDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99888:FunctionDef_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99888:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99888:Assign_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99888:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99888:Expr_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99888:ClassDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99888:FunctionDef_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99888:ClassDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99888:FunctionDef_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99888:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99888:Return_L59_C8"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from resultwriter import ResultWriter
| ajibawa-2023/Python-Code-Large/train/row_99889 | 1 | 16 | 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_99889:ImportFrom_L16_C0", "label": "from resultwriter import ResultWriter", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 1.0, 0.0625, 0, 0.66, 0.0, 548, 0, 1, 0, 0, 548, 0, 0], "semantic": {"name": "resultwriter", "arg_names": [], "import_names": ["ResultWriter"], "rhs_call_name": "", "annotation": ""}, "snippet": "from resultwriter import ResultWriter"}] | [] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from robot.output import XmlLogger
class OutputWriter(XmlLogger):
def __init__(self, path):
XmlLogger.__init__(self, path, generator='Rebot')
def message(self, msg):
self._write_message(msg)
| ajibawa-2023/Python-Code-Large/train/row_99890 | 6 | 25 | 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_99890:ImportFrom_L15_C0", "label": "from robot.output import XmlLogger", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.6, 0.04, 0, 0.66, 0.0, 596, 0, 1, 0, 0, 596, 0, 0], "semantic": {"name": "robot.output", "arg_names": [], "import_names": ["XmlLogger"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot.output import XmlLogger"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99890:ClassDef_L18_C0", "label": "OutputWriter", "type": "class", "loc": [18, 24], "level": 0, "parent": null, "vector": [3, 0, 0.84, 0.28, 0, 0.66, 1.0, 416, 0, 2, 0, 0, 137, 0, 2], "semantic": {"name": "OutputWriter", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class OutputWriter(XmlLogger):\n\n def __init__(self, path):\n XmlLogger.__init__(self, path, generator='Rebot')\n\n def message(self, msg):\n self._write_message(msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99890:FunctionDef_L20_C4", "label": "__init__", "type": "function", "loc": [20, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99890:ClassDef_L18_C0", "vector": [2, 1, 0.82, 0.08, 1, 0.37, 0.0, 555, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, path):\n XmlLogger.__init__(self, path, generator='Rebot')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99890:Expr_L21_C8", "label": "__init__()", "type": "expression", "loc": [21, 21], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99890:FunctionDef_L20_C4", "vector": [8, 2, 0.84, 0.04, 2, 0.98, 0.0, 555, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " XmlLogger.__init__(self, path, generator='Rebot')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99890:FunctionDef_L23_C4", "label": "message", "type": "function", "loc": [23, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99890:ClassDef_L18_C0", "vector": [2, 1, 0.94, 0.08, 1, 0.37, 1.0, 635, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "message", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def message(self, msg):\n self._write_message(msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99890:Expr_L24_C8", "label": "_write_message()", "type": "expression", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99890:FunctionDef_L23_C4", "vector": [8, 2, 0.96, 0.04, 2, 0.89, 0.0, 257, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_write_message", "arg_names": [], "import_names": [], "rhs_call_name": "_write_message", "annotation": ""}, "snippet": " self._write_message(msg)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99890:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99890:FunctionDef_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99890:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99890:Expr_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99890:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99890:FunctionDef_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99890:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99890:Expr_L24_C8"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Public logging API for test libraries.
This module provides a public API for writing messages to the log file
and the console. Test libraries can use this API like `logger.info('My
message')` instead of logging through the standard output like `print
'*INFO* My message'`. In addition to a programmatic interface being
cleaner to use, this API has a benefit that the log messages have
accurate timestamps.
Log levels
----------
It is possible to log messages using levels `TRACE`, `DEBUG`, `INFO`
and `WARN` either using the `write` method or, more commonly, with the
log level specific `trace`, `debug`, `info` and `warn` methods.
By default the trace and debug messages are not logged but that can be
changed with the `--loglevel` command line option. Warnings are
automatically written also to the `Test Execution Errors` section in
the log file and to the console.
Logging HTML
------------
All methods that are used for writing messages to the log file have an
optional `html` argument. If a message to be logged is supposed to be
shown as HTML, this argument should be set to `True`.
Example
-------
from robot.api import logger
def my_keyword(arg):
logger.debug('Got argument %s' % arg)
do_something()
logger.info('<i>This</i> is a boring example', html=True)
"""
import sys
from robot.output import LOGGER, Message
def write(msg, level, html=False):
"""Writes the message to the log file using the given level.
Valid log levels are `TRACE`, `DEBUG`, `INFO` and `WARN`. Instead
of using this method, it is generally better to use the level
specific methods such as `info` and `debug`.
"""
LOGGER.log_message(Message(msg, level, html))
def trace(msg, html=False):
"""Writes the message to the log file with the TRACE level."""
write(msg, 'TRACE', html)
def debug(msg, html=False):
"""Writes the message to the log file with the DEBUG level."""
write(msg, 'DEBUG', html)
def info(msg, html=False, also_console=False):
"""Writes the message to the log file with the INFO level.
If `also_console` argument is set to `True`, the message is written
both to the log file and to the console.
"""
write(msg, 'INFO', html)
if also_console:
console(msg)
def warn(msg, html=False):
"""Writes the message to the log file with the WARN level."""
write(msg, 'WARN', html)
def console(msg, newline=True):
"""Writes the message to the console.
If the `newline` argument is `True`, a newline character is automatically
added to the message.
"""
if newline:
msg += '\n'
sys.__stdout__.write(msg)
| ajibawa-2023/Python-Code-Large/train/row_99891 | 24 | 98 | 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_99891:Expr_L15_C0", "label": "expression", "type": "expression", "loc": [15, 52], "level": 0, "parent": null, "vector": [8, 0, 0.3418, 0.3878, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"Public logging API for test libraries.\n\nThis module provides a public API for writing messages to the log file\nand the console. Test libraries can use this API like `logger.info('My\nmessage')` instead of logging through the standard output like `print\n'*INFO* My message'`. In addition to a programmatic interface being\ncleaner to use, this API has a benefit that the log messages have\naccurate timestamps."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99891:Import_L54_C0", "label": "sys import sys", "type": "import", "loc": [54, 54], "level": 0, "parent": null, "vector": [1, 0, 0.551, 0.0102, 0, 0.66, 0.125, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99891:ImportFrom_L56_C0", "label": "from robot.output import LOGGER, Message", "type": "import", "loc": [56, 56], "level": 0, "parent": null, "vector": [1, 0, 0.5714, 0.0102, 0, 0.66, 0.25, 596, 0, 2, 0, 0, 596, 0, 0], "semantic": {"name": "robot.output", "arg_names": [], "import_names": ["LOGGER", "Message"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot.output import LOGGER, Message"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99891:FunctionDef_L59_C0", "label": "write", "type": "function", "loc": [59, 66], "level": 0, "parent": null, "vector": [2, 0, 0.6378, 0.0816, 0, 0.66, 0.375, 837, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": ["msg", "level", "html"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def write(msg, level, html=False):\n \"\"\"Writes the message to the log file using the given level.\n\n Valid log levels are `TRACE`, `DEBUG`, `INFO` and `WARN`. Instead\n of using this method, it is generally better to use the level\n specific methods such as `info` and `debug`.\n \"\"\"\n LOGGER.log_message(Message(msg, level, html))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99891:Expr_L60_C4", "label": "expression", "type": "expression", "loc": [60, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99891:FunctionDef_L59_C0", "vector": [8, 1, 0.6378, 0.0612, 1, 0.44, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Writes the message to the log file using the given level.\n\n Valid log levels are `TRACE`, `DEBUG`, `INFO` and `WARN`. Instead\n of using this method, it is generally better to use the level\n specific methods such as `info` and `debug`.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99891:Expr_L66_C4", "label": "log_message()", "type": "expression", "loc": [66, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99891:FunctionDef_L59_C0", "vector": [8, 1, 0.6735, 0.0102, 1, 0.44, 1.0, 87, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "log_message", "arg_names": [], "import_names": [], "rhs_call_name": "log_message", "annotation": ""}, "snippet": " LOGGER.log_message(Message(msg, level, html))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99891:FunctionDef_L68_C0", "label": "trace", "type": "function", "loc": [68, 70], "level": 0, "parent": null, "vector": [2, 0, 0.7041, 0.0306, 0, 0.66, 0.5, 211, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "trace", "arg_names": ["msg", "html"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def trace(msg, html=False):\n \"\"\"Writes the message to the log file with the TRACE level.\"\"\"\n write(msg, 'TRACE', html)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99891:Expr_L69_C4", "label": "expression", "type": "expression", "loc": [69, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99891:FunctionDef_L68_C0", "vector": [8, 1, 0.7041, 0.0102, 1, 0.82, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Writes the message to the log file with the TRACE level.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99891:Expr_L70_C4", "label": "write()", "type": "expression", "loc": [70, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99891:FunctionDef_L68_C0", "vector": [8, 1, 0.7143, 0.0102, 1, 0.82, 1.0, 837, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " write(msg, 'TRACE', html)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99891:FunctionDef_L72_C0", "label": "debug", "type": "function", "loc": [72, 74], "level": 0, "parent": null, "vector": [2, 0, 0.7449, 0.0306, 0, 0.66, 0.625, 924, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "debug", "arg_names": ["msg", "html"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def debug(msg, html=False):\n \"\"\"Writes the message to the log file with the DEBUG level.\"\"\"\n write(msg, 'DEBUG', html)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99891:Expr_L73_C4", "label": "expression", "type": "expression", "loc": [73, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99891:FunctionDef_L72_C0", "vector": [8, 1, 0.7449, 0.0102, 1, 0.45, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Writes the message to the log file with the DEBUG level.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99891:Expr_L74_C4", "label": "write()", "type": "expression", "loc": [74, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99891:FunctionDef_L72_C0", "vector": [8, 1, 0.7551, 0.0102, 1, 0.45, 1.0, 837, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " write(msg, 'DEBUG', html)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99891:FunctionDef_L76_C0", "label": "info", "type": "function", "loc": [76, 84], "level": 0, "parent": null, "vector": [2, 0, 0.8163, 0.0918, 0, 0.66, 0.75, 730, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "info", "arg_names": ["msg", "html", "also_console"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def info(msg, html=False, also_console=False):\n \"\"\"Writes the message to the log file with the INFO level.\n\n If `also_console` argument is set to `True`, the message is written\n both to the log file and to the console.\n \"\"\"\n write(msg, 'INFO', html)\n if also_console:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99891:Expr_L77_C4", "label": "expression", "type": "expression", "loc": [77, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99891:FunctionDef_L76_C0", "vector": [8, 1, 0.8061, 0.051, 1, 0.68, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Writes the message to the log file with the INFO level.\n\n If `also_console` argument is set to `True`, the message is written\n both to the log file and to the console.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99891:Expr_L82_C4", "label": "write()", "type": "expression", "loc": [82, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99891:FunctionDef_L76_C0", "vector": [8, 1, 0.8367, 0.0102, 1, 0.68, 0.5, 837, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " write(msg, 'INFO', html)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99891:If_L83_C4", "label": "if", "type": "if", "loc": [83, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99891:FunctionDef_L76_C0", "vector": [4, 1, 0.852, 0.0204, 1, 0.68, 1.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if also_console:\n console(msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99891:Expr_L84_C8", "label": "console()", "type": "expression", "loc": [84, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99891:If_L83_C4", "vector": [8, 2, 0.8571, 0.0102, 2, 0.78, 0.0, 423, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "console", "arg_names": [], "import_names": [], "rhs_call_name": "console", "annotation": ""}, "snippet": " console(msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99891:FunctionDef_L86_C0", "label": "warn", "type": "function", "loc": [86, 88], "level": 0, "parent": null, "vector": [2, 0, 0.8878, 0.0306, 0, 0.66, 0.875, 960, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "warn", "arg_names": ["msg", "html"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def warn(msg, html=False):\n \"\"\"Writes the message to the log file with the WARN level.\"\"\"\n write(msg, 'WARN', html)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99891:Expr_L87_C4", "label": "expression", "type": "expression", "loc": [87, 87], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99891:FunctionDef_L86_C0", "vector": [8, 1, 0.8878, 0.0102, 1, 0.04, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Writes the message to the log file with the WARN level.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99891:Expr_L88_C4", "label": "write()", "type": "expression", "loc": [88, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99891:FunctionDef_L86_C0", "vector": [8, 1, 0.898, 0.0102, 1, 0.04, 1.0, 837, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " write(msg, 'WARN', html)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99891:FunctionDef_L90_C0", "label": "console", "type": "function", "loc": [90, 98], "level": 0, "parent": null, "vector": [2, 0, 0.9592, 0.0918, 0, 0.66, 1.0, 423, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "console", "arg_names": ["msg", "newline"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def console(msg, newline=True):\n \"\"\"Writes the message to the console.\n\n If the `newline` argument is `True`, a newline character is automatically\n added to the message.\n \"\"\"\n if newline:\n msg += '\\n'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99891:Expr_L91_C4", "label": "expression", "type": "expression", "loc": [91, 95], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99891:FunctionDef_L90_C0", "vector": [8, 1, 0.949, 0.051, 1, 0.01, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Writes the message to the console.\n\n If the `newline` argument is `True`, a newline character is automatically\n added to the message.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99891:If_L96_C4", "label": "if", "type": "if", "loc": [96, 97], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99891:FunctionDef_L90_C0", "vector": [4, 1, 0.9847, 0.0204, 1, 0.01, 0.5, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if newline:\n msg += '\\n'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99891:Expr_L98_C4", "label": "write()", "type": "expression", "loc": [98, 98], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99891:FunctionDef_L90_C0", "vector": [8, 1, 1.0, 0.0102, 1, 0.01, 1.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " sys.__stdout__.write(msg)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99891:FunctionDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99891:Expr_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99891:FunctionDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99891:Expr_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99891:FunctionDef_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99891:Expr_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99891:FunctionDef_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99891:Expr_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99891:FunctionDef_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99891:Expr_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99891:FunctionDef_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99891:Expr_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99891:FunctionDef_L76_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99891:Expr_L77_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99891:FunctionDef_L76_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99891:Expr_L82_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99891:FunctionDef_L76_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99891:If_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99891:If_L83_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99891:Expr_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99891:FunctionDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99891:Expr_L87_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99891:FunctionDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99891:Expr_L88_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99891:FunctionDef_L90_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99891:Expr_L91_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99891:FunctionDef_L90_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99891:If_L96_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99891:FunctionDef_L90_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99891:Expr_L98_C4"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
| ajibawa-2023/Python-Code-Large/train/row_99892 | 0 | 13 | 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"] | [] | [] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import utils
# Return codes from Robot and Rebot.
# RC below 250 is the number of failed critical tests and exactly 250
# means that number or more such failures.
INFO_PRINTED = 251 # --help or --version
DATA_ERROR = 252 # Invalid data or cli args
STOPPED_BY_USER = 253 # KeyboardInterrupt or SystemExit
FRAMEWORK_ERROR = 255 # Unexpected error
class RobotError(Exception):
"""Base class for Robot Framework errors.
Do not raise this method but use more specific errors instead.
"""
def __init__(self, message=''):
Exception.__init__(self, message)
def __unicode__(self):
# Needed to handle exceptions w/ Unicode correctly on Python 2.5
return unicode(self.args[0]) if self.args else u''
class FrameworkError(RobotError):
"""Can be used when the core framework goes to unexpected state.
It is good to explicitly raise a FrameworkError if some framework
component is used incorrectly. This is pretty much same as
'Internal Error' and should of course never happen.
"""
class DataError(RobotError):
"""Used when the provided test data is invalid.
DataErrors are not be caught by keywords that run other keywords
(e.g. `Run Keyword And Expect Error`). Libraries should thus use
this exception with care.
"""
class TimeoutError(RobotError):
"""Used when a test or keyword timeout occurs.
This exception is handled specially so that execution of the
current test is always stopped immediately and it is not caught by
keywords executing other keywords (e.g. `Run Keyword And Expect
Error`). Libraries should thus NOT use this exception themselves.
"""
class Information(RobotError):
"""Used by argument parser with --help or --version."""
class ExecutionFailed(RobotError):
"""Used for communicating failures in test execution."""
def __init__(self, message, timeout=False, syntax=False, exit=False,
cont=False, exit_for_loop=False):
RobotError.__init__(self, utils.cut_long_message(message))
self.timeout = timeout
self.syntax = syntax
self.exit = exit
self.cont = cont
self.exit_for_loop = exit_for_loop
@property
def dont_cont(self):
return self.timeout or self.syntax or self.exit
# Python 2.6 property decorators would have nice `setter` attribute:
# http://docs.python.org/library/functions.html#property
cont = property(lambda self: self._cont and not self.dont_cont,
lambda self, cont: setattr(self, '_cont', cont))
def can_continue(self, teardown=False, templated=False, dry_run=False):
if dry_run:
return True
if self.dont_cont and not (teardown and self.syntax):
return False
if teardown or templated:
return True
return self.cont
def get_errors(self):
return [self]
class HandlerExecutionFailed(ExecutionFailed):
def __init__(self):
details = utils.ErrorDetails()
timeout = isinstance(details.error, TimeoutError)
syntax = isinstance(details.error, DataError)
exit = bool(getattr(details.error, 'ROBOT_EXIT_ON_FAILURE', False))
cont = bool(getattr(details.error, 'ROBOT_CONTINUE_ON_FAILURE', False))
exit_for_loop = bool(getattr(details.error, 'ROBOT_EXIT_FOR_LOOP', False))
ExecutionFailed.__init__(self, details.message, timeout, syntax,
exit, cont, exit_for_loop)
self.full_message = details.message
self.traceback = details.traceback
class ExecutionFailures(ExecutionFailed):
def __init__(self, errors):
msg = self._format_message([unicode(e) for e in errors])
ExecutionFailed.__init__(self, msg, **self._get_attrs(errors))
self._errors = errors
def _format_message(self, messages):
if len(messages) == 1:
return messages[0]
lines = ['Several failures occurred:'] \
+ ['%d) %s' % (i+1, m) for i, m in enumerate(messages)]
return '\n\n'.join(lines)
def _get_attrs(self, errors):
return {'timeout': any(err.timeout for err in errors),
'syntax': any(err.syntax for err in errors),
'exit': any(err.exit for err in errors),
'cont': all(err.cont for err in errors),
'exit_for_loop': all(err.exit_for_loop for err in errors)}
def get_errors(self):
return self._errors
class UserKeywordExecutionFailed(ExecutionFailures):
def __init__(self, run_errors=None, teardown_errors=None):
no_errors = ExecutionFailed('', cont=True, exit_for_loop=True)
ExecutionFailures.__init__(self, [run_errors or no_errors,
teardown_errors or no_errors])
if run_errors and not teardown_errors:
self._errors = run_errors.get_errors()
else:
self._errors = [self]
def _format_message(self, messages):
run_msg, td_msg = messages
if not td_msg:
return run_msg
if not run_msg:
return 'Keyword teardown failed:\n%s' % td_msg
return '%s\n\nAlso keyword teardown failed:\n%s' % (run_msg, td_msg)
class RemoteError(RobotError):
"""Used by Remote library to report remote errors."""
def __init__(self, message, traceback):
RobotError.__init__(self, message)
self.traceback = traceback
| ajibawa-2023/Python-Code-Large/train/row_99893 | 85 | 171 | 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_99893:Import_L15_C0", "label": "utils import utils", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.0877, 0.0058, 0, 0.66, 0.0, 970, 0, 1, 0, 0, 970, 0, 0], "semantic": {"name": "utils", "arg_names": [], "import_names": ["utils"], "rhs_call_name": "", "annotation": ""}, "snippet": "import utils"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:Assign_L21_C0", "label": "INFO_PRINTED =", "type": "assigned_variable", "loc": [21, 21], "level": 0, "parent": null, "vector": [14, 0, 0.1228, 0.0058, 0, 0.66, 0.0714, 755, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "INFO_PRINTED", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "INFO_PRINTED = 251 # --help or --version"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:Assign_L22_C0", "label": "DATA_ERROR =", "type": "assigned_variable", "loc": [22, 22], "level": 0, "parent": null, "vector": [14, 0, 0.1287, 0.0058, 0, 0.66, 0.1429, 189, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "DATA_ERROR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DATA_ERROR = 252 # Invalid data or cli args"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:Assign_L23_C0", "label": "STOPPED_BY_USER =", "type": "assigned_variable", "loc": [23, 23], "level": 0, "parent": null, "vector": [14, 0, 0.1345, 0.0058, 0, 0.66, 0.2143, 41, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "STOPPED_BY_USER", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "STOPPED_BY_USER = 253 # KeyboardInterrupt or SystemExit"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:Assign_L24_C0", "label": "FRAMEWORK_ERROR =", "type": "assigned_variable", "loc": [24, 24], "level": 0, "parent": null, "vector": [14, 0, 0.1404, 0.0058, 0, 0.66, 0.2857, 81, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "FRAMEWORK_ERROR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "FRAMEWORK_ERROR = 255 # Unexpected error"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:ClassDef_L27_C0", "label": "RobotError", "type": "class", "loc": [27, 37], "level": 0, "parent": null, "vector": [3, 0, 0.1871, 0.0643, 0, 0.66, 0.3571, 589, 0, 2, 0, 0, 645, 0, 2], "semantic": {"name": "RobotError", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class RobotError(Exception):\n \"\"\"Base class for Robot Framework errors.\n\n Do not raise this method but use more specific errors instead.\n \"\"\"\n def __init__(self, message=''):\n Exception.__init__(self, message)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:Expr_L28_C4", "label": "expression", "type": "expression", "loc": [28, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99893:ClassDef_L27_C0", "vector": [8, 1, 0.1725, 0.0234, 1, 0.0, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Base class for Robot Framework errors.\n\n Do not raise this method but use more specific errors instead.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L32_C4", "label": "__init__", "type": "function", "loc": [32, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99893:ClassDef_L27_C0", "vector": [2, 1, 0.1901, 0.0117, 1, 0.0, 0.5, 555, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "message"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, message=''):\n Exception.__init__(self, message)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:Expr_L33_C8", "label": "__init__()", "type": "expression", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L32_C4", "vector": [8, 2, 0.193, 0.0058, 2, 0.52, 0.0, 555, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " Exception.__init__(self, message)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L35_C4", "label": "__unicode__", "type": "function", "loc": [35, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99893:ClassDef_L27_C0", "vector": [2, 1, 0.2105, 0.0175, 1, 0.0, 1.0, 318, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "__unicode__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __unicode__(self):\n # Needed to handle exceptions w/ Unicode correctly on Python 2.5\n return unicode(self.args[0]) if self.args else u''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:Return_L37_C8", "label": "return", "type": "return", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L35_C4", "vector": [13, 2, 0.2164, 0.0058, 2, 0.08, 0.0, 0, 8, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return unicode(self.args[0]) if self.args else u''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:ClassDef_L40_C0", "label": "FrameworkError", "type": "class", "loc": [40, 46], "level": 0, "parent": null, "vector": [3, 0, 0.2515, 0.0409, 0, 0.66, 0.4286, 687, 0, 0, 0, 0, 589, 0, 0], "semantic": {"name": "FrameworkError", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class FrameworkError(RobotError):\n \"\"\"Can be used when the core framework goes to unexpected state.\n\n It is good to explicitly raise a FrameworkError if some framework\n component is used incorrectly. This is pretty much same as\n 'Internal Error' and should of course never happen.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:Expr_L41_C4", "label": "expression", "type": "expression", "loc": [41, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99893:ClassDef_L40_C0", "vector": [8, 1, 0.2544, 0.0351, 1, 0.36, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Can be used when the core framework goes to unexpected state.\n\n It is good to explicitly raise a FrameworkError if some framework\n component is used incorrectly. This is pretty much same as\n 'Internal Error' and should of course never happen.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:ClassDef_L49_C0", "label": "DataError", "type": "class", "loc": [49, 55], "level": 0, "parent": null, "vector": [3, 0, 0.3041, 0.0409, 0, 0.66, 0.5, 88, 0, 0, 0, 0, 589, 0, 0], "semantic": {"name": "DataError", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class DataError(RobotError):\n \"\"\"Used when the provided test data is invalid.\n\n DataErrors are not be caught by keywords that run other keywords\n (e.g. `Run Keyword And Expect Error`). Libraries should thus use\n this exception with care.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:Expr_L50_C4", "label": "expression", "type": "expression", "loc": [50, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99893:ClassDef_L49_C0", "vector": [8, 1, 0.307, 0.0351, 1, 0.36, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Used when the provided test data is invalid.\n\n DataErrors are not be caught by keywords that run other keywords\n (e.g. `Run Keyword And Expect Error`). Libraries should thus use\n this exception with care.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:ClassDef_L58_C0", "label": "TimeoutError", "type": "class", "loc": [58, 65], "level": 0, "parent": null, "vector": [3, 0, 0.3596, 0.0468, 0, 0.66, 0.5714, 823, 0, 0, 0, 0, 589, 0, 0], "semantic": {"name": "TimeoutError", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class TimeoutError(RobotError):\n \"\"\"Used when a test or keyword timeout occurs.\n\n This exception is handled specially so that execution of the\n current test is always stopped immediately and it is not caught by\n keywords executing other keywords (e.g. `Run Keyword And Expect\n Error`). Libraries should thus NOT use this exception themselves.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:Expr_L59_C4", "label": "expression", "type": "expression", "loc": [59, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99893:ClassDef_L58_C0", "vector": [8, 1, 0.3626, 0.0409, 1, 0.6, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Used when a test or keyword timeout occurs.\n\n This exception is handled specially so that execution of the\n current test is always stopped immediately and it is not caught by\n keywords executing other keywords (e.g. `Run Keyword And Expect\n Error`). Libraries should thus NOT use this exception themselves.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:ClassDef_L68_C0", "label": "Information", "type": "class", "loc": [68, 69], "level": 0, "parent": null, "vector": [3, 0, 0.4006, 0.0117, 0, 0.66, 0.6429, 83, 0, 0, 0, 0, 589, 0, 0], "semantic": {"name": "Information", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Information(RobotError):\n \"\"\"Used by argument parser with --help or --version.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:Expr_L69_C4", "label": "expression", "type": "expression", "loc": [69, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99893:ClassDef_L68_C0", "vector": [8, 1, 0.4035, 0.0058, 1, 0.49, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Used by argument parser with --help or --version.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:ClassDef_L72_C0", "label": "ExecutionFailed", "type": "class", "loc": [72, 103], "level": 0, "parent": null, "vector": [3, 0, 0.5117, 0.1871, 0, 0.66, 0.7143, 745, 0, 4, 0, 0, 589, 0, 4], "semantic": {"name": "ExecutionFailed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ExecutionFailed(RobotError):\n \"\"\"Used for communicating failures in test execution.\"\"\"\n\n def __init__(self, message, timeout=False, syntax=False, exit=False,\n cont=False, exit_for_loop=False):\n RobotError.__init__(self, utils.cut_long_message(message))\n self.timeout = timeout\n self.syntax = syntax"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:Expr_L73_C4", "label": "expression", "type": "expression", "loc": [73, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99893:ClassDef_L72_C0", "vector": [8, 1, 0.4269, 0.0058, 1, 0.84, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Used for communicating failures in test execution.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L75_C4", "label": "__init__", "type": "function", "loc": [75, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99893:ClassDef_L72_C0", "vector": [2, 1, 0.4591, 0.0468, 1, 0.84, 0.2, 555, 0, 7, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "message", "timeout", "syntax", "exit", "cont", "exit_for_loop"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, message, timeout=False, syntax=False, exit=False,\n cont=False, exit_for_loop=False):\n RobotError.__init__(self, utils.cut_long_message(message))\n self.timeout = timeout\n self.syntax = syntax\n self.exit = exit\n self.cont = cont\n self.exit_for_loop = exit_for_loop"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:Expr_L77_C8", "label": "__init__()", "type": "expression", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L75_C4", "vector": [8, 2, 0.4503, 0.0058, 2, 0.07, 0.0, 555, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " RobotError.__init__(self, utils.cut_long_message(message))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:Assign_L78_C8", "label": "self.timeout =", "type": "assigned_variable", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L75_C4", "vector": [14, 2, 0.4561, 0.0058, 2, 0.07, 0.2, 621, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.timeout", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.timeout = timeout"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:Assign_L79_C8", "label": "self.syntax =", "type": "assigned_variable", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L75_C4", "vector": [14, 2, 0.462, 0.0058, 2, 0.07, 0.4, 351, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.syntax", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.syntax = syntax"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:Assign_L80_C8", "label": "self.exit =", "type": "assigned_variable", "loc": [80, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L75_C4", "vector": [14, 2, 0.4678, 0.0058, 2, 0.07, 0.6, 569, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.exit", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.exit = exit"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:Assign_L81_C8", "label": "self.cont =", "type": "assigned_variable", "loc": [81, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L75_C4", "vector": [14, 2, 0.4737, 0.0058, 2, 0.07, 0.8, 836, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.cont", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.cont = cont"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:Assign_L82_C8", "label": "self.exit_for_loop =", "type": "assigned_variable", "loc": [82, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L75_C4", "vector": [14, 2, 0.4795, 0.0058, 2, 0.07, 1.0, 570, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.exit_for_loop", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.exit_for_loop = exit_for_loop"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L85_C4", "label": "dont_cont", "type": "function", "loc": [85, 86], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99893:ClassDef_L72_C0", "vector": [2, 1, 0.5, 0.0117, 1, 0.84, 0.4, 440, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "dont_cont", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def dont_cont(self):\n return self.timeout or self.syntax or self.exit"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:Return_L86_C8", "label": "return", "type": "return", "loc": [86, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L85_C4", "vector": [13, 2, 0.5029, 0.0058, 2, 0.21, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.timeout or self.syntax or self.exit"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:Assign_L90_C4", "label": "cont = property()", "type": "assigned_variable", "loc": [90, 91], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99893:ClassDef_L72_C0", "vector": [14, 1, 0.5292, 0.0117, 1, 0.84, 0.6, 729, 3, 2, 0, 0, 244, 10, 2], "semantic": {"name": "cont", "arg_names": [], "import_names": [], "rhs_call_name": "property", "annotation": ""}, "snippet": " cont = property(lambda self: self._cont and not self.dont_cont,\n lambda self, cont: setattr(self, '_cont', cont))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L93_C4", "label": "can_continue", "type": "function", "loc": [93, 100], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99893:ClassDef_L72_C0", "vector": [2, 1, 0.5643, 0.0468, 1, 0.84, 0.8, 152, 0, 4, 1, 0, 0, 0, 0], "semantic": {"name": "can_continue", "arg_names": ["self", "teardown", "templated", "dry_run"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def can_continue(self, teardown=False, templated=False, dry_run=False):\n if dry_run:\n return True\n if self.dont_cont and not (teardown and self.syntax):\n return False\n if teardown or templated:\n return True\n return self.cont"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:If_L94_C8", "label": "if", "type": "if", "loc": [94, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L93_C4", "vector": [4, 2, 0.5526, 0.0117, 2, 0.74, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if dry_run:\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:Return_L95_C12", "label": "return", "type": "return", "loc": [95, 95], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99893:If_L94_C8", "vector": [13, 3, 0.5556, 0.0058, 3, 0.35, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:If_L96_C8", "label": "if", "type": "if", "loc": [96, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L93_C4", "vector": [4, 2, 0.5643, 0.0117, 2, 0.74, 0.3333, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.dont_cont and not (teardown and self.syntax):\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:Return_L97_C12", "label": "return", "type": "return", "loc": [97, 97], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99893:If_L96_C8", "vector": [13, 3, 0.5673, 0.0058, 3, 0.08, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:If_L98_C8", "label": "if", "type": "if", "loc": [98, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L93_C4", "vector": [4, 2, 0.576, 0.0117, 2, 0.74, 0.6667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if teardown or templated:\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:Return_L99_C12", "label": "return", "type": "return", "loc": [99, 99], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99893:If_L98_C8", "vector": [13, 3, 0.5789, 0.0058, 3, 0.91, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:Return_L100_C8", "label": "return", "type": "return", "loc": [100, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L93_C4", "vector": [13, 2, 0.5848, 0.0058, 2, 0.74, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.cont"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L102_C4", "label": "get_errors", "type": "function", "loc": [102, 103], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99893:ClassDef_L72_C0", "vector": [2, 1, 0.5994, 0.0117, 1, 0.84, 1.0, 168, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "get_errors", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_errors(self):\n return [self]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:Return_L103_C8", "label": "return", "type": "return", "loc": [103, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L102_C4", "vector": [13, 2, 0.6023, 0.0058, 2, 0.66, 0.0, 0, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [self]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:ClassDef_L106_C0", "label": "HandlerExecutionFailed", "type": "class", "loc": [106, 118], "level": 0, "parent": null, "vector": [3, 0, 0.655, 0.076, 0, 0.66, 0.7857, 980, 0, 1, 0, 0, 745, 0, 10], "semantic": {"name": "HandlerExecutionFailed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class HandlerExecutionFailed(ExecutionFailed):\n\n def __init__(self):\n details = utils.ErrorDetails()\n timeout = isinstance(details.error, TimeoutError)\n syntax = isinstance(details.error, DataError)\n exit = bool(getattr(details.error, 'ROBOT_EXIT_ON_FAILURE', False))\n cont = bool(getattr(details.error, 'ROBOT_CONTINUE_ON_FAILURE', False))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L108_C4", "label": "__init__", "type": "function", "loc": [108, 118], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99893:ClassDef_L106_C0", "vector": [2, 1, 0.6608, 0.0643, 1, 0.47, 0.0, 555, 0, 1, 0, 0, 0, 0, 10], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self):\n details = utils.ErrorDetails()\n timeout = isinstance(details.error, TimeoutError)\n syntax = isinstance(details.error, DataError)\n exit = bool(getattr(details.error, 'ROBOT_EXIT_ON_FAILURE', False))\n cont = bool(getattr(details.error, 'ROBOT_CONTINUE_ON_FAILURE', False))\n exit_for_loop = bool(getattr(details.error, 'ROBOT_EXIT_FOR_LOOP', False))\n ExecutionFailed.__init__(self, details.message, timeout, syntax,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:Assign_L109_C8", "label": "details = ErrorDetails()", "type": "assigned_variable", "loc": [109, 109], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L108_C4", "vector": [14, 2, 0.6374, 0.0058, 2, 0.87, 0.0, 254, 3, 0, 0, 0, 879, 10, 1], "semantic": {"name": "details", "arg_names": [], "import_names": [], "rhs_call_name": "ErrorDetails", "annotation": ""}, "snippet": " details = utils.ErrorDetails()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:Assign_L110_C8", "label": "timeout = isinstance()", "type": "assigned_variable", "loc": [110, 110], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L108_C4", "vector": [14, 2, 0.6433, 0.0058, 2, 0.87, 0.125, 616, 3, 2, 0, 0, 552, 10, 1], "semantic": {"name": "timeout", "arg_names": [], "import_names": [], "rhs_call_name": "isinstance", "annotation": ""}, "snippet": " timeout = isinstance(details.error, TimeoutError)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:Assign_L111_C8", "label": "syntax = isinstance()", "type": "assigned_variable", "loc": [111, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L108_C4", "vector": [14, 2, 0.6491, 0.0058, 2, 0.87, 0.25, 826, 3, 2, 0, 0, 552, 10, 1], "semantic": {"name": "syntax", "arg_names": [], "import_names": [], "rhs_call_name": "isinstance", "annotation": ""}, "snippet": " syntax = isinstance(details.error, DataError)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:Assign_L112_C8", "label": "exit = bool()", "type": "assigned_variable", "loc": [112, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L108_C4", "vector": [14, 2, 0.655, 0.0058, 2, 0.87, 0.375, 436, 3, 1, 0, 0, 337, 10, 2], "semantic": {"name": "exit", "arg_names": [], "import_names": [], "rhs_call_name": "bool", "annotation": ""}, "snippet": " exit = bool(getattr(details.error, 'ROBOT_EXIT_ON_FAILURE', False))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:Assign_L113_C8", "label": "cont = bool()", "type": "assigned_variable", "loc": [113, 113], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L108_C4", "vector": [14, 2, 0.6608, 0.0058, 2, 0.87, 0.5, 729, 3, 1, 0, 0, 337, 10, 2], "semantic": {"name": "cont", "arg_names": [], "import_names": [], "rhs_call_name": "bool", "annotation": ""}, "snippet": " cont = bool(getattr(details.error, 'ROBOT_CONTINUE_ON_FAILURE', False))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:Assign_L114_C8", "label": "exit_for_loop = bool()", "type": "assigned_variable", "loc": [114, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L108_C4", "vector": [14, 2, 0.6667, 0.0058, 2, 0.87, 0.625, 168, 3, 1, 0, 0, 337, 10, 2], "semantic": {"name": "exit_for_loop", "arg_names": [], "import_names": [], "rhs_call_name": "bool", "annotation": ""}, "snippet": " exit_for_loop = bool(getattr(details.error, 'ROBOT_EXIT_FOR_LOOP', False))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:Expr_L115_C8", "label": "__init__()", "type": "expression", "loc": [115, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L108_C4", "vector": [8, 2, 0.6754, 0.0117, 2, 0.87, 0.75, 555, 3, 7, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " ExecutionFailed.__init__(self, details.message, timeout, syntax,\n exit, cont, exit_for_loop)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:Assign_L117_C8", "label": "self.full_message =", "type": "assigned_variable", "loc": [117, 117], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L108_C4", "vector": [14, 2, 0.6842, 0.0058, 2, 0.87, 0.875, 359, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.full_message", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.full_message = details.message"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:Assign_L118_C8", "label": "self.traceback =", "type": "assigned_variable", "loc": [118, 118], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L108_C4", "vector": [14, 2, 0.6901, 0.0058, 2, 0.87, 1.0, 966, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.traceback", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.traceback = details.traceback"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:ClassDef_L121_C0", "label": "ExecutionFailures", "type": "class", "loc": [121, 143], "level": 0, "parent": null, "vector": [3, 0, 0.7719, 0.1345, 0, 0.66, 0.8571, 95, 0, 4, 0, 0, 745, 0, 12], "semantic": {"name": "ExecutionFailures", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ExecutionFailures(ExecutionFailed):\n\n def __init__(self, errors):\n msg = self._format_message([unicode(e) for e in errors])\n ExecutionFailed.__init__(self, msg, **self._get_attrs(errors))\n self._errors = errors\n\n def _format_message(self, messages):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L123_C4", "label": "__init__", "type": "function", "loc": [123, 126], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99893:ClassDef_L121_C0", "vector": [2, 1, 0.7281, 0.0234, 1, 0.71, 0.0, 555, 0, 2, 0, 0, 0, 0, 4], "semantic": {"name": "__init__", "arg_names": ["self", "errors"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, errors):\n msg = self._format_message([unicode(e) for e in errors])\n ExecutionFailed.__init__(self, msg, **self._get_attrs(errors))\n self._errors = errors"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:Assign_L124_C8", "label": "msg = _format_message()", "type": "assigned_variable", "loc": [124, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L123_C4", "vector": [14, 2, 0.7251, 0.0058, 2, 0.66, 0.0, 712, 3, 1, 0, 0, 222, 10, 2], "semantic": {"name": "msg", "arg_names": [], "import_names": [], "rhs_call_name": "_format_message", "annotation": ""}, "snippet": " msg = self._format_message([unicode(e) for e in errors])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:Expr_L125_C8", "label": "__init__()", "type": "expression", "loc": [125, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L123_C4", "vector": [8, 2, 0.731, 0.0058, 2, 0.66, 0.5, 555, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " ExecutionFailed.__init__(self, msg, **self._get_attrs(errors))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:Assign_L126_C8", "label": "self._errors =", "type": "assigned_variable", "loc": [126, 126], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L123_C4", "vector": [14, 2, 0.7368, 0.0058, 2, 0.66, 1.0, 39, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._errors", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._errors = errors"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L128_C4", "label": "_format_message", "type": "function", "loc": [128, 133], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99893:ClassDef_L121_C0", "vector": [2, 1, 0.7632, 0.0351, 1, 0.71, 0.3333, 222, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "_format_message", "arg_names": ["self", "messages"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _format_message(self, messages):\n if len(messages) == 1:\n return messages[0]\n lines = ['Several failures occurred:'] \\\n + ['%d) %s' % (i+1, m) for i, m in enumerate(messages)]\n return '\\n\\n'.join(lines)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:If_L129_C8", "label": "if", "type": "if", "loc": [129, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L128_C4", "vector": [4, 2, 0.7573, 0.0117, 2, 0.85, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(messages) == 1:\n return messages[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:Return_L130_C12", "label": "return", "type": "return", "loc": [130, 130], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99893:If_L129_C8", "vector": [13, 3, 0.7602, 0.0058, 3, 0.74, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return messages[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:Assign_L131_C8", "label": "lines =", "type": "assigned_variable", "loc": [131, 132], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L128_C4", "vector": [14, 2, 0.769, 0.0117, 2, 0.85, 0.5, 73, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "lines", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " lines = ['Several failures occurred:'] \\\n + ['%d) %s' % (i+1, m) for i, m in enumerate(messages)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:Return_L133_C8", "label": "return", "type": "return", "loc": [133, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L128_C4", "vector": [13, 2, 0.7778, 0.0058, 2, 0.85, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '\\n\\n'.join(lines)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L135_C4", "label": "_get_attrs", "type": "function", "loc": [135, 140], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99893:ClassDef_L121_C0", "vector": [2, 1, 0.8041, 0.0351, 1, 0.71, 0.6667, 866, 0, 2, 1, 0, 0, 0, 5], "semantic": {"name": "_get_attrs", "arg_names": ["self", "errors"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_attrs(self, errors):\n return {'timeout': any(err.timeout for err in errors),\n 'syntax': any(err.syntax for err in errors),\n 'exit': any(err.exit for err in errors),\n 'cont': all(err.cont for err in errors),\n 'exit_for_loop': all(err.exit_for_loop for err in errors)}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:Return_L136_C8", "label": "return", "type": "return", "loc": [136, 140], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L135_C4", "vector": [13, 2, 0.807, 0.0292, 2, 0.47, 0.0, 0, 0, 0, 0, 0, 0, 6, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return {'timeout': any(err.timeout for err in errors),\n 'syntax': any(err.syntax for err in errors),\n 'exit': any(err.exit for err in errors),\n 'cont': all(err.cont for err in errors),\n 'exit_for_loop': all(err.exit_for_loop for err in errors)}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L142_C4", "label": "get_errors", "type": "function", "loc": [142, 143], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99893:ClassDef_L121_C0", "vector": [2, 1, 0.8333, 0.0117, 1, 0.71, 1.0, 168, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "get_errors", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_errors(self):\n return self._errors"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:Return_L143_C8", "label": "return", "type": "return", "loc": [143, 143], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L142_C4", "vector": [13, 2, 0.8363, 0.0058, 2, 0.95, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._errors"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:ClassDef_L146_C0", "label": "UserKeywordExecutionFailed", "type": "class", "loc": [146, 163], "level": 0, "parent": null, "vector": [3, 0, 0.9035, 0.1053, 0, 0.66, 0.9286, 611, 0, 2, 0, 0, 95, 0, 3], "semantic": {"name": "UserKeywordExecutionFailed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class UserKeywordExecutionFailed(ExecutionFailures):\n\n def __init__(self, run_errors=None, teardown_errors=None):\n no_errors = ExecutionFailed('', cont=True, exit_for_loop=True)\n ExecutionFailures.__init__(self, [run_errors or no_errors,\n teardown_errors or no_errors])\n if run_errors and not teardown_errors:\n self._errors = run_errors.get_errors()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L148_C4", "label": "__init__", "type": "function", "loc": [148, 155], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99893:ClassDef_L146_C0", "vector": [2, 1, 0.886, 0.0468, 1, 0.9, 0.0, 555, 0, 3, 0, 0, 0, 0, 3], "semantic": {"name": "__init__", "arg_names": ["self", "run_errors", "teardown_errors"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, run_errors=None, teardown_errors=None):\n no_errors = ExecutionFailed('', cont=True, exit_for_loop=True)\n ExecutionFailures.__init__(self, [run_errors or no_errors,\n teardown_errors or no_errors])\n if run_errors and not teardown_errors:\n self._errors = run_errors.get_errors()\n else:\n self._errors = [self]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:Assign_L149_C8", "label": "no_errors = ExecutionFailed()", "type": "assigned_variable", "loc": [149, 149], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L148_C4", "vector": [14, 2, 0.8713, 0.0058, 2, 0.4, 0.0, 240, 3, 3, 0, 0, 745, 10, 1], "semantic": {"name": "no_errors", "arg_names": [], "import_names": [], "rhs_call_name": "ExecutionFailed", "annotation": ""}, "snippet": " no_errors = ExecutionFailed('', cont=True, exit_for_loop=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:Expr_L150_C8", "label": "__init__()", "type": "expression", "loc": [150, 151], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L148_C4", "vector": [8, 2, 0.8801, 0.0117, 2, 0.4, 0.5, 555, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " ExecutionFailures.__init__(self, [run_errors or no_errors,\n teardown_errors or no_errors])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:If_L152_C8", "label": "if", "type": "if", "loc": [152, 155], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L148_C4", "vector": [4, 2, 0.8977, 0.0234, 2, 0.4, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if run_errors and not teardown_errors:\n self._errors = run_errors.get_errors()\n else:\n self._errors = [self]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:Assign_L153_C12", "label": "self._errors = get_errors()", "type": "assigned_variable", "loc": [153, 153], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99893:If_L152_C8", "vector": [14, 3, 0.8947, 0.0058, 3, 0.99, 0.0, 39, 3, 0, 0, 0, 168, 10, 1], "semantic": {"name": "self._errors", "arg_names": [], "import_names": [], "rhs_call_name": "get_errors", "annotation": ""}, "snippet": " self._errors = run_errors.get_errors()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:Assign_L155_C12", "label": "self._errors =", "type": "assigned_variable", "loc": [155, 155], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99893:If_L152_C8", "vector": [14, 3, 0.9064, 0.0058, 3, 0.99, 1.0, 39, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self._errors", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._errors = [self]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L157_C4", "label": "_format_message", "type": "function", "loc": [157, 163], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99893:ClassDef_L146_C0", "vector": [2, 1, 0.9357, 0.0409, 1, 0.9, 1.0, 222, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "_format_message", "arg_names": ["self", "messages"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _format_message(self, messages):\n run_msg, td_msg = messages\n if not td_msg:\n return run_msg\n if not run_msg:\n return 'Keyword teardown failed:\\n%s' % td_msg\n return '%s\\n\\nAlso keyword teardown failed:\\n%s' % (run_msg, td_msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:Assign_L158_C8", "label": "run_msg, td_msg =", "type": "assigned_variable", "loc": [158, 158], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L157_C4", "vector": [14, 2, 0.924, 0.0058, 2, 0.87, 0.0, 429, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "run_msg, td_msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " run_msg, td_msg = messages"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:If_L159_C8", "label": "if", "type": "if", "loc": [159, 160], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L157_C4", "vector": [4, 2, 0.9327, 0.0117, 2, 0.87, 0.3333, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not td_msg:\n return run_msg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:Return_L160_C12", "label": "return", "type": "return", "loc": [160, 160], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99893:If_L159_C8", "vector": [13, 3, 0.9357, 0.0058, 3, 0.49, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return run_msg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:If_L161_C8", "label": "if", "type": "if", "loc": [161, 162], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L157_C4", "vector": [4, 2, 0.9444, 0.0117, 2, 0.87, 0.6667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not run_msg:\n return 'Keyword teardown failed:\\n%s' % td_msg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:Return_L162_C12", "label": "return", "type": "return", "loc": [162, 162], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99893:If_L161_C8", "vector": [13, 3, 0.9474, 0.0058, 3, 0.3, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'Keyword teardown failed:\\n%s' % td_msg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:Return_L163_C8", "label": "return", "type": "return", "loc": [163, 163], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L157_C4", "vector": [13, 2, 0.9532, 0.0058, 2, 0.87, 1.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '%s\\n\\nAlso keyword teardown failed:\\n%s' % (run_msg, td_msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:ClassDef_L166_C0", "label": "RemoteError", "type": "class", "loc": [166, 171], "level": 0, "parent": null, "vector": [3, 0, 0.9854, 0.0351, 0, 0.66, 1.0, 356, 0, 1, 0, 0, 589, 0, 1], "semantic": {"name": "RemoteError", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class RemoteError(RobotError):\n \"\"\"Used by Remote library to report remote errors.\"\"\"\n\n def __init__(self, message, traceback):\n RobotError.__init__(self, message)\n self.traceback = traceback"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:Expr_L167_C4", "label": "expression", "type": "expression", "loc": [167, 167], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99893:ClassDef_L166_C0", "vector": [8, 1, 0.9766, 0.0058, 1, 0.32, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Used by Remote library to report remote errors.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L169_C4", "label": "__init__", "type": "function", "loc": [169, 171], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99893:ClassDef_L166_C0", "vector": [2, 1, 0.9942, 0.0175, 1, 0.32, 1.0, 555, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "message", "traceback"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, message, traceback):\n RobotError.__init__(self, message)\n self.traceback = traceback"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:Expr_L170_C8", "label": "__init__()", "type": "expression", "loc": [170, 170], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L169_C4", "vector": [8, 2, 0.9942, 0.0058, 2, 0.25, 0.0, 555, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " RobotError.__init__(self, message)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99893:Assign_L171_C8", "label": "self.traceback =", "type": "assigned_variable", "loc": [171, 171], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L169_C4", "vector": [14, 2, 1.0, 0.0058, 2, 0.25, 1.0, 966, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.traceback", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.traceback = traceback"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99893:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99893:Expr_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99893:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99893:Expr_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99893:ClassDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99893:Return_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99893:ClassDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99893:Expr_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99893:ClassDef_L49_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99893:Expr_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99893:ClassDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99893:Expr_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99893:ClassDef_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99893:Expr_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99893:ClassDef_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99893:Expr_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99893:ClassDef_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99893:Expr_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99893:Assign_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99893:Assign_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99893:Assign_L80_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99893:Assign_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99893:Assign_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99893:ClassDef_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L85_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99893:Return_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99893:ClassDef_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99893:Assign_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99893:ClassDef_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L93_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L93_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99893:If_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99893:If_L94_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99893:Return_L95_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L93_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99893:If_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99893:If_L96_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99893:Return_L97_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L93_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99893:If_L98_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99893:If_L98_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99893:Return_L99_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L93_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99893:Return_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99893:ClassDef_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L102_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99893:Return_L103_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99893:ClassDef_L106_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L108_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L108_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99893:Assign_L109_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L108_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99893:Assign_L110_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L108_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99893:Assign_L111_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L108_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99893:Assign_L112_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L108_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99893:Assign_L113_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L108_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99893:Assign_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L108_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99893:Expr_L115_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L108_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99893:Assign_L117_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L108_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99893:Assign_L118_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99893:ClassDef_L121_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L123_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L123_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99893:Assign_L124_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L123_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99893:Expr_L125_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L123_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99893:Assign_L126_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99893:ClassDef_L121_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L128_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L128_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99893:If_L129_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99893:If_L129_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99893:Return_L130_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L128_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99893:Assign_L131_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L128_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99893:Return_L133_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99893:ClassDef_L121_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L135_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L135_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99893:Return_L136_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99893:ClassDef_L121_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L142_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L142_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99893:Return_L143_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99893:ClassDef_L146_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L148_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L148_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99893:Assign_L149_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L148_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99893:Expr_L150_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L148_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99893:If_L152_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99893:If_L152_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99893:Assign_L153_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99893:If_L152_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99893:Assign_L155_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99893:ClassDef_L146_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L157_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L157_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99893:Assign_L158_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L157_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99893:If_L159_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99893:If_L159_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99893:Return_L160_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L157_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99893:If_L161_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99893:If_L161_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99893:Return_L162_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L157_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99893:Return_L163_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99893:ClassDef_L166_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99893:Expr_L167_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99893:ClassDef_L166_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L169_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L169_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99893:Expr_L170_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99893:FunctionDef_L169_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99893:Assign_L171_C8"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import os
from robot import utils
from robot.errors import DataError, FrameworkError
from robot.output import LOGGER
class _BaseSettings(object):
_cli_opts = {'Name' : ('name', None),
'Doc' : ('doc', None),
'Metadata' : ('metadata', []),
'TestNames' : ('test', []),
'SuiteNames' : ('suite', []),
'SetTag' : ('settag', []),
'Include' : ('include', []),
'Exclude' : ('exclude', []),
'Critical' : ('critical', None),
'NonCritical' : ('noncritical', None),
'OutputDir' : ('outputdir', '.'),
'Log' : ('log', 'log.html'),
'Report' : ('report', 'report.html'),
'Summary' : ('summary', 'NONE'),
'XUnitFile' : ('xunitfile', 'NONE'),
'SplitLog' : ('splitlog', False),
'SplitOutputs' : ('splitoutputs', -1),
'TimestampOutputs' : ('timestampoutputs', False),
'LogTitle' : ('logtitle', None),
'ReportTitle' : ('reporttitle', None),
'SummaryTitle' : ('summarytitle', None),
'ReportBackground' : ('reportbackground',
('#99FF66', '#99FF66', '#FF3333')),
'SuiteStatLevel' : ('suitestatlevel', -1),
'TagStatInclude' : ('tagstatinclude', []),
'TagStatExclude' : ('tagstatexclude', []),
'TagStatCombine' : ('tagstatcombine', []),
'TagDoc' : ('tagdoc', []),
'TagStatLink' : ('tagstatlink', []),
'NoStatusRC' : ('nostatusrc', False),
'RunEmptySuite' : ('runemptysuite', False),
'MonitorWidth' : ('monitorwidth', 78),
'MonitorColors' : ('monitorcolors', 'AUTO')}
_output_opts = ['Output', 'Log', 'Report', 'DebugFile', 'XUnitFile']
def __init__(self, options={}, log=True):
self._opts = {}
self._cli_opts.update(self._extra_cli_opts)
self._process_cli_opts(options, log)
if log: LOGGER.info('Settings:\n%s' % unicode(self))
def _process_cli_opts(self, opts, log):
for name, (cli_name, default) in self._cli_opts.items():
try:
value = opts[cli_name]
if value in [None, []]:
raise KeyError
except KeyError:
value = default
self[name] = self._process_value(name, value, log)
def __setitem__(self, name, value):
if name not in self._cli_opts:
raise KeyError("Non-existing settings '%s'" % name)
self._opts[name] = value
def _process_value(self, name, value, log):
if value == self._get_default_value(name):
return value
if name in ['Name', 'Doc', 'LogTitle', 'ReportTitle']:
if name == 'Doc': value = self._escape(value)
return value.replace('_', ' ')
if name in ['Metadata', 'TagDoc']:
if name == 'Metadata': value = [self._escape(v) for v in value]
return [self._process_metadata_or_tagdoc(v) for v in value]
if name in ['Include', 'Exclude']:
return [v.replace('AND', '&').replace('_', ' ') for v in value]
if name in self._output_opts and utils.eq(value, 'NONE'):
return 'NONE'
if name == 'OutputDir':
return utils.abspath(value)
if name in ['SuiteStatLevel', 'MonitorWidth']:
return self._convert_to_positive_integer_or_default(name, value)
if name in ['Listeners', 'VariableFiles']:
return [self._split_args_from_name(item) for item in value]
if name == 'ReportBackground':
return self._process_report_background(value)
if name == 'TagStatCombine':
return [self._process_tag_stat_combine(v) for v in value]
if name == 'TagStatLink':
return [v for v in [self._process_tag_stat_link(v) for v in value] if v]
if name == 'RemoveKeywords':
return value.upper()
if name in ['SplitOutputs', 'Summary', 'SummaryTitle']:
return self._removed_in_26(name, log)
return value
# TODO: Remove --splitoutputs, --summary, and --summarytitle in 2.7
def _removed_in_26(self, name, log):
start = {'SplitOutputs': 'Splitting outputs is',
'Summary': 'Summary reports are',
'SummaryTitle': 'Summary titles are'}[name]
option, default = self._cli_opts[name]
if log:
LOGGER.warn('%s not supported in Robot Framework 2.6 or newer and '
'--%s option will be removed altogether in version 2.7.'
% (start, option))
return default
def __getitem__(self, name):
if name not in self._cli_opts:
raise KeyError("Non-existing setting '%s'" % name)
if name in self._output_opts:
return self._get_output_file(name)
return self._opts[name]
def _get_output_file(self, type_):
"""Returns path of the requested output file and creates needed dirs.
`type_` can be 'Output', 'Log', 'Report', 'DebugFile' or 'XUnitFile'.
"""
name = self._opts[type_]
if self._outputfile_disabled(type_, name):
return 'NONE'
name = self._process_output_name(name, type_)
path = utils.abspath(os.path.join(self['OutputDir'], name))
self._create_output_dir(os.path.dirname(path), type_)
return path
def _process_output_name(self, name, type_):
base, ext = os.path.splitext(name)
if self['TimestampOutputs']:
base = '%s-%s' % (base, utils.get_start_timestamp('', '-', ''))
ext = self._get_output_extension(ext, type_)
return base + ext
def _get_output_extension(self, ext, type_):
if ext != '':
return ext
if type_ in ['Output', 'XUnitFile']:
return '.xml'
if type_ in ['Log', 'Report']:
return '.html'
if type_ == 'DebugFile':
return '.txt'
raise FrameworkError("Invalid output file type: %s" % type_)
def _create_output_dir(self, path, type_):
try:
if not os.path.exists(path):
os.makedirs(path)
except:
raise DataError("Can't create %s file's parent directory '%s': %s"
% (type_.lower(), path, utils.get_error_message()))
def _process_metadata_or_tagdoc(self, value):
value = value.replace('_', ' ')
if ':' in value:
return value.split(':', 1)
return value, ''
def _process_report_background(self, colors):
if colors.count(':') not in [1, 2]:
LOGGER.error("Invalid report background colors '%s'." % colors)
return self._get_default_value('ReportBackground')
colors = colors.split(':')
if len(colors) == 2:
return colors[0], colors[0], colors[1]
return tuple(colors)
def _process_tag_stat_combine(self, value):
for replwhat, replwith in [('_', ' '), ('AND', '&'),
('&', ' & '), ('NOT', ' NOT ')]:
value = value.replace(replwhat, replwith)
if ':' in value:
return value.rsplit(':', 1)
return value, ''
def _process_tag_stat_link(self, value):
tokens = value.split(':')
if len(tokens) >= 3:
return tokens[0], ':'.join(tokens[1:-1]), tokens[-1]
LOGGER.error("Invalid format for option '--tagstatlink'. "
"Expected 'tag:link:title' but got '%s'." % value)
return None
def _convert_to_positive_integer_or_default(self, name, value):
value = self._convert_to_integer(name, value)
return value if value > 0 else self._get_default_value(name)
def _convert_to_integer(self, name, value):
try:
return int(value)
except ValueError:
LOGGER.error("Option '--%s' expected integer value but got '%s'. "
"Default value used instead." % (name.lower(), value))
return self._get_default_value(name)
def _get_default_value(self, name):
return self._cli_opts[name][1]
def _split_args_from_name(self, name):
if ':' not in name or os.path.exists(name):
return name, []
args = name.split(':')
name = args.pop(0)
# Handle absolute Windows paths with arguments
if len(name) == 1 and args[0].startswith(('/', '\\')):
name = name + ':' + args.pop(0)
return name, args
def __contains__(self, setting):
return setting in self._cli_opts
def __unicode__(self):
return '\n'.join('%s: %s' % (name, self._opts[name])
for name in sorted(self._opts))
class RobotSettings(_BaseSettings):
_extra_cli_opts = {'Output' : ('output', 'output.xml'),
'LogLevel' : ('loglevel', 'INFO'),
'RunMode' : ('runmode', []),
'WarnOnSkipped' : ('warnonskippedfiles', False),
'Variables' : ('variable', []),
'VariableFiles' : ('variablefile', []),
'Listeners' : ('listener', []),
'DebugFile' : ('debugfile', 'NONE')}
def is_rebot_needed(self):
return not ('NONE' == self['Log'] == self['Report'] == self['XUnitFile'])
def get_rebot_datasource_and_settings(self):
datasource = self['Output']
settings = RebotSettings(log=False)
settings._opts.update(self._opts)
for name in ['Variables', 'VariableFiles', 'Listeners']:
del(settings._opts[name])
for name in ['Include', 'Exclude', 'TestNames', 'SuiteNames', 'Metadata']:
settings._opts[name] = []
for name in ['Output', 'RemoveKeywords']:
settings._opts[name] = 'NONE'
for name in ['Name', 'Doc']:
settings._opts[name] = None
settings._opts['LogLevel'] = 'TRACE'
return datasource, settings
def _outputfile_disabled(self, type_, name):
if name == 'NONE':
return True
return self._opts['Output'] == 'NONE' and type_ != 'DebugFile'
def _escape(self, value):
return utils.escape(value)
class RebotSettings(_BaseSettings):
_extra_cli_opts = {'Output' : ('output', 'NONE'),
'LogLevel' : ('loglevel', 'TRACE'),
'RemoveKeywords' : ('removekeywords', 'NONE'),
'StartTime' : ('starttime', 'N/A'),
'EndTime' : ('endtime', 'N/A')}
def _outputfile_disabled(self, type_, name):
return name == 'NONE'
def _escape(self, value):
return value
| ajibawa-2023/Python-Code-Large/train/row_99894 | 170 | 280 | 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_99894:Import_L15_C0", "label": "os import os", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.0536, 0.0036, 0, 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_99894:ImportFrom_L17_C0", "label": "from robot import utils", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.0607, 0.0036, 0, 0.66, 0.1667, 735, 0, 1, 0, 0, 735, 0, 0], "semantic": {"name": "robot", "arg_names": [], "import_names": ["utils"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot import utils"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:ImportFrom_L18_C0", "label": "from robot.errors import DataError, FrameworkError", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.0643, 0.0036, 0, 0.66, 0.3333, 299, 0, 2, 0, 0, 299, 0, 0], "semantic": {"name": "robot.errors", "arg_names": [], "import_names": ["DataError", "FrameworkError"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot.errors import DataError, FrameworkError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:ImportFrom_L19_C0", "label": "from robot.output import LOGGER", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.0679, 0.0036, 0, 0.66, 0.5, 596, 0, 1, 0, 0, 596, 0, 0], "semantic": {"name": "robot.output", "arg_names": [], "import_names": ["LOGGER"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot.output import LOGGER"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:ClassDef_L22_C0", "label": "_BaseSettings", "type": "class", "loc": [22, 229], "level": 0, "parent": null, "vector": [3, 0, 0.4482, 0.7429, 0, 0.66, 0.6667, 186, 0, 20, 0, 0, 186, 0, 69], "semantic": {"name": "_BaseSettings", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _BaseSettings(object):\n _cli_opts = {'Name' : ('name', None),\n 'Doc' : ('doc', None),\n 'Metadata' : ('metadata', []),\n 'TestNames' : ('test', []),\n 'SuiteNames' : ('suite', []),\n 'SetTag' : ('settag', []),\n 'Include' : ('include', []),"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Assign_L23_C4", "label": "_cli_opts =", "type": "assigned_variable", "loc": [23, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:ClassDef_L22_C0", "vector": [14, 1, 0.1393, 0.1179, 1, 0.89, 0.0, 16, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "_cli_opts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _cli_opts = {'Name' : ('name', None),\n 'Doc' : ('doc', None),\n 'Metadata' : ('metadata', []),\n 'TestNames' : ('test', []),\n 'SuiteNames' : ('suite', []),\n 'SetTag' : ('settag', []),\n 'Include' : ('include', []),\n 'Exclude' : ('exclude', []),"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Assign_L56_C4", "label": "_output_opts =", "type": "assigned_variable", "loc": [56, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:ClassDef_L22_C0", "vector": [14, 1, 0.2, 0.0036, 1, 0.89, 0.0476, 825, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "_output_opts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _output_opts = ['Output', 'Log', 'Report', 'DebugFile', 'XUnitFile']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L58_C4", "label": "__init__", "type": "function", "loc": [58, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:ClassDef_L22_C0", "vector": [2, 1, 0.2143, 0.0179, 1, 0.89, 0.0952, 555, 0, 3, 0, 0, 0, 0, 4], "semantic": {"name": "__init__", "arg_names": ["self", "options", "log"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, options={}, log=True):\n self._opts = {}\n self._cli_opts.update(self._extra_cli_opts)\n self._process_cli_opts(options, log)\n if log: LOGGER.info('Settings:\\n%s' % unicode(self))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Assign_L59_C8", "label": "self._opts =", "type": "assigned_variable", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L58_C4", "vector": [14, 2, 0.2107, 0.0036, 2, 0.74, 0.0, 137, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self._opts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._opts = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Expr_L60_C8", "label": "update()", "type": "expression", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L58_C4", "vector": [8, 2, 0.2143, 0.0036, 2, 0.74, 0.3333, 637, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " self._cli_opts.update(self._extra_cli_opts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Expr_L61_C8", "label": "_process_cli_opts()", "type": "expression", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L58_C4", "vector": [8, 2, 0.2179, 0.0036, 2, 0.74, 0.6667, 995, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_process_cli_opts", "arg_names": [], "import_names": [], "rhs_call_name": "_process_cli_opts", "annotation": ""}, "snippet": " self._process_cli_opts(options, log)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L62_C8", "label": "if", "type": "if", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L58_C4", "vector": [4, 2, 0.2214, 0.0036, 2, 0.74, 1.0, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if log: LOGGER.info('Settings:\\n%s' % unicode(self))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Expr_L62_C16", "label": "info()", "type": "expression", "loc": [62, 62], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L62_C8", "vector": [8, 3, 0.2214, 0.0036, 3, 0.39, 0.0, 730, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": " if log: LOGGER.info('Settings:\\n%s' % unicode(self))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L64_C4", "label": "_process_cli_opts", "type": "function", "loc": [64, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:ClassDef_L22_C0", "vector": [2, 1, 0.2429, 0.0321, 1, 0.89, 0.1429, 995, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "_process_cli_opts", "arg_names": ["self", "opts", "log"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _process_cli_opts(self, opts, log):\n for name, (cli_name, default) in self._cli_opts.items():\n try:\n value = opts[cli_name]\n if value in [None, []]:\n raise KeyError\n except KeyError:\n value = default"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:For_L65_C8", "label": "for name", "type": "for", "loc": [65, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L64_C4", "vector": [6, 2, 0.2446, 0.0286, 2, 0.24, 0.0, 57, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for name, (cli_name, default) in self._cli_opts.items():\n try:\n value = opts[cli_name]\n if value in [None, []]:\n raise KeyError\n except KeyError:\n value = default\n self[name] = self._process_value(name, value, log)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Try_L66_C12", "label": "try", "type": "try", "loc": [66, 71], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:For_L65_C8", "vector": [7, 3, 0.2446, 0.0214, 3, 0.52, 0.0, 0, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n value = opts[cli_name]\n if value in [None, []]:\n raise KeyError\n except KeyError:\n value = default"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Assign_L67_C16", "label": "value =", "type": "assigned_variable", "loc": [67, 67], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:Try_L66_C12", "vector": [14, 4, 0.2393, 0.0036, 4, 0.96, 0.0, 441, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " value = opts[cli_name]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L68_C16", "label": "if", "type": "if", "loc": [68, 69], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:Try_L66_C12", "vector": [4, 4, 0.2446, 0.0071, 4, 0.96, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if value in [None, []]:\n raise KeyError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Assign_L71_C16", "label": "value =", "type": "assigned_variable", "loc": [71, 71], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:Try_L66_C12", "vector": [14, 4, 0.2536, 0.0036, 4, 0.96, 0.0, 441, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " value = default"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Assign_L72_C12", "label": " = _process_value()", "type": "assigned_variable", "loc": [72, 72], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:For_L65_C8", "vector": [14, 3, 0.2571, 0.0036, 3, 0.52, 1.0, 0, 3, 3, 0, 0, 418, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "_process_value", "annotation": ""}, "snippet": " self[name] = self._process_value(name, value, log)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L74_C4", "label": "__setitem__", "type": "function", "loc": [74, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:ClassDef_L22_C0", "vector": [2, 1, 0.2696, 0.0143, 1, 0.89, 0.1905, 343, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "__setitem__", "arg_names": ["self", "name", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __setitem__(self, name, value):\n if name not in self._cli_opts:\n raise KeyError(\"Non-existing settings '%s'\" % name)\n self._opts[name] = value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L75_C8", "label": "if", "type": "if", "loc": [75, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L74_C4", "vector": [4, 2, 0.2696, 0.0071, 2, 0.41, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if name not in self._cli_opts:\n raise KeyError(\"Non-existing settings '%s'\" % name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Assign_L77_C8", "label": "assign", "type": "assigned_variable", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L74_C4", "vector": [14, 2, 0.275, 0.0036, 2, 0.41, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._opts[name] = value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L79_C4", "label": "_process_value", "type": "function", "loc": [79, 108], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:ClassDef_L22_C0", "vector": [2, 1, 0.3339, 0.1071, 1, 0.89, 0.2381, 418, 0, 4, 1, 0, 0, 0, 16], "semantic": {"name": "_process_value", "arg_names": ["self", "name", "value", "log"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _process_value(self, name, value, log):\n if value == self._get_default_value(name):\n return value\n if name in ['Name', 'Doc', 'LogTitle', 'ReportTitle']:\n if name == 'Doc': value = self._escape(value)\n return value.replace('_', ' ')\n if name in ['Metadata', 'TagDoc']:\n if name == 'Metadata': value = [self._escape(v) for v in value]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L80_C8", "label": "if", "type": "if", "loc": [80, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L79_C4", "vector": [4, 2, 0.2875, 0.0071, 2, 0.33, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if value == self._get_default_value(name):\n return value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L81_C12", "label": "return", "type": "return", "loc": [81, 81], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L80_C8", "vector": [13, 3, 0.2893, 0.0036, 3, 0.85, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L82_C8", "label": "if", "type": "if", "loc": [82, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L79_C4", "vector": [4, 2, 0.2964, 0.0107, 2, 0.33, 0.0769, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if name in ['Name', 'Doc', 'LogTitle', 'ReportTitle']:\n if name == 'Doc': value = self._escape(value)\n return value.replace('_', ' ')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L83_C12", "label": "if", "type": "if", "loc": [83, 83], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L82_C8", "vector": [4, 3, 0.2964, 0.0036, 3, 0.07, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if name == 'Doc': value = self._escape(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Assign_L83_C30", "label": "value = _escape()", "type": "assigned_variable", "loc": [83, 83], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L83_C12", "vector": [14, 4, 0.2964, 0.0036, 4, 0.76, 0.0, 441, 3, 1, 0, 0, 328, 10, 1], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "_escape", "annotation": ""}, "snippet": " if name == 'Doc': value = self._escape(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L84_C12", "label": "return", "type": "return", "loc": [84, 84], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L82_C8", "vector": [13, 3, 0.3, 0.0036, 3, 0.07, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return value.replace('_', ' ')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L85_C8", "label": "if", "type": "if", "loc": [85, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L79_C4", "vector": [4, 2, 0.3071, 0.0107, 2, 0.33, 0.1538, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if name in ['Metadata', 'TagDoc']:\n if name == 'Metadata': value = [self._escape(v) for v in value]\n return [self._process_metadata_or_tagdoc(v) for v in value]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L86_C12", "label": "if", "type": "if", "loc": [86, 86], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L85_C8", "vector": [4, 3, 0.3071, 0.0036, 3, 0.24, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if name == 'Metadata': value = [self._escape(v) for v in value]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Assign_L86_C35", "label": "value =", "type": "assigned_variable", "loc": [86, 86], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L86_C12", "vector": [14, 4, 0.3071, 0.0036, 4, 0.54, 0.0, 441, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if name == 'Metadata': value = [self._escape(v) for v in value]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L87_C12", "label": "return", "type": "return", "loc": [87, 87], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L85_C8", "vector": [13, 3, 0.3107, 0.0036, 3, 0.24, 1.0, 0, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [self._process_metadata_or_tagdoc(v) for v in value]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L88_C8", "label": "if", "type": "if", "loc": [88, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L79_C4", "vector": [4, 2, 0.3161, 0.0071, 2, 0.33, 0.2308, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if name in ['Include', 'Exclude']:\n return [v.replace('AND', '&').replace('_', ' ') for v in value]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L89_C12", "label": "return", "type": "return", "loc": [89, 89], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L88_C8", "vector": [13, 3, 0.3179, 0.0036, 3, 0.82, 0.0, 0, 5, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [v.replace('AND', '&').replace('_', ' ') for v in value]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L90_C8", "label": "if", "type": "if", "loc": [90, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L79_C4", "vector": [4, 2, 0.3232, 0.0071, 2, 0.33, 0.3077, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if name in self._output_opts and utils.eq(value, 'NONE'):\n return 'NONE'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L91_C12", "label": "return", "type": "return", "loc": [91, 91], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L90_C8", "vector": [13, 3, 0.325, 0.0036, 3, 0.81, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'NONE'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L92_C8", "label": "if", "type": "if", "loc": [92, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L79_C4", "vector": [4, 2, 0.3304, 0.0071, 2, 0.33, 0.3846, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if name == 'OutputDir':\n return utils.abspath(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L93_C12", "label": "return", "type": "return", "loc": [93, 93], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L92_C8", "vector": [13, 3, 0.3321, 0.0036, 3, 0.72, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return utils.abspath(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L94_C8", "label": "if", "type": "if", "loc": [94, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L79_C4", "vector": [4, 2, 0.3375, 0.0071, 2, 0.33, 0.4615, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if name in ['SuiteStatLevel', 'MonitorWidth']:\n return self._convert_to_positive_integer_or_default(name, value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L95_C12", "label": "return", "type": "return", "loc": [95, 95], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L94_C8", "vector": [13, 3, 0.3393, 0.0036, 3, 0.87, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._convert_to_positive_integer_or_default(name, value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L96_C8", "label": "if", "type": "if", "loc": [96, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L79_C4", "vector": [4, 2, 0.3446, 0.0071, 2, 0.33, 0.5385, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if name in ['Listeners', 'VariableFiles']:\n return [self._split_args_from_name(item) for item in value]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L97_C12", "label": "return", "type": "return", "loc": [97, 97], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L96_C8", "vector": [13, 3, 0.3464, 0.0036, 3, 0.44, 0.0, 0, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [self._split_args_from_name(item) for item in value]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L98_C8", "label": "if", "type": "if", "loc": [98, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L79_C4", "vector": [4, 2, 0.3518, 0.0071, 2, 0.33, 0.6154, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if name == 'ReportBackground':\n return self._process_report_background(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L99_C12", "label": "return", "type": "return", "loc": [99, 99], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L98_C8", "vector": [13, 3, 0.3536, 0.0036, 3, 0.42, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._process_report_background(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L100_C8", "label": "if", "type": "if", "loc": [100, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L79_C4", "vector": [4, 2, 0.3589, 0.0071, 2, 0.33, 0.6923, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if name == 'TagStatCombine':\n return [self._process_tag_stat_combine(v) for v in value]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L101_C12", "label": "return", "type": "return", "loc": [101, 101], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L100_C8", "vector": [13, 3, 0.3607, 0.0036, 3, 0.58, 0.0, 0, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [self._process_tag_stat_combine(v) for v in value]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L102_C8", "label": "if", "type": "if", "loc": [102, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L79_C4", "vector": [4, 2, 0.3661, 0.0071, 2, 0.33, 0.7692, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if name == 'TagStatLink':\n return [v for v in [self._process_tag_stat_link(v) for v in value] if v]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L103_C12", "label": "return", "type": "return", "loc": [103, 103], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L102_C8", "vector": [13, 3, 0.3679, 0.0036, 3, 0.62, 0.0, 0, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [v for v in [self._process_tag_stat_link(v) for v in value] if v]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L104_C8", "label": "if", "type": "if", "loc": [104, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L79_C4", "vector": [4, 2, 0.3732, 0.0071, 2, 0.33, 0.8462, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if name == 'RemoveKeywords':\n return value.upper()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L105_C12", "label": "return", "type": "return", "loc": [105, 105], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L104_C8", "vector": [13, 3, 0.375, 0.0036, 3, 0.4, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return value.upper()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L106_C8", "label": "if", "type": "if", "loc": [106, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L79_C4", "vector": [4, 2, 0.3804, 0.0071, 2, 0.33, 0.9231, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if name in ['SplitOutputs', 'Summary', 'SummaryTitle']:\n return self._removed_in_26(name, log)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L107_C12", "label": "return", "type": "return", "loc": [107, 107], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L106_C8", "vector": [13, 3, 0.3821, 0.0036, 3, 0.49, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._removed_in_26(name, log)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L108_C8", "label": "return", "type": "return", "loc": [108, 108], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L79_C4", "vector": [13, 2, 0.3857, 0.0036, 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 value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L111_C4", "label": "_removed_in_26", "type": "function", "loc": [111, 120], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:ClassDef_L22_C0", "vector": [2, 1, 0.4125, 0.0357, 1, 0.89, 0.2857, 494, 0, 3, 1, 0, 0, 0, 1], "semantic": {"name": "_removed_in_26", "arg_names": ["self", "name", "log"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _removed_in_26(self, name, log):\n start = {'SplitOutputs': 'Splitting outputs is',\n 'Summary': 'Summary reports are',\n 'SummaryTitle': 'Summary titles are'}[name]\n option, default = self._cli_opts[name]\n if log:\n LOGGER.warn('%s not supported in Robot Framework 2.6 or newer and '\n '--%s option will be removed altogether in version 2.7.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Assign_L112_C8", "label": "start =", "type": "assigned_variable", "loc": [112, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L111_C4", "vector": [14, 2, 0.4036, 0.0107, 2, 0.92, 0.0, 511, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " start = {'SplitOutputs': 'Splitting outputs is',\n 'Summary': 'Summary reports are',\n 'SummaryTitle': 'Summary titles are'}[name]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Assign_L115_C8", "label": "option, default =", "type": "assigned_variable", "loc": [115, 115], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L111_C4", "vector": [14, 2, 0.4107, 0.0036, 2, 0.92, 0.3333, 558, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "option, default", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " option, default = self._cli_opts[name]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L116_C8", "label": "if", "type": "if", "loc": [116, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L111_C4", "vector": [4, 2, 0.4196, 0.0143, 2, 0.92, 0.6667, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if log:\n LOGGER.warn('%s not supported in Robot Framework 2.6 or newer and '\n '--%s option will be removed altogether in version 2.7.'\n % (start, option))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Expr_L117_C12", "label": "warn()", "type": "expression", "loc": [117, 119], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L116_C8", "vector": [8, 3, 0.4214, 0.0107, 3, 0.75, 0.0, 960, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "warn", "arg_names": [], "import_names": [], "rhs_call_name": "warn", "annotation": ""}, "snippet": " LOGGER.warn('%s not supported in Robot Framework 2.6 or newer and '\n '--%s option will be removed altogether in version 2.7.'\n % (start, option))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L120_C8", "label": "return", "type": "return", "loc": [120, 120], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L111_C4", "vector": [13, 2, 0.4286, 0.0036, 2, 0.92, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return default"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L122_C4", "label": "__getitem__", "type": "function", "loc": [122, 127], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:ClassDef_L22_C0", "vector": [2, 1, 0.4446, 0.0214, 1, 0.89, 0.3333, 698, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "__getitem__", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __getitem__(self, name):\n if name not in self._cli_opts:\n raise KeyError(\"Non-existing setting '%s'\" % name)\n if name in self._output_opts:\n return self._get_output_file(name)\n return self._opts[name]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L123_C8", "label": "if", "type": "if", "loc": [123, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L122_C4", "vector": [4, 2, 0.4411, 0.0071, 2, 0.51, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if name not in self._cli_opts:\n raise KeyError(\"Non-existing setting '%s'\" % name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L125_C8", "label": "if", "type": "if", "loc": [125, 126], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L122_C4", "vector": [4, 2, 0.4482, 0.0071, 2, 0.51, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if name in self._output_opts:\n return self._get_output_file(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L126_C12", "label": "return", "type": "return", "loc": [126, 126], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L125_C8", "vector": [13, 3, 0.45, 0.0036, 3, 0.89, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._get_output_file(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L127_C8", "label": "return", "type": "return", "loc": [127, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L122_C4", "vector": [13, 2, 0.4536, 0.0036, 2, 0.51, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._opts[name]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L129_C4", "label": "_get_output_file", "type": "function", "loc": [129, 140], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:ClassDef_L22_C0", "vector": [2, 1, 0.4804, 0.0429, 1, 0.89, 0.381, 200, 0, 2, 1, 0, 0, 0, 6], "semantic": {"name": "_get_output_file", "arg_names": ["self", "type_"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_output_file(self, type_):\n \"\"\"Returns path of the requested output file and creates needed dirs.\n\n `type_` can be 'Output', 'Log', 'Report', 'DebugFile' or 'XUnitFile'.\n \"\"\"\n name = self._opts[type_]\n if self._outputfile_disabled(type_, name):\n return 'NONE'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Expr_L130_C8", "label": "expression", "type": "expression", "loc": [130, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L129_C4", "vector": [8, 2, 0.4696, 0.0143, 2, 0.22, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Returns path of the requested output file and creates needed dirs.\n\n `type_` can be 'Output', 'Log', 'Report', 'DebugFile' or 'XUnitFile'.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Assign_L134_C8", "label": "name =", "type": "assigned_variable", "loc": [134, 134], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L129_C4", "vector": [14, 2, 0.4786, 0.0036, 2, 0.22, 0.1667, 57, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " name = self._opts[type_]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L135_C8", "label": "if", "type": "if", "loc": [135, 136], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L129_C4", "vector": [4, 2, 0.4839, 0.0071, 2, 0.22, 0.3333, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._outputfile_disabled(type_, name):\n return 'NONE'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L136_C12", "label": "return", "type": "return", "loc": [136, 136], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L135_C8", "vector": [13, 3, 0.4857, 0.0036, 3, 0.46, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'NONE'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Assign_L137_C8", "label": "name = _process_output_name()", "type": "assigned_variable", "loc": [137, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L129_C4", "vector": [14, 2, 0.4893, 0.0036, 2, 0.22, 0.5, 57, 3, 2, 0, 0, 596, 10, 1], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "_process_output_name", "annotation": ""}, "snippet": " name = self._process_output_name(name, type_)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Assign_L138_C8", "label": "path = abspath()", "type": "assigned_variable", "loc": [138, 138], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L129_C4", "vector": [14, 2, 0.4929, 0.0036, 2, 0.22, 0.6667, 358, 3, 1, 0, 0, 142, 10, 2], "semantic": {"name": "path", "arg_names": [], "import_names": [], "rhs_call_name": "abspath", "annotation": ""}, "snippet": " path = utils.abspath(os.path.join(self['OutputDir'], name))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Expr_L139_C8", "label": "_create_output_dir()", "type": "expression", "loc": [139, 139], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L129_C4", "vector": [8, 2, 0.4964, 0.0036, 2, 0.22, 0.8333, 621, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "_create_output_dir", "arg_names": [], "import_names": [], "rhs_call_name": "_create_output_dir", "annotation": ""}, "snippet": " self._create_output_dir(os.path.dirname(path), type_)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L140_C8", "label": "return", "type": "return", "loc": [140, 140], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L129_C4", "vector": [13, 2, 0.5, 0.0036, 2, 0.22, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return path"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L142_C4", "label": "_process_output_name", "type": "function", "loc": [142, 147], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:ClassDef_L22_C0", "vector": [2, 1, 0.5161, 0.0214, 1, 0.89, 0.4286, 596, 0, 3, 1, 0, 0, 0, 3], "semantic": {"name": "_process_output_name", "arg_names": ["self", "name", "type_"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _process_output_name(self, name, type_):\n base, ext = os.path.splitext(name)\n if self['TimestampOutputs']:\n base = '%s-%s' % (base, utils.get_start_timestamp('', '-', ''))\n ext = self._get_output_extension(ext, type_)\n return base + ext"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Assign_L143_C8", "label": "base, ext = splitext()", "type": "assigned_variable", "loc": [143, 143], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L142_C4", "vector": [14, 2, 0.5107, 0.0036, 2, 0.92, 0.0, 46, 3, 1, 0, 0, 622, 10, 1], "semantic": {"name": "base, ext", "arg_names": [], "import_names": [], "rhs_call_name": "splitext", "annotation": ""}, "snippet": " base, ext = os.path.splitext(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L144_C8", "label": "if", "type": "if", "loc": [144, 145], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L142_C4", "vector": [4, 2, 0.5161, 0.0071, 2, 0.92, 0.3333, 0, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self['TimestampOutputs']:\n base = '%s-%s' % (base, utils.get_start_timestamp('', '-', ''))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Assign_L145_C12", "label": "base =", "type": "assigned_variable", "loc": [145, 145], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L144_C8", "vector": [14, 3, 0.5179, 0.0036, 3, 0.13, 0.0, 47, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "base", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " base = '%s-%s' % (base, utils.get_start_timestamp('', '-', ''))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Assign_L146_C8", "label": "ext = _get_output_extension()", "type": "assigned_variable", "loc": [146, 146], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L142_C4", "vector": [14, 2, 0.5214, 0.0036, 2, 0.92, 0.6667, 916, 3, 2, 0, 0, 832, 10, 1], "semantic": {"name": "ext", "arg_names": [], "import_names": [], "rhs_call_name": "_get_output_extension", "annotation": ""}, "snippet": " ext = self._get_output_extension(ext, type_)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L147_C8", "label": "return", "type": "return", "loc": [147, 147], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L142_C4", "vector": [13, 2, 0.525, 0.0036, 2, 0.92, 1.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return base + ext"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L149_C4", "label": "_get_output_extension", "type": "function", "loc": [149, 158], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:ClassDef_L22_C0", "vector": [2, 1, 0.5482, 0.0357, 1, 0.89, 0.4762, 832, 0, 3, 1, 0, 0, 0, 1], "semantic": {"name": "_get_output_extension", "arg_names": ["self", "ext", "type_"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_output_extension(self, ext, type_):\n if ext != '':\n return ext\n if type_ in ['Output', 'XUnitFile']:\n return '.xml'\n if type_ in ['Log', 'Report']:\n return '.html'\n if type_ == 'DebugFile':"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L150_C8", "label": "if", "type": "if", "loc": [150, 151], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L149_C4", "vector": [4, 2, 0.5375, 0.0071, 2, 0.55, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if ext != '':\n return ext"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L151_C12", "label": "return", "type": "return", "loc": [151, 151], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L150_C8", "vector": [13, 3, 0.5393, 0.0036, 3, 0.34, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ext"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L152_C8", "label": "if", "type": "if", "loc": [152, 153], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L149_C4", "vector": [4, 2, 0.5446, 0.0071, 2, 0.55, 0.3333, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if type_ in ['Output', 'XUnitFile']:\n return '.xml'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L153_C12", "label": "return", "type": "return", "loc": [153, 153], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L152_C8", "vector": [13, 3, 0.5464, 0.0036, 3, 0.67, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '.xml'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L154_C8", "label": "if", "type": "if", "loc": [154, 155], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L149_C4", "vector": [4, 2, 0.5518, 0.0071, 2, 0.55, 0.6667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if type_ in ['Log', 'Report']:\n return '.html'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L155_C12", "label": "return", "type": "return", "loc": [155, 155], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L154_C8", "vector": [13, 3, 0.5536, 0.0036, 3, 0.01, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '.html'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L156_C8", "label": "if", "type": "if", "loc": [156, 157], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L149_C4", "vector": [4, 2, 0.5589, 0.0071, 2, 0.55, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if type_ == 'DebugFile':\n return '.txt'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L157_C12", "label": "return", "type": "return", "loc": [157, 157], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L156_C8", "vector": [13, 3, 0.5607, 0.0036, 3, 0.4, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '.txt'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L160_C4", "label": "_create_output_dir", "type": "function", "loc": [160, 166], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:ClassDef_L22_C0", "vector": [2, 1, 0.5821, 0.025, 1, 0.89, 0.5238, 621, 0, 3, 0, 0, 0, 0, 5], "semantic": {"name": "_create_output_dir", "arg_names": ["self", "path", "type_"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _create_output_dir(self, path, type_):\n try:\n if not os.path.exists(path):\n os.makedirs(path)\n except:\n raise DataError(\"Can't create %s file's parent directory '%s': %s\"\n % (type_.lower(), path, utils.get_error_message()))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Try_L161_C8", "label": "try", "type": "try", "loc": [161, 166], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L160_C4", "vector": [7, 2, 0.5839, 0.0214, 2, 0.54, 0.0, 0, 0, 1, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n if not os.path.exists(path):\n os.makedirs(path)\n except:\n raise DataError(\"Can't create %s file's parent directory '%s': %s\"\n % (type_.lower(), path, utils.get_error_message()))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L162_C12", "label": "if", "type": "if", "loc": [162, 163], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:Try_L161_C8", "vector": [4, 3, 0.5804, 0.0071, 3, 0.44, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not os.path.exists(path):\n os.makedirs(path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Expr_L163_C16", "label": "makedirs()", "type": "expression", "loc": [163, 163], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L162_C12", "vector": [8, 4, 0.5821, 0.0036, 4, 0.12, 0.0, 349, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "makedirs", "arg_names": [], "import_names": [], "rhs_call_name": "makedirs", "annotation": ""}, "snippet": " os.makedirs(path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L168_C4", "label": "_process_metadata_or_tagdoc", "type": "function", "loc": [168, 172], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:ClassDef_L22_C0", "vector": [2, 1, 0.6071, 0.0179, 1, 0.89, 0.5714, 698, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "_process_metadata_or_tagdoc", "arg_names": ["self", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _process_metadata_or_tagdoc(self, value):\n value = value.replace('_', ' ')\n if ':' in value:\n return value.split(':', 1)\n return value, ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Assign_L169_C8", "label": "value = replace()", "type": "assigned_variable", "loc": [169, 169], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L168_C4", "vector": [14, 2, 0.6036, 0.0036, 2, 0.73, 0.0, 441, 3, 2, 0, 0, 293, 10, 1], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "replace", "annotation": ""}, "snippet": " value = value.replace('_', ' ')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L170_C8", "label": "if", "type": "if", "loc": [170, 171], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L168_C4", "vector": [4, 2, 0.6089, 0.0071, 2, 0.73, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if ':' in value:\n return value.split(':', 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L171_C12", "label": "return", "type": "return", "loc": [171, 171], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L170_C8", "vector": [13, 3, 0.6107, 0.0036, 3, 0.02, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return value.split(':', 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L172_C8", "label": "return", "type": "return", "loc": [172, 172], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L168_C4", "vector": [13, 2, 0.6143, 0.0036, 2, 0.73, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return value, ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L174_C4", "label": "_process_report_background", "type": "function", "loc": [174, 181], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:ClassDef_L22_C0", "vector": [2, 1, 0.6339, 0.0286, 1, 0.89, 0.619, 528, 0, 2, 1, 0, 0, 0, 6], "semantic": {"name": "_process_report_background", "arg_names": ["self", "colors"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _process_report_background(self, colors):\n if colors.count(':') not in [1, 2]:\n LOGGER.error(\"Invalid report background colors '%s'.\" % colors)\n return self._get_default_value('ReportBackground')\n colors = colors.split(':')\n if len(colors) == 2:\n return colors[0], colors[0], colors[1]\n return tuple(colors)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L175_C8", "label": "if", "type": "if", "loc": [175, 177], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L174_C4", "vector": [4, 2, 0.6286, 0.0107, 2, 0.71, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if colors.count(':') not in [1, 2]:\n LOGGER.error(\"Invalid report background colors '%s'.\" % colors)\n return self._get_default_value('ReportBackground')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Expr_L176_C12", "label": "error()", "type": "expression", "loc": [176, 176], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L175_C8", "vector": [8, 3, 0.6286, 0.0036, 3, 0.15, 0.0, 771, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "error", "arg_names": [], "import_names": [], "rhs_call_name": "error", "annotation": ""}, "snippet": " LOGGER.error(\"Invalid report background colors '%s'.\" % colors)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L177_C12", "label": "return", "type": "return", "loc": [177, 177], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L175_C8", "vector": [13, 3, 0.6321, 0.0036, 3, 0.15, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._get_default_value('ReportBackground')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Assign_L178_C8", "label": "colors = split()", "type": "assigned_variable", "loc": [178, 178], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L174_C4", "vector": [14, 2, 0.6357, 0.0036, 2, 0.71, 0.3333, 656, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "colors", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " colors = colors.split(':')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L179_C8", "label": "if", "type": "if", "loc": [179, 180], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L174_C4", "vector": [4, 2, 0.6411, 0.0071, 2, 0.71, 0.6667, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(colors) == 2:\n return colors[0], colors[0], colors[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L180_C12", "label": "return", "type": "return", "loc": [180, 180], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L179_C8", "vector": [13, 3, 0.6429, 0.0036, 3, 0.99, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return colors[0], colors[0], colors[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L181_C8", "label": "return", "type": "return", "loc": [181, 181], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L174_C4", "vector": [13, 2, 0.6464, 0.0036, 2, 0.71, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return tuple(colors)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L183_C4", "label": "_process_tag_stat_combine", "type": "function", "loc": [183, 189], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:ClassDef_L22_C0", "vector": [2, 1, 0.6643, 0.025, 1, 0.89, 0.6667, 153, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "_process_tag_stat_combine", "arg_names": ["self", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _process_tag_stat_combine(self, value):\n for replwhat, replwith in [('_', ' '), ('AND', '&'),\n ('&', ' & '), ('NOT', ' NOT ')]:\n value = value.replace(replwhat, replwith)\n if ':' in value:\n return value.rsplit(':', 1)\n return value, ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:For_L184_C8", "label": "for replwhat, replwith", "type": "for", "loc": [184, 186], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L183_C4", "vector": [6, 2, 0.6607, 0.0107, 2, 0.66, 0.0, 820, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "replwhat, replwith", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for replwhat, replwith in [('_', ' '), ('AND', '&'),\n ('&', ' & '), ('NOT', ' NOT ')]:\n value = value.replace(replwhat, replwith)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Assign_L186_C12", "label": "value = replace()", "type": "assigned_variable", "loc": [186, 186], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:For_L184_C8", "vector": [14, 3, 0.6643, 0.0036, 3, 0.35, 0.0, 441, 3, 2, 0, 0, 293, 10, 1], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "replace", "annotation": ""}, "snippet": " value = value.replace(replwhat, replwith)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L187_C8", "label": "if", "type": "if", "loc": [187, 188], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L183_C4", "vector": [4, 2, 0.6696, 0.0071, 2, 0.66, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if ':' in value:\n return value.rsplit(':', 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L188_C12", "label": "return", "type": "return", "loc": [188, 188], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L187_C8", "vector": [13, 3, 0.6714, 0.0036, 3, 0.53, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return value.rsplit(':', 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L189_C8", "label": "return", "type": "return", "loc": [189, 189], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L183_C4", "vector": [13, 2, 0.675, 0.0036, 2, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return value, ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L191_C4", "label": "_process_tag_stat_link", "type": "function", "loc": [191, 197], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:ClassDef_L22_C0", "vector": [2, 1, 0.6929, 0.025, 1, 0.89, 0.7143, 905, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "_process_tag_stat_link", "arg_names": ["self", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _process_tag_stat_link(self, value):\n tokens = value.split(':')\n if len(tokens) >= 3:\n return tokens[0], ':'.join(tokens[1:-1]), tokens[-1]\n LOGGER.error(\"Invalid format for option '--tagstatlink'. \"\n \"Expected 'tag:link:title' but got '%s'.\" % value)\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Assign_L192_C8", "label": "tokens = split()", "type": "assigned_variable", "loc": [192, 192], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L191_C4", "vector": [14, 2, 0.6857, 0.0036, 2, 0.38, 0.0, 700, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "tokens", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " tokens = value.split(':')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L193_C8", "label": "if", "type": "if", "loc": [193, 194], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L191_C4", "vector": [4, 2, 0.6911, 0.0071, 2, 0.38, 0.3333, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(tokens) >= 3:\n return tokens[0], ':'.join(tokens[1:-1]), tokens[-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L194_C12", "label": "return", "type": "return", "loc": [194, 194], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L193_C8", "vector": [13, 3, 0.6929, 0.0036, 3, 0.68, 0.0, 0, 0, 0, 0, 0, 0, 8, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return tokens[0], ':'.join(tokens[1:-1]), tokens[-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Expr_L195_C8", "label": "error()", "type": "expression", "loc": [195, 196], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L191_C4", "vector": [8, 2, 0.6982, 0.0071, 2, 0.38, 0.6667, 771, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "error", "arg_names": [], "import_names": [], "rhs_call_name": "error", "annotation": ""}, "snippet": " LOGGER.error(\"Invalid format for option '--tagstatlink'. \"\n \"Expected 'tag:link:title' but got '%s'.\" % value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L197_C8", "label": "return", "type": "return", "loc": [197, 197], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L191_C4", "vector": [13, 2, 0.7036, 0.0036, 2, 0.38, 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_99894:FunctionDef_L199_C4", "label": "_convert_to_positive_integer_or_default", "type": "function", "loc": [199, 201], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:ClassDef_L22_C0", "vector": [2, 1, 0.7143, 0.0107, 1, 0.89, 0.7619, 148, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "_convert_to_positive_integer_or_default", "arg_names": ["self", "name", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _convert_to_positive_integer_or_default(self, name, value):\n value = self._convert_to_integer(name, value)\n return value if value > 0 else self._get_default_value(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Assign_L200_C8", "label": "value = _convert_to_integer()", "type": "assigned_variable", "loc": [200, 200], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L199_C4", "vector": [14, 2, 0.7143, 0.0036, 2, 0.12, 0.0, 441, 3, 2, 0, 0, 283, 10, 1], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "_convert_to_integer", "annotation": ""}, "snippet": " value = self._convert_to_integer(name, value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L201_C8", "label": "return", "type": "return", "loc": [201, 201], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L199_C4", "vector": [13, 2, 0.7179, 0.0036, 2, 0.12, 1.0, 0, 8, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return value if value > 0 else self._get_default_value(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L203_C4", "label": "_convert_to_integer", "type": "function", "loc": [203, 209], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:ClassDef_L22_C0", "vector": [2, 1, 0.7357, 0.025, 1, 0.89, 0.8095, 283, 0, 3, 1, 0, 0, 0, 4], "semantic": {"name": "_convert_to_integer", "arg_names": ["self", "name", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _convert_to_integer(self, name, value):\n try:\n return int(value)\n except ValueError:\n LOGGER.error(\"Option '--%s' expected integer value but got '%s'. \"\n \"Default value used instead.\" % (name.lower(), value))\n return self._get_default_value(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Try_L204_C8", "label": "try", "type": "try", "loc": [204, 209], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L203_C4", "vector": [7, 2, 0.7375, 0.0214, 2, 0.88, 0.0, 0, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n return int(value)\n except ValueError:\n LOGGER.error(\"Option '--%s' expected integer value but got '%s'. \"\n \"Default value used instead.\" % (name.lower(), value))\n return self._get_default_value(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L205_C12", "label": "return", "type": "return", "loc": [205, 205], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:Try_L204_C8", "vector": [13, 3, 0.7321, 0.0036, 3, 0.06, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return int(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Expr_L207_C12", "label": "error()", "type": "expression", "loc": [207, 208], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:Try_L204_C8", "vector": [8, 3, 0.7411, 0.0071, 3, 0.06, 0.0, 771, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "error", "arg_names": [], "import_names": [], "rhs_call_name": "error", "annotation": ""}, "snippet": " LOGGER.error(\"Option '--%s' expected integer value but got '%s'. \"\n \"Default value used instead.\" % (name.lower(), value))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L209_C12", "label": "return", "type": "return", "loc": [209, 209], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:Try_L204_C8", "vector": [13, 3, 0.7464, 0.0036, 3, 0.06, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._get_default_value(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L211_C4", "label": "_get_default_value", "type": "function", "loc": [211, 212], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:ClassDef_L22_C0", "vector": [2, 1, 0.7554, 0.0071, 1, 0.89, 0.8571, 346, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "_get_default_value", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_default_value(self, name):\n return self._cli_opts[name][1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L212_C8", "label": "return", "type": "return", "loc": [212, 212], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L211_C4", "vector": [13, 2, 0.7571, 0.0036, 2, 0.44, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._cli_opts[name][1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L214_C4", "label": "_split_args_from_name", "type": "function", "loc": [214, 222], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:ClassDef_L22_C0", "vector": [2, 1, 0.7786, 0.0321, 1, 0.89, 0.9048, 553, 0, 2, 1, 0, 0, 0, 6], "semantic": {"name": "_split_args_from_name", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _split_args_from_name(self, name):\n if ':' not in name or os.path.exists(name):\n return name, []\n args = name.split(':')\n name = args.pop(0)\n # Handle absolute Windows paths with arguments\n if len(name) == 1 and args[0].startswith(('/', '\\\\')):\n name = name + ':' + args.pop(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L215_C8", "label": "if", "type": "if", "loc": [215, 216], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L214_C4", "vector": [4, 2, 0.7696, 0.0071, 2, 0.69, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if ':' not in name or os.path.exists(name):\n return name, []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L216_C12", "label": "return", "type": "return", "loc": [216, 216], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L215_C8", "vector": [13, 3, 0.7714, 0.0036, 3, 0.89, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return name, []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Assign_L217_C8", "label": "args = split()", "type": "assigned_variable", "loc": [217, 217], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L214_C4", "vector": [14, 2, 0.775, 0.0036, 2, 0.69, 0.25, 805, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "args", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " args = name.split(':')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Assign_L218_C8", "label": "name = pop()", "type": "assigned_variable", "loc": [218, 218], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L214_C4", "vector": [14, 2, 0.7786, 0.0036, 2, 0.69, 0.5, 57, 3, 1, 0, 0, 969, 10, 1], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "pop", "annotation": ""}, "snippet": " name = args.pop(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L220_C8", "label": "if", "type": "if", "loc": [220, 221], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L214_C4", "vector": [4, 2, 0.7875, 0.0071, 2, 0.69, 0.75, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(name) == 1 and args[0].startswith(('/', '\\\\')):\n name = name + ':' + args.pop(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Assign_L221_C12", "label": "name =", "type": "assigned_variable", "loc": [221, 221], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L220_C8", "vector": [14, 3, 0.7893, 0.0036, 3, 0.09, 0.0, 57, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " name = name + ':' + args.pop(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L222_C8", "label": "return", "type": "return", "loc": [222, 222], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L214_C4", "vector": [13, 2, 0.7929, 0.0036, 2, 0.69, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return name, args"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L224_C4", "label": "__contains__", "type": "function", "loc": [224, 225], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:ClassDef_L22_C0", "vector": [2, 1, 0.8018, 0.0071, 1, 0.89, 0.9524, 456, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "__contains__", "arg_names": ["self", "setting"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __contains__(self, setting):\n return setting in self._cli_opts"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L225_C8", "label": "return", "type": "return", "loc": [225, 225], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L224_C4", "vector": [13, 2, 0.8036, 0.0036, 2, 0.77, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return setting in self._cli_opts"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L227_C4", "label": "__unicode__", "type": "function", "loc": [227, 229], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:ClassDef_L22_C0", "vector": [2, 1, 0.8143, 0.0107, 1, 0.89, 1.0, 318, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "__unicode__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __unicode__(self):\n return '\\n'.join('%s: %s' % (name, self._opts[name])\n for name in sorted(self._opts))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L228_C8", "label": "return", "type": "return", "loc": [228, 229], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L227_C4", "vector": [13, 2, 0.8161, 0.0071, 2, 0.01, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '\\n'.join('%s: %s' % (name, self._opts[name])\n for name in sorted(self._opts))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:ClassDef_L232_C0", "label": "RobotSettings", "type": "class", "loc": [232, 266], "level": 0, "parent": null, "vector": [3, 0, 0.8893, 0.125, 0, 0.66, 0.8333, 641, 0, 4, 0, 0, 186, 0, 3], "semantic": {"name": "RobotSettings", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class RobotSettings(_BaseSettings):\n _extra_cli_opts = {'Output' : ('output', 'output.xml'),\n 'LogLevel' : ('loglevel', 'INFO'),\n 'RunMode' : ('runmode', []),\n 'WarnOnSkipped' : ('warnonskippedfiles', False),\n 'Variables' : ('variable', []),\n 'VariableFiles' : ('variablefile', []),\n 'Listeners' : ('listener', []),"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Assign_L233_C4", "label": "_extra_cli_opts =", "type": "assigned_variable", "loc": [233, 240], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:ClassDef_L232_C0", "vector": [14, 1, 0.8446, 0.0286, 1, 0.54, 0.0, 750, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "_extra_cli_opts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _extra_cli_opts = {'Output' : ('output', 'output.xml'),\n 'LogLevel' : ('loglevel', 'INFO'),\n 'RunMode' : ('runmode', []),\n 'WarnOnSkipped' : ('warnonskippedfiles', False),\n 'Variables' : ('variable', []),\n 'VariableFiles' : ('variablefile', []),\n 'Listeners' : ('listener', []),\n 'DebugFile' : ('debugfile', 'NONE')}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L242_C4", "label": "is_rebot_needed", "type": "function", "loc": [242, 243], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:ClassDef_L232_C0", "vector": [2, 1, 0.8661, 0.0071, 1, 0.54, 0.25, 910, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "is_rebot_needed", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def is_rebot_needed(self):\n return not ('NONE' == self['Log'] == self['Report'] == self['XUnitFile'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L243_C8", "label": "return", "type": "return", "loc": [243, 243], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L242_C4", "vector": [13, 2, 0.8679, 0.0036, 2, 0.71, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return not ('NONE' == self['Log'] == self['Report'] == self['XUnitFile'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L245_C4", "label": "get_rebot_datasource_and_settings", "type": "function", "loc": [245, 258], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:ClassDef_L232_C0", "vector": [2, 1, 0.8982, 0.05, 1, 0.54, 0.5, 805, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "get_rebot_datasource_and_settings", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_rebot_datasource_and_settings(self):\n datasource = self['Output']\n settings = RebotSettings(log=False)\n settings._opts.update(self._opts)\n for name in ['Variables', 'VariableFiles', 'Listeners']:\n del(settings._opts[name])\n for name in ['Include', 'Exclude', 'TestNames', 'SuiteNames', 'Metadata']:\n settings._opts[name] = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Assign_L246_C8", "label": "datasource =", "type": "assigned_variable", "loc": [246, 246], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L245_C4", "vector": [14, 2, 0.8786, 0.0036, 2, 0.41, 0.0, 287, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "datasource", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " datasource = self['Output']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Assign_L247_C8", "label": "settings = RebotSettings()", "type": "assigned_variable", "loc": [247, 247], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L245_C4", "vector": [14, 2, 0.8821, 0.0036, 2, 0.41, 0.125, 168, 3, 1, 0, 0, 722, 10, 1], "semantic": {"name": "settings", "arg_names": [], "import_names": [], "rhs_call_name": "RebotSettings", "annotation": ""}, "snippet": " settings = RebotSettings(log=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Expr_L248_C8", "label": "update()", "type": "expression", "loc": [248, 248], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L245_C4", "vector": [8, 2, 0.8857, 0.0036, 2, 0.41, 0.25, 637, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " settings._opts.update(self._opts)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:For_L249_C8", "label": "for name", "type": "for", "loc": [249, 250], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L245_C4", "vector": [6, 2, 0.8911, 0.0071, 2, 0.41, 0.375, 57, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for name in ['Variables', 'VariableFiles', 'Listeners']:\n del(settings._opts[name])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:For_L251_C8", "label": "for name", "type": "for", "loc": [251, 252], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L245_C4", "vector": [6, 2, 0.8982, 0.0071, 2, 0.41, 0.5, 57, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for name in ['Include', 'Exclude', 'TestNames', 'SuiteNames', 'Metadata']:\n settings._opts[name] = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Assign_L252_C12", "label": "assign", "type": "assigned_variable", "loc": [252, 252], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:For_L251_C8", "vector": [14, 3, 0.9, 0.0036, 3, 0.78, 0.0, 0, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " settings._opts[name] = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:For_L253_C8", "label": "for name", "type": "for", "loc": [253, 254], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L245_C4", "vector": [6, 2, 0.9054, 0.0071, 2, 0.41, 0.625, 57, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for name in ['Output', 'RemoveKeywords']:\n settings._opts[name] = 'NONE'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Assign_L254_C12", "label": "assign", "type": "assigned_variable", "loc": [254, 254], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:For_L253_C8", "vector": [14, 3, 0.9071, 0.0036, 3, 0.57, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " settings._opts[name] = 'NONE'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:For_L255_C8", "label": "for name", "type": "for", "loc": [255, 256], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L245_C4", "vector": [6, 2, 0.9125, 0.0071, 2, 0.41, 0.75, 57, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for name in ['Name', 'Doc']:\n settings._opts[name] = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Assign_L256_C12", "label": "assign", "type": "assigned_variable", "loc": [256, 256], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:For_L255_C8", "vector": [14, 3, 0.9143, 0.0036, 3, 0.35, 0.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " settings._opts[name] = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Assign_L257_C8", "label": "assign", "type": "assigned_variable", "loc": [257, 257], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L245_C4", "vector": [14, 2, 0.9179, 0.0036, 2, 0.41, 0.875, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " settings._opts['LogLevel'] = 'TRACE'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L258_C8", "label": "return", "type": "return", "loc": [258, 258], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L245_C4", "vector": [13, 2, 0.9214, 0.0036, 2, 0.41, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return datasource, settings"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L260_C4", "label": "_outputfile_disabled", "type": "function", "loc": [260, 263], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:ClassDef_L232_C0", "vector": [2, 1, 0.9339, 0.0143, 1, 0.54, 0.75, 601, 0, 3, 1, 0, 0, 0, 0], "semantic": {"name": "_outputfile_disabled", "arg_names": ["self", "type_", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _outputfile_disabled(self, type_, name):\n if name == 'NONE':\n return True\n return self._opts['Output'] == 'NONE' and type_ != 'DebugFile'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L261_C8", "label": "if", "type": "if", "loc": [261, 262], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L260_C4", "vector": [4, 2, 0.9339, 0.0071, 2, 0.14, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if name == 'NONE':\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L262_C12", "label": "return", "type": "return", "loc": [262, 262], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L261_C8", "vector": [13, 3, 0.9357, 0.0036, 3, 0.65, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L263_C8", "label": "return", "type": "return", "loc": [263, 263], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L260_C4", "vector": [13, 2, 0.9393, 0.0036, 2, 0.14, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._opts['Output'] == 'NONE' and type_ != 'DebugFile'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L265_C4", "label": "_escape", "type": "function", "loc": [265, 266], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:ClassDef_L232_C0", "vector": [2, 1, 0.9482, 0.0071, 1, 0.54, 1.0, 328, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "_escape", "arg_names": ["self", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _escape(self, value):\n return utils.escape(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L266_C8", "label": "return", "type": "return", "loc": [266, 266], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L265_C4", "vector": [13, 2, 0.95, 0.0036, 2, 0.49, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return utils.escape(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:ClassDef_L269_C0", "label": "RebotSettings", "type": "class", "loc": [269, 280], "level": 0, "parent": null, "vector": [3, 0, 0.9804, 0.0429, 0, 0.66, 1.0, 722, 0, 2, 0, 0, 186, 0, 0], "semantic": {"name": "RebotSettings", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class RebotSettings(_BaseSettings):\n _extra_cli_opts = {'Output' : ('output', 'NONE'),\n 'LogLevel' : ('loglevel', 'TRACE'),\n 'RemoveKeywords' : ('removekeywords', 'NONE'),\n 'StartTime' : ('starttime', 'N/A'),\n 'EndTime' : ('endtime', 'N/A')}\n\n def _outputfile_disabled(self, type_, name):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Assign_L270_C4", "label": "_extra_cli_opts =", "type": "assigned_variable", "loc": [270, 274], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:ClassDef_L269_C0", "vector": [14, 1, 0.9714, 0.0179, 1, 0.03, 0.0, 750, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "_extra_cli_opts", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _extra_cli_opts = {'Output' : ('output', 'NONE'),\n 'LogLevel' : ('loglevel', 'TRACE'),\n 'RemoveKeywords' : ('removekeywords', 'NONE'),\n 'StartTime' : ('starttime', 'N/A'),\n 'EndTime' : ('endtime', 'N/A')}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L276_C4", "label": "_outputfile_disabled", "type": "function", "loc": [276, 277], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:ClassDef_L269_C0", "vector": [2, 1, 0.9875, 0.0071, 1, 0.03, 0.5, 601, 0, 3, 1, 0, 0, 0, 0], "semantic": {"name": "_outputfile_disabled", "arg_names": ["self", "type_", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _outputfile_disabled(self, type_, name):\n return name == 'NONE'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L277_C8", "label": "return", "type": "return", "loc": [277, 277], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L276_C4", "vector": [13, 2, 0.9893, 0.0036, 2, 0.14, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return name == 'NONE'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L279_C4", "label": "_escape", "type": "function", "loc": [279, 280], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:ClassDef_L269_C0", "vector": [2, 1, 0.9982, 0.0071, 1, 0.03, 1.0, 328, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "_escape", "arg_names": ["self", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _escape(self, value):\n return value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L280_C8", "label": "return", "type": "return", "loc": [280, 280], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L279_C4", "vector": [13, 2, 1.0, 0.0036, 2, 0.95, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return value"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99894:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Assign_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Assign_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Assign_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Expr_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Expr_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L62_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Expr_L62_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L64_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:For_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:For_L65_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Try_L66_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:Try_L66_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Assign_L67_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:Try_L66_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L68_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:Try_L66_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Assign_L71_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:For_L65_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Assign_L72_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Assign_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L79_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L79_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L80_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L80_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L81_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L79_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L82_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L83_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L83_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Assign_L83_C30"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L82_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L84_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L79_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L85_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L86_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L86_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Assign_L86_C35"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L85_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L87_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L79_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L88_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L89_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L79_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L90_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L91_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L79_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L92_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L93_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L79_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L94_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L95_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L79_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L96_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L97_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L79_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L98_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L98_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L99_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L79_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L100_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L101_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L79_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L102_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L102_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L103_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L79_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L104_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L104_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L105_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L79_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L106_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L106_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L107_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L79_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L108_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L111_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Assign_L112_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Assign_L115_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L116_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L116_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Expr_L117_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L120_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L122_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L122_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L123_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L122_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L125_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L125_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L126_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L122_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L127_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L129_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Expr_L130_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Assign_L134_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L135_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L135_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L136_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Assign_L137_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Assign_L138_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Expr_L139_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L140_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L142_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L142_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Assign_L143_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L142_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L144_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L144_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Assign_L145_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L142_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Assign_L146_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L142_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L147_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L149_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L149_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L150_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L150_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L151_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L149_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L152_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L152_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L153_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L149_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L154_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L154_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L155_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L149_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L156_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L156_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L157_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L160_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L160_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Try_L161_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:Try_L161_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L162_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L162_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Expr_L163_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L168_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L168_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Assign_L169_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L168_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L170_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L170_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L171_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L168_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L172_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L174_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L174_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L175_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L175_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Expr_L176_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L175_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L177_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L174_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Assign_L178_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L174_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L179_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L179_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L180_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L174_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L181_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L183_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L183_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:For_L184_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:For_L184_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Assign_L186_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L183_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L187_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L187_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L188_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L183_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L189_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L191_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L191_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Assign_L192_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L191_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L193_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L193_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L194_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L191_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Expr_L195_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L191_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L197_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L199_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Assign_L200_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L201_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L203_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L203_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Try_L204_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:Try_L204_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L205_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:Try_L204_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Expr_L207_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:Try_L204_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L209_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L211_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L211_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L212_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L214_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L214_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L215_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L215_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L216_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L214_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Assign_L217_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L214_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Assign_L218_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L214_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L220_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L220_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Assign_L221_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L214_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L222_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L224_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L224_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L225_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L227_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L227_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L228_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:ClassDef_L232_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Assign_L233_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:ClassDef_L232_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L242_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L242_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L243_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:ClassDef_L232_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L245_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L245_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Assign_L246_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L245_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Assign_L247_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L245_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Expr_L248_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L245_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:For_L249_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L245_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:For_L251_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:For_L251_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Assign_L252_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L245_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:For_L253_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:For_L253_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Assign_L254_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L245_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:For_L255_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:For_L255_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Assign_L256_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L245_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Assign_L257_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L245_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L258_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:ClassDef_L232_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L260_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L260_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L261_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:If_L261_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L262_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L260_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L263_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:ClassDef_L232_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L265_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L265_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L266_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:ClassDef_L269_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Assign_L270_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:ClassDef_L269_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L276_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L276_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L277_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:ClassDef_L269_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L279_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99894:FunctionDef_L279_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99894:Return_L280_C8"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from settings import RobotSettings, RebotSettings
| ajibawa-2023/Python-Code-Large/train/row_99895 | 1 | 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_99895:ImportFrom_L15_C0", "label": "from settings import RobotSettings, RebotSettings", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 1.0, 0.0667, 0, 0.66, 0.0, 168, 0, 2, 0, 0, 168, 0, 0], "semantic": {"name": "settings", "arg_names": [], "import_names": ["RobotSettings", "RebotSettings"], "rhs_call_name": "", "annotation": ""}, "snippet": "from settings import RobotSettings, RebotSettings"}] | [] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from robot import utils
from robot.errors import DataError
LEVELS = {
"NONE" : 100,
"ERROR" : 60,
"FAIL" : 50,
"WARN" : 40,
"INFO" : 30,
"DEBUG" : 20,
"TRACE" : 10,
}
class AbstractLogger:
def __init__(self, level='TRACE'):
self._is_logged = IsLogged(level)
def set_level(self, level):
return self._is_logged.set_level(level)
def trace(self, msg):
self.write(msg, 'TRACE')
def debug(self, msg):
self.write(msg, 'DEBUG')
def info(self, msg):
self.write(msg, 'INFO')
def warn(self, msg):
self.write(msg, 'WARN')
def fail(self, msg):
self.write(msg, 'FAIL')
def error(self, msg):
self.write(msg, 'ERROR')
def write(self, message, level, html=False):
self.message(Message(message, level, html))
def message(self, msg):
raise NotImplementedError(self.__class__)
class Message(object):
def __init__(self, message, level='INFO', html=False, timestamp=None, linkable=False):
self.message = self._get_message(message)
self.level, self.html = self._get_level_and_html(level, html)
self.timestamp = self._get_timestamp(timestamp)
self.linkable = linkable
def _get_message(self, msg):
if not isinstance(msg, basestring):
msg = utils.unic(msg)
return msg.replace('\r\n', '\n')
def _get_level_and_html(self, level, html):
level = level.upper()
if level == 'HTML':
return 'INFO', True
if level not in LEVELS:
raise DataError("Invalid log level '%s'" % level)
return level, html
def _get_timestamp(self, timestamp):
if timestamp:
return timestamp
return utils.get_timestamp(daysep='', daytimesep=' ',
timesep=':', millissep='.')
def get_timestamp(self, sep=' '):
return self.timestamp.replace(' ', sep)
@property
def time(self):
if ' ' not in self.timestamp:
return self.timestamp
return self.timestamp.split()[1]
class IsLogged:
def __init__(self, level):
self._str_level = level
self._int_level = self._level_to_int(level)
def __call__(self, level):
return self._level_to_int(level) >= self._int_level
def set_level(self, level):
old = self._str_level.upper()
self.__init__(level)
return old
def _level_to_int(self, level):
try:
return LEVELS[level.upper()]
except KeyError:
raise DataError("Invalid log level '%s'" % level)
class AbstractLoggerProxy:
_methods = NotImplemented
def __init__(self, logger):
self.logger = logger
default = lambda *args: None
for name in self._methods:
try:
method = getattr(logger, name)
except AttributeError:
method = getattr(logger, self._toCamelCase(name), default)
setattr(self, name, method)
def _toCamelCase(self, name):
parts = name.split('_')
return ''.join([parts[0]] + [part.capitalize() for part in parts[1:]])
| ajibawa-2023/Python-Code-Large/train/row_99896 | 75 | 137 | 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_99896:ImportFrom_L16_C0", "label": "from robot import utils", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.1168, 0.0073, 0, 0.66, 0.0, 735, 0, 1, 0, 0, 735, 0, 0], "semantic": {"name": "robot", "arg_names": [], "import_names": ["utils"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot import utils"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:ImportFrom_L17_C0", "label": "from robot.errors import DataError", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.1241, 0.0073, 0, 0.66, 0.1667, 299, 0, 1, 0, 0, 299, 0, 0], "semantic": {"name": "robot.errors", "arg_names": [], "import_names": ["DataError"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot.errors import DataError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:Assign_L20_C0", "label": "LEVELS =", "type": "assigned_variable", "loc": [20, 28], "level": 0, "parent": null, "vector": [14, 0, 0.1752, 0.0657, 0, 0.66, 0.3333, 286, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "LEVELS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "LEVELS = {\n \"NONE\" : 100,\n \"ERROR\" : 60,\n \"FAIL\" : 50,\n \"WARN\" : 40,\n \"INFO\" : 30,\n \"DEBUG\" : 20,\n \"TRACE\" : 10,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:ClassDef_L31_C0", "label": "AbstractLogger", "type": "class", "loc": [31, 61], "level": 0, "parent": null, "vector": [3, 0, 0.3358, 0.2263, 0, 0.66, 0.5, 61, 0, 10, 0, 0, 0, 0, 11], "semantic": {"name": "AbstractLogger", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class AbstractLogger:\n\n def __init__(self, level='TRACE'):\n self._is_logged = IsLogged(level)\n\n def set_level(self, level):\n return self._is_logged.set_level(level)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L33_C4", "label": "__init__", "type": "function", "loc": [33, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99896:ClassDef_L31_C0", "vector": [2, 1, 0.2445, 0.0146, 1, 0.11, 0.0, 555, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "level"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, level='TRACE'):\n self._is_logged = IsLogged(level)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:Assign_L34_C8", "label": "self._is_logged = IsLogged()", "type": "assigned_variable", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L33_C4", "vector": [14, 2, 0.2482, 0.0073, 2, 0.44, 0.0, 427, 3, 1, 0, 0, 467, 10, 1], "semantic": {"name": "self._is_logged", "arg_names": [], "import_names": [], "rhs_call_name": "IsLogged", "annotation": ""}, "snippet": " self._is_logged = IsLogged(level)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L36_C4", "label": "set_level", "type": "function", "loc": [36, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99896:ClassDef_L31_C0", "vector": [2, 1, 0.2664, 0.0146, 1, 0.11, 0.1111, 584, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "set_level", "arg_names": ["self", "level"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_level(self, level):\n return self._is_logged.set_level(level)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:Return_L37_C8", "label": "return", "type": "return", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L36_C4", "vector": [13, 2, 0.2701, 0.0073, 2, 0.64, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._is_logged.set_level(level)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L39_C4", "label": "trace", "type": "function", "loc": [39, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99896:ClassDef_L31_C0", "vector": [2, 1, 0.2883, 0.0146, 1, 0.11, 0.2222, 211, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "trace", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def trace(self, msg):\n self.write(msg, 'TRACE')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:Expr_L40_C8", "label": "write()", "type": "expression", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L39_C4", "vector": [8, 2, 0.292, 0.0073, 2, 0.42, 0.0, 837, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " self.write(msg, 'TRACE')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L42_C4", "label": "debug", "type": "function", "loc": [42, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99896:ClassDef_L31_C0", "vector": [2, 1, 0.3102, 0.0146, 1, 0.11, 0.3333, 924, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "debug", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def debug(self, msg):\n self.write(msg, 'DEBUG')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:Expr_L43_C8", "label": "write()", "type": "expression", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L42_C4", "vector": [8, 2, 0.3139, 0.0073, 2, 0.36, 0.0, 837, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " self.write(msg, 'DEBUG')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L45_C4", "label": "info", "type": "function", "loc": [45, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99896:ClassDef_L31_C0", "vector": [2, 1, 0.3321, 0.0146, 1, 0.11, 0.4444, 730, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "info", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def info(self, msg):\n self.write(msg, 'INFO')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:Expr_L46_C8", "label": "write()", "type": "expression", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L45_C4", "vector": [8, 2, 0.3358, 0.0073, 2, 0.47, 0.0, 837, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " self.write(msg, 'INFO')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L48_C4", "label": "warn", "type": "function", "loc": [48, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99896:ClassDef_L31_C0", "vector": [2, 1, 0.354, 0.0146, 1, 0.11, 0.5556, 960, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "warn", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def warn(self, msg):\n self.write(msg, 'WARN')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:Expr_L49_C8", "label": "write()", "type": "expression", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L48_C4", "vector": [8, 2, 0.3577, 0.0073, 2, 0.03, 0.0, 837, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " self.write(msg, 'WARN')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L51_C4", "label": "fail", "type": "function", "loc": [51, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99896:ClassDef_L31_C0", "vector": [2, 1, 0.3759, 0.0146, 1, 0.11, 0.6667, 364, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "fail", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def fail(self, msg):\n self.write(msg, 'FAIL')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:Expr_L52_C8", "label": "write()", "type": "expression", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L51_C4", "vector": [8, 2, 0.3796, 0.0073, 2, 0.85, 0.0, 837, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " self.write(msg, 'FAIL')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L54_C4", "label": "error", "type": "function", "loc": [54, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99896:ClassDef_L31_C0", "vector": [2, 1, 0.3978, 0.0146, 1, 0.11, 0.7778, 771, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "error", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def error(self, msg):\n self.write(msg, 'ERROR')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:Expr_L55_C8", "label": "write()", "type": "expression", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L54_C4", "vector": [8, 2, 0.4015, 0.0073, 2, 0.16, 0.0, 837, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " self.write(msg, 'ERROR')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L57_C4", "label": "write", "type": "function", "loc": [57, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99896:ClassDef_L31_C0", "vector": [2, 1, 0.4197, 0.0146, 1, 0.11, 0.8889, 837, 0, 4, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": ["self", "message", "level", "html"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def write(self, message, level, html=False):\n self.message(Message(message, level, html))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:Expr_L58_C8", "label": "message()", "type": "expression", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L57_C4", "vector": [8, 2, 0.4234, 0.0073, 2, 0.24, 0.0, 635, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "message", "arg_names": [], "import_names": [], "rhs_call_name": "message", "annotation": ""}, "snippet": " self.message(Message(message, level, html))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L60_C4", "label": "message", "type": "function", "loc": [60, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99896:ClassDef_L31_C0", "vector": [2, 1, 0.4416, 0.0146, 1, 0.11, 1.0, 635, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "message", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def message(self, msg):\n raise NotImplementedError(self.__class__)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:ClassDef_L64_C0", "label": "Message", "type": "class", "loc": [64, 98], "level": 0, "parent": null, "vector": [3, 0, 0.5912, 0.2555, 0, 0.66, 0.6667, 6, 0, 6, 0, 0, 186, 0, 11], "semantic": {"name": "Message", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Message(object):\n\n def __init__(self, message, level='INFO', html=False, timestamp=None, linkable=False):\n self.message = self._get_message(message)\n self.level, self.html = self._get_level_and_html(level, html)\n self.timestamp = self._get_timestamp(timestamp)\n self.linkable = linkable\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L66_C4", "label": "__init__", "type": "function", "loc": [66, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99896:ClassDef_L64_C0", "vector": [2, 1, 0.4964, 0.0365, 1, 0.47, 0.0, 555, 0, 6, 0, 0, 0, 0, 3], "semantic": {"name": "__init__", "arg_names": ["self", "message", "level", "html", "timestamp", "linkable"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, message, level='INFO', html=False, timestamp=None, linkable=False):\n self.message = self._get_message(message)\n self.level, self.html = self._get_level_and_html(level, html)\n self.timestamp = self._get_timestamp(timestamp)\n self.linkable = linkable"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:Assign_L67_C8", "label": "self.message = _get_message()", "type": "assigned_variable", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L66_C4", "vector": [14, 2, 0.4891, 0.0073, 2, 0.29, 0.0, 709, 3, 1, 0, 0, 663, 10, 1], "semantic": {"name": "self.message", "arg_names": [], "import_names": [], "rhs_call_name": "_get_message", "annotation": ""}, "snippet": " self.message = self._get_message(message)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:Assign_L68_C8", "label": " = _get_level_and_html()", "type": "assigned_variable", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L66_C4", "vector": [14, 2, 0.4964, 0.0073, 2, 0.29, 0.3333, 0, 3, 2, 0, 0, 6, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "_get_level_and_html", "annotation": ""}, "snippet": " self.level, self.html = self._get_level_and_html(level, html)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:Assign_L69_C8", "label": "self.timestamp = _get_timestamp()", "type": "assigned_variable", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L66_C4", "vector": [14, 2, 0.5036, 0.0073, 2, 0.29, 0.6667, 297, 3, 1, 0, 0, 605, 10, 1], "semantic": {"name": "self.timestamp", "arg_names": [], "import_names": [], "rhs_call_name": "_get_timestamp", "annotation": ""}, "snippet": " self.timestamp = self._get_timestamp(timestamp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:Assign_L70_C8", "label": "self.linkable =", "type": "assigned_variable", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L66_C4", "vector": [14, 2, 0.5109, 0.0073, 2, 0.29, 1.0, 642, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.linkable", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.linkable = linkable"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L72_C4", "label": "_get_message", "type": "function", "loc": [72, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99896:ClassDef_L64_C0", "vector": [2, 1, 0.5365, 0.0292, 1, 0.47, 0.2, 663, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "_get_message", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_message(self, msg):\n if not isinstance(msg, basestring):\n msg = utils.unic(msg)\n return msg.replace('\\r\\n', '\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:If_L73_C8", "label": "if", "type": "if", "loc": [73, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L72_C4", "vector": [4, 2, 0.5365, 0.0146, 2, 0.61, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not isinstance(msg, basestring):\n msg = utils.unic(msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:Assign_L74_C12", "label": "msg = unic()", "type": "assigned_variable", "loc": [74, 74], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99896:If_L73_C8", "vector": [14, 3, 0.5401, 0.0073, 3, 0.55, 0.0, 712, 3, 1, 0, 0, 992, 10, 1], "semantic": {"name": "msg", "arg_names": [], "import_names": [], "rhs_call_name": "unic", "annotation": ""}, "snippet": " msg = utils.unic(msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:Return_L75_C8", "label": "return", "type": "return", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L72_C4", "vector": [13, 2, 0.5474, 0.0073, 2, 0.61, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return msg.replace('\\r\\n', '\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L77_C4", "label": "_get_level_and_html", "type": "function", "loc": [77, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99896:ClassDef_L64_C0", "vector": [2, 1, 0.5839, 0.0511, 1, 0.47, 0.4, 6, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "_get_level_and_html", "arg_names": ["self", "level", "html"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_level_and_html(self, level, html):\n level = level.upper()\n if level == 'HTML':\n return 'INFO', True\n if level not in LEVELS:\n raise DataError(\"Invalid log level '%s'\" % level)\n return level, html"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:Assign_L78_C8", "label": "level = upper()", "type": "assigned_variable", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L77_C4", "vector": [14, 2, 0.5693, 0.0073, 2, 0.64, 0.0, 479, 3, 0, 0, 0, 347, 10, 1], "semantic": {"name": "level", "arg_names": [], "import_names": [], "rhs_call_name": "upper", "annotation": ""}, "snippet": " level = level.upper()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:If_L79_C8", "label": "if", "type": "if", "loc": [79, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L77_C4", "vector": [4, 2, 0.5803, 0.0146, 2, 0.64, 0.3333, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if level == 'HTML':\n return 'INFO', True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:Return_L80_C12", "label": "return", "type": "return", "loc": [80, 80], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99896:If_L79_C8", "vector": [13, 3, 0.5839, 0.0073, 3, 0.83, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'INFO', True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:If_L81_C8", "label": "if", "type": "if", "loc": [81, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L77_C4", "vector": [4, 2, 0.5949, 0.0146, 2, 0.64, 0.6667, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if level not in LEVELS:\n raise DataError(\"Invalid log level '%s'\" % level)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:Return_L83_C8", "label": "return", "type": "return", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L77_C4", "vector": [13, 2, 0.6058, 0.0073, 2, 0.64, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return level, html"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L85_C4", "label": "_get_timestamp", "type": "function", "loc": [85, 89], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99896:ClassDef_L64_C0", "vector": [2, 1, 0.635, 0.0365, 1, 0.47, 0.6, 605, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "_get_timestamp", "arg_names": ["self", "timestamp"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_timestamp(self, timestamp):\n if timestamp:\n return timestamp\n return utils.get_timestamp(daysep='', daytimesep=' ',\n timesep=':', millissep='.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:If_L86_C8", "label": "if", "type": "if", "loc": [86, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L85_C4", "vector": [4, 2, 0.6314, 0.0146, 2, 0.64, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if timestamp:\n return timestamp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:Return_L87_C12", "label": "return", "type": "return", "loc": [87, 87], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99896:If_L86_C8", "vector": [13, 3, 0.635, 0.0073, 3, 0.37, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return timestamp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:Return_L88_C8", "label": "return", "type": "return", "loc": [88, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L85_C4", "vector": [13, 2, 0.646, 0.0146, 2, 0.64, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return utils.get_timestamp(daysep='', daytimesep=' ',\n timesep=':', millissep='.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L91_C4", "label": "get_timestamp", "type": "function", "loc": [91, 92], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99896:ClassDef_L64_C0", "vector": [2, 1, 0.6679, 0.0146, 1, 0.47, 0.8, 398, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "get_timestamp", "arg_names": ["self", "sep"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_timestamp(self, sep=' '):\n return self.timestamp.replace(' ', sep)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:Return_L92_C8", "label": "return", "type": "return", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L91_C4", "vector": [13, 2, 0.6715, 0.0073, 2, 0.53, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.timestamp.replace(' ', sep)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L95_C4", "label": "time", "type": "function", "loc": [95, 98], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99896:ClassDef_L64_C0", "vector": [2, 1, 0.7044, 0.0292, 1, 0.47, 1.0, 654, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "time", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def time(self):\n if ' ' not in self.timestamp:\n return self.timestamp\n return self.timestamp.split()[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:If_L96_C8", "label": "if", "type": "if", "loc": [96, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L95_C4", "vector": [4, 2, 0.7044, 0.0146, 2, 0.99, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if ' ' not in self.timestamp:\n return self.timestamp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:Return_L97_C12", "label": "return", "type": "return", "loc": [97, 97], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99896:If_L96_C8", "vector": [13, 3, 0.708, 0.0073, 3, 0.8, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.timestamp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:Return_L98_C8", "label": "return", "type": "return", "loc": [98, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L95_C4", "vector": [13, 2, 0.7153, 0.0073, 2, 0.99, 1.0, 0, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.timestamp.split()[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:ClassDef_L101_C0", "label": "IsLogged", "type": "class", "loc": [101, 119], "level": 0, "parent": null, "vector": [3, 0, 0.8029, 0.1387, 0, 0.66, 0.8333, 467, 0, 4, 0, 0, 0, 0, 6], "semantic": {"name": "IsLogged", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class IsLogged:\n\n def __init__(self, level):\n self._str_level = level\n self._int_level = self._level_to_int(level)\n\n def __call__(self, level):\n return self._level_to_int(level) >= self._int_level"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L103_C4", "label": "__init__", "type": "function", "loc": [103, 105], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99896:ClassDef_L101_C0", "vector": [2, 1, 0.7591, 0.0219, 1, 0.47, 0.0, 555, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "level"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, level):\n self._str_level = level\n self._int_level = self._level_to_int(level)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:Assign_L104_C8", "label": "self._str_level =", "type": "assigned_variable", "loc": [104, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L103_C4", "vector": [14, 2, 0.7591, 0.0073, 2, 0.56, 0.0, 956, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._str_level", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._str_level = level"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:Assign_L105_C8", "label": "self._int_level = _level_to_int()", "type": "assigned_variable", "loc": [105, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L103_C4", "vector": [14, 2, 0.7664, 0.0073, 2, 0.56, 1.0, 31, 3, 1, 0, 0, 31, 10, 1], "semantic": {"name": "self._int_level", "arg_names": [], "import_names": [], "rhs_call_name": "_level_to_int", "annotation": ""}, "snippet": " self._int_level = self._level_to_int(level)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L107_C4", "label": "__call__", "type": "function", "loc": [107, 108], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99896:ClassDef_L101_C0", "vector": [2, 1, 0.7847, 0.0146, 1, 0.47, 0.3333, 319, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "__call__", "arg_names": ["self", "level"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __call__(self, level):\n return self._level_to_int(level) >= self._int_level"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:Return_L108_C8", "label": "return", "type": "return", "loc": [108, 108], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L107_C4", "vector": [13, 2, 0.7883, 0.0073, 2, 0.67, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._level_to_int(level) >= self._int_level"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L110_C4", "label": "set_level", "type": "function", "loc": [110, 113], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99896:ClassDef_L101_C0", "vector": [2, 1, 0.8139, 0.0292, 1, 0.47, 0.6667, 584, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "set_level", "arg_names": ["self", "level"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_level(self, level):\n old = self._str_level.upper()\n self.__init__(level)\n return old"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:Assign_L111_C8", "label": "old = upper()", "type": "assigned_variable", "loc": [111, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L110_C4", "vector": [14, 2, 0.8102, 0.0073, 2, 0.36, 0.0, 206, 3, 0, 0, 0, 347, 10, 1], "semantic": {"name": "old", "arg_names": [], "import_names": [], "rhs_call_name": "upper", "annotation": ""}, "snippet": " old = self._str_level.upper()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:Expr_L112_C8", "label": "__init__()", "type": "expression", "loc": [112, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L110_C4", "vector": [8, 2, 0.8175, 0.0073, 2, 0.36, 0.5, 555, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " self.__init__(level)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:Return_L113_C8", "label": "return", "type": "return", "loc": [113, 113], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L110_C4", "vector": [13, 2, 0.8248, 0.0073, 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 old"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L115_C4", "label": "_level_to_int", "type": "function", "loc": [115, 119], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99896:ClassDef_L101_C0", "vector": [2, 1, 0.854, 0.0365, 1, 0.47, 1.0, 31, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "_level_to_int", "arg_names": ["self", "level"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _level_to_int(self, level):\n try:\n return LEVELS[level.upper()]\n except KeyError:\n raise DataError(\"Invalid log level '%s'\" % level)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:Try_L116_C8", "label": "try", "type": "try", "loc": [116, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L115_C4", "vector": [7, 2, 0.8577, 0.0292, 2, 0.94, 0.0, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n return LEVELS[level.upper()]\n except KeyError:\n raise DataError(\"Invalid log level '%s'\" % level)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:Return_L117_C12", "label": "return", "type": "return", "loc": [117, 117], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99896:Try_L116_C8", "vector": [13, 3, 0.854, 0.0073, 3, 0.53, 0.0, 0, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return LEVELS[level.upper()]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:ClassDef_L122_C0", "label": "AbstractLoggerProxy", "type": "class", "loc": [122, 137], "level": 0, "parent": null, "vector": [3, 0, 0.9453, 0.1168, 0, 0.66, 1.0, 7, 0, 2, 0, 0, 0, 0, 7], "semantic": {"name": "AbstractLoggerProxy", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class AbstractLoggerProxy:\n _methods = NotImplemented\n\n def __init__(self, logger):\n self.logger = logger\n default = lambda *args: None\n for name in self._methods:\n try:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:Assign_L123_C4", "label": "_methods =", "type": "assigned_variable", "loc": [123, 123], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99896:ClassDef_L122_C0", "vector": [14, 1, 0.8978, 0.0073, 1, 0.01, 0.0, 904, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "_methods", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _methods = NotImplemented"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L125_C4", "label": "__init__", "type": "function", "loc": [125, 133], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99896:ClassDef_L122_C0", "vector": [2, 1, 0.9416, 0.0657, 1, 0.01, 0.5, 555, 0, 2, 0, 0, 0, 0, 4], "semantic": {"name": "__init__", "arg_names": ["self", "logger"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, logger):\n self.logger = logger\n default = lambda *args: None\n for name in self._methods:\n try:\n method = getattr(logger, name)\n except AttributeError:\n method = getattr(logger, self._toCamelCase(name), default)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:Assign_L126_C8", "label": "self.logger =", "type": "assigned_variable", "loc": [126, 126], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L125_C4", "vector": [14, 2, 0.9197, 0.0073, 2, 0.69, 0.0, 829, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.logger", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.logger = logger"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:Assign_L127_C8", "label": "default =", "type": "assigned_variable", "loc": [127, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L125_C4", "vector": [14, 2, 0.927, 0.0073, 2, 0.69, 0.5, 977, 9, 0, 0, 0, 0, 0, 0], "semantic": {"name": "default", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " default = lambda *args: None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:For_L128_C8", "label": "for name", "type": "for", "loc": [128, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L125_C4", "vector": [6, 2, 0.9526, 0.0438, 2, 0.69, 1.0, 57, 7, 0, 0, 0, 0, 0, 4], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for name in self._methods:\n try:\n method = getattr(logger, name)\n except AttributeError:\n method = getattr(logger, self._toCamelCase(name), default)\n setattr(self, name, method)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:Try_L129_C12", "label": "try", "type": "try", "loc": [129, 132], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99896:For_L128_C8", "vector": [7, 3, 0.9526, 0.0292, 3, 0.52, 0.0, 0, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n method = getattr(logger, name)\n except AttributeError:\n method = getattr(logger, self._toCamelCase(name), default)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:Assign_L130_C16", "label": "method = getattr()", "type": "assigned_variable", "loc": [130, 130], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99896:Try_L129_C12", "vector": [14, 4, 0.9489, 0.0073, 4, 0.34, 0.0, 445, 3, 2, 0, 0, 121, 10, 1], "semantic": {"name": "method", "arg_names": [], "import_names": [], "rhs_call_name": "getattr", "annotation": ""}, "snippet": " method = getattr(logger, name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:Assign_L132_C16", "label": "method = getattr()", "type": "assigned_variable", "loc": [132, 132], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99896:Try_L129_C12", "vector": [14, 4, 0.9635, 0.0073, 4, 0.34, 0.0, 445, 3, 3, 0, 0, 121, 10, 2], "semantic": {"name": "method", "arg_names": [], "import_names": [], "rhs_call_name": "getattr", "annotation": ""}, "snippet": " method = getattr(logger, self._toCamelCase(name), default)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:Expr_L133_C12", "label": "setattr()", "type": "expression", "loc": [133, 133], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99896:For_L128_C8", "vector": [8, 3, 0.9708, 0.0073, 3, 0.52, 1.0, 501, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "setattr", "arg_names": [], "import_names": [], "rhs_call_name": "setattr", "annotation": ""}, "snippet": " setattr(self, name, method)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L135_C4", "label": "_toCamelCase", "type": "function", "loc": [135, 137], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99896:ClassDef_L122_C0", "vector": [2, 1, 0.9927, 0.0219, 1, 0.01, 1.0, 223, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "_toCamelCase", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _toCamelCase(self, name):\n parts = name.split('_')\n return ''.join([parts[0]] + [part.capitalize() for part in parts[1:]])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:Assign_L136_C8", "label": "parts = split()", "type": "assigned_variable", "loc": [136, 136], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L135_C4", "vector": [14, 2, 0.9927, 0.0073, 2, 0.41, 0.0, 13, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "parts", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " parts = name.split('_')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99896:Return_L137_C8", "label": "return", "type": "return", "loc": [137, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L135_C4", "vector": [13, 2, 1.0, 0.0073, 2, 0.41, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ''.join([parts[0]] + [part.capitalize() for part in parts[1:]])"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99896:ClassDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99896:Assign_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99896:ClassDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99896:Return_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99896:ClassDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L39_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99896:Expr_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99896:ClassDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99896:Expr_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99896:ClassDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99896:Expr_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99896:ClassDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99896:Expr_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99896:ClassDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L51_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99896:Expr_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99896:ClassDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99896:Expr_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99896:ClassDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99896:Expr_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99896:ClassDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99896:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99896:Assign_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99896:Assign_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99896:Assign_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99896:Assign_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99896:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L72_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99896:If_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99896:If_L73_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99896:Assign_L74_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L72_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99896:Return_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99896:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L77_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L77_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99896:Assign_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L77_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99896:If_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99896:If_L79_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99896:Return_L80_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L77_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99896:If_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L77_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99896:Return_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99896:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L85_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99896:If_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99896:If_L86_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99896:Return_L87_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99896:Return_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99896:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L91_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99896:Return_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99896:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L95_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99896:If_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99896:If_L96_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99896:Return_L97_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99896:Return_L98_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99896:ClassDef_L101_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L103_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99896:Assign_L104_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99896:Assign_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99896:ClassDef_L101_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L107_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99896:Return_L108_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99896:ClassDef_L101_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L110_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L110_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99896:Assign_L111_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L110_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99896:Expr_L112_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L110_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99896:Return_L113_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99896:ClassDef_L101_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L115_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L115_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99896:Try_L116_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99896:Try_L116_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99896:Return_L117_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99896:ClassDef_L122_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99896:Assign_L123_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99896:ClassDef_L122_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L125_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L125_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99896:Assign_L126_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L125_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99896:Assign_L127_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L125_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99896:For_L128_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99896:For_L128_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99896:Try_L129_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99896:Try_L129_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99896:Assign_L130_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99896:Try_L129_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99896:Assign_L132_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99896:For_L128_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99896:Expr_L133_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99896:ClassDef_L122_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L135_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L135_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99896:Assign_L136_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99896:FunctionDef_L135_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99896:Return_L137_C8"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from robot import utils
from robot.errors import DataError
from robot.version import get_full_version
from loggerhelper import IsLogged
class XmlLogger:
def __init__(self, path, log_level='TRACE', generator='Robot'):
self._log_message_is_logged = IsLogged(log_level)
self._error_message_is_logged = IsLogged('WARN')
self._writer = self._get_writer(path, generator)
self._errors = []
def _get_writer(self, path, generator):
try:
writer = utils.XmlWriter(path)
except:
raise DataError("Opening output file '%s' for writing failed: %s"
% (path, utils.get_error_message()))
writer.start('robot', {'generator': get_full_version(generator),
'generated': utils.get_timestamp()})
return writer
def close(self):
self.start_errors()
for msg in self._errors:
self._write_message(msg)
self.end_errors()
self._writer.end('robot')
self._writer.close()
def set_log_level(self, level):
return self._log_message_is_logged.set_level(level)
def message(self, msg):
if self._error_message_is_logged(msg.level):
self._errors.append(msg)
def log_message(self, msg):
if self._log_message_is_logged(msg.level):
self._write_message(msg)
def _write_message(self, msg):
attrs = {'timestamp': msg.timestamp, 'level': msg.level}
if msg.html:
attrs['html'] = 'yes'
if msg.linkable:
attrs['linkable'] = 'yes'
self._writer.element('msg', msg.message, attrs)
def start_keyword(self, kw):
self._writer.start('kw', {'name': kw.name, 'type': kw.type,
'timeout': kw.timeout})
self._writer.element('doc', kw.doc)
self._write_list('arguments', 'arg', kw.args)
def end_keyword(self, kw):
self._write_status(kw)
self._writer.end('kw')
def start_test(self, test):
self._writer.start('test', {'name': test.name,
'timeout': test.timeout})
self._writer.element('doc', test.doc)
def end_test(self, test):
self._write_list('tags', 'tag', test.tags)
self._write_status(test, test.message, {'critical': test.critical})
self._writer.end('test')
def start_suite(self, suite):
attrs = {'name': suite.name}
if suite.source:
attrs['source'] = suite.source
self._writer.start('suite', attrs)
self._writer.element('doc', suite.doc)
self._writer.start('metadata')
for name, value in suite.get_metadata():
self._writer.element('item', value, {'name': name})
self._writer.end('metadata')
def end_suite(self, suite):
self._write_status(suite, suite.message)
self._writer.end('suite')
def start_statistics(self, stats):
self._writer.start('statistics')
def end_statistics(self, stats):
self._writer.end('statistics')
def start_total_stats(self, total_stats):
self._writer.start('total')
def end_total_stats(self, total_stats):
self._writer.end('total')
def start_tag_stats(self, tag_stats):
self._writer.start('tag')
def end_tag_stats(self, tag_stats):
self._writer.end('tag')
def start_suite_stats(self, tag_stats):
self._writer.start('suite')
def end_suite_stats(self, tag_stats):
self._writer.end('suite')
def total_stat(self, stat):
self._stat(stat)
def suite_stat(self, stat):
self._stat(stat, stat.long_name, attrs={'name': stat.name})
def tag_stat(self, stat):
self._stat(stat, attrs={'info': self._get_tag_stat_info(stat),
'links': self._get_tag_links(stat),
'doc': stat.doc,
'combined': stat.combined})
def _get_tag_links(self, stat):
return ':::'.join(':'.join([title, url]) for url, title in stat.links)
def _stat(self, stat, name=None, attrs=None):
attrs = attrs or {}
attrs['pass'] = str(stat.passed)
attrs['fail'] = str(stat.failed)
self._writer.element('stat', name or stat.name, attrs)
def _get_tag_stat_info(self, stat):
if stat.critical:
return 'critical'
if stat.non_critical:
return 'non-critical'
if stat.combined:
return 'combined'
return ''
def start_errors(self):
self._writer.start('errors')
def end_errors(self):
self._writer.end('errors')
def _write_list(self, container_tag, item_tag, items):
self._writer.start(container_tag)
for item in items:
self._writer.element(item_tag, item)
self._writer.end(container_tag)
def _write_status(self, item, message=None, extra_attrs=None):
attrs = {'status': item.status, 'starttime': item.starttime,
'endtime': item.endtime}
if item.starttime == 'N/A' or item.endtime == 'N/A':
attrs['elapsedtime'] = item.elapsedtime
if extra_attrs:
attrs.update(extra_attrs)
self._writer.element('status', message, attrs)
| ajibawa-2023/Python-Code-Large/train/row_99897 | 117 | 175 | 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_99897:ImportFrom_L15_C0", "label": "from robot import utils", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.0857, 0.0057, 0, 0.66, 0.0, 735, 0, 1, 0, 0, 735, 0, 0], "semantic": {"name": "robot", "arg_names": [], "import_names": ["utils"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot import utils"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:ImportFrom_L16_C0", "label": "from robot.errors import DataError", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.0914, 0.0057, 0, 0.66, 0.25, 299, 0, 1, 0, 0, 299, 0, 0], "semantic": {"name": "robot.errors", "arg_names": [], "import_names": ["DataError"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot.errors import DataError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:ImportFrom_L17_C0", "label": "from robot.version import get_full_version", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.0971, 0.0057, 0, 0.66, 0.5, 622, 0, 1, 0, 0, 622, 0, 0], "semantic": {"name": "robot.version", "arg_names": [], "import_names": ["get_full_version"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot.version import get_full_version"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:ImportFrom_L19_C0", "label": "from loggerhelper import IsLogged", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.1086, 0.0057, 0, 0.66, 0.75, 426, 0, 1, 0, 0, 426, 0, 0], "semantic": {"name": "loggerhelper", "arg_names": [], "import_names": ["IsLogged"], "rhs_call_name": "", "annotation": ""}, "snippet": "from loggerhelper import IsLogged"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:ClassDef_L22_C0", "label": "XmlLogger", "type": "class", "loc": [22, 175], "level": 0, "parent": null, "vector": [3, 0, 0.5629, 0.88, 0, 0.66, 1.0, 137, 0, 31, 0, 0, 0, 0, 63], "semantic": {"name": "XmlLogger", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class XmlLogger:\n\n def __init__(self, path, log_level='TRACE', generator='Robot'):\n self._log_message_is_logged = IsLogged(log_level)\n self._error_message_is_logged = IsLogged('WARN')\n self._writer = self._get_writer(path, generator)\n self._errors = []\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L24_C4", "label": "__init__", "type": "function", "loc": [24, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:ClassDef_L22_C0", "vector": [2, 1, 0.1486, 0.0286, 1, 0.78, 0.0, 555, 0, 4, 0, 0, 0, 0, 3], "semantic": {"name": "__init__", "arg_names": ["self", "path", "log_level", "generator"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, path, log_level='TRACE', generator='Robot'):\n self._log_message_is_logged = IsLogged(log_level)\n self._error_message_is_logged = IsLogged('WARN')\n self._writer = self._get_writer(path, generator)\n self._errors = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:Assign_L25_C8", "label": "self._log_message_is_logged = IsLogged()", "type": "assigned_variable", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L24_C4", "vector": [14, 2, 0.1429, 0.0057, 2, 0.5, 0.0, 588, 3, 1, 0, 0, 467, 10, 1], "semantic": {"name": "self._log_message_is_logged", "arg_names": [], "import_names": [], "rhs_call_name": "IsLogged", "annotation": ""}, "snippet": " self._log_message_is_logged = IsLogged(log_level)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:Assign_L26_C8", "label": "self._error_message_is_logged = IsLogged()", "type": "assigned_variable", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L24_C4", "vector": [14, 2, 0.1486, 0.0057, 2, 0.5, 0.3333, 680, 3, 1, 0, 0, 467, 10, 1], "semantic": {"name": "self._error_message_is_logged", "arg_names": [], "import_names": [], "rhs_call_name": "IsLogged", "annotation": ""}, "snippet": " self._error_message_is_logged = IsLogged('WARN')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:Assign_L27_C8", "label": "self._writer = _get_writer()", "type": "assigned_variable", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L24_C4", "vector": [14, 2, 0.1543, 0.0057, 2, 0.5, 0.6667, 446, 3, 2, 0, 0, 860, 10, 1], "semantic": {"name": "self._writer", "arg_names": [], "import_names": [], "rhs_call_name": "_get_writer", "annotation": ""}, "snippet": " self._writer = self._get_writer(path, generator)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:Assign_L28_C8", "label": "self._errors =", "type": "assigned_variable", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L24_C4", "vector": [14, 2, 0.16, 0.0057, 2, 0.5, 1.0, 39, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self._errors", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._errors = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L30_C4", "label": "_get_writer", "type": "function", "loc": [30, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:ClassDef_L22_C0", "vector": [2, 1, 0.1943, 0.0514, 1, 0.78, 0.0333, 860, 0, 3, 1, 0, 0, 0, 6], "semantic": {"name": "_get_writer", "arg_names": ["self", "path", "generator"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_writer(self, path, generator):\n try:\n writer = utils.XmlWriter(path)\n except:\n raise DataError(\"Opening output file '%s' for writing failed: %s\"\n % (path, utils.get_error_message()))\n writer.start('robot', {'generator': get_full_version(generator),\n 'generated': utils.get_timestamp()})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:Try_L31_C8", "label": "try", "type": "try", "loc": [31, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L30_C4", "vector": [7, 2, 0.1886, 0.0286, 2, 0.41, 0.0, 0, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n writer = utils.XmlWriter(path)\n except:\n raise DataError(\"Opening output file '%s' for writing failed: %s\"\n % (path, utils.get_error_message()))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:Assign_L32_C12", "label": "writer = XmlWriter()", "type": "assigned_variable", "loc": [32, 32], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:Try_L31_C8", "vector": [14, 3, 0.1829, 0.0057, 3, 0.6, 0.0, 614, 3, 1, 0, 0, 730, 10, 1], "semantic": {"name": "writer", "arg_names": [], "import_names": [], "rhs_call_name": "XmlWriter", "annotation": ""}, "snippet": " writer = utils.XmlWriter(path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L36_C8", "label": "start()", "type": "expression", "loc": [36, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L30_C4", "vector": [8, 2, 0.2086, 0.0114, 2, 0.41, 0.5, 511, 3, 2, 0, 0, 0, 0, 3], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " writer.start('robot', {'generator': get_full_version(generator),\n 'generated': utils.get_timestamp()})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:Return_L38_C8", "label": "return", "type": "return", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L30_C4", "vector": [13, 2, 0.2171, 0.0057, 2, 0.41, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return writer"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L40_C4", "label": "close", "type": "function", "loc": [40, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:ClassDef_L22_C0", "vector": [2, 1, 0.2457, 0.04, 1, 0.78, 0.0667, 77, 0, 1, 0, 0, 0, 0, 5], "semantic": {"name": "close", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def close(self):\n self.start_errors()\n for msg in self._errors:\n self._write_message(msg)\n self.end_errors()\n self._writer.end('robot')\n self._writer.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L41_C8", "label": "start_errors()", "type": "expression", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L40_C4", "vector": [8, 2, 0.2343, 0.0057, 2, 0.28, 0.0, 750, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start_errors", "arg_names": [], "import_names": [], "rhs_call_name": "start_errors", "annotation": ""}, "snippet": " self.start_errors()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:For_L42_C8", "label": "for msg", "type": "for", "loc": [42, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L40_C4", "vector": [6, 2, 0.2429, 0.0114, 2, 0.28, 0.25, 712, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for msg in self._errors:\n self._write_message(msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L43_C12", "label": "_write_message()", "type": "expression", "loc": [43, 43], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:For_L42_C8", "vector": [8, 3, 0.2457, 0.0057, 3, 0.76, 0.0, 257, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_write_message", "arg_names": [], "import_names": [], "rhs_call_name": "_write_message", "annotation": ""}, "snippet": " self._write_message(msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L44_C8", "label": "end_errors()", "type": "expression", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L40_C4", "vector": [8, 2, 0.2514, 0.0057, 2, 0.28, 0.5, 230, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "end_errors", "arg_names": [], "import_names": [], "rhs_call_name": "end_errors", "annotation": ""}, "snippet": " self.end_errors()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L45_C8", "label": "end()", "type": "expression", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L40_C4", "vector": [8, 2, 0.2571, 0.0057, 2, 0.28, 0.75, 128, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "end", "arg_names": [], "import_names": [], "rhs_call_name": "end", "annotation": ""}, "snippet": " self._writer.end('robot')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L46_C8", "label": "close()", "type": "expression", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L40_C4", "vector": [8, 2, 0.2629, 0.0057, 2, 0.28, 1.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " self._writer.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L48_C4", "label": "set_log_level", "type": "function", "loc": [48, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:ClassDef_L22_C0", "vector": [2, 1, 0.2771, 0.0114, 1, 0.78, 0.1, 796, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "set_log_level", "arg_names": ["self", "level"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_log_level(self, level):\n return self._log_message_is_logged.set_level(level)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:Return_L49_C8", "label": "return", "type": "return", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L48_C4", "vector": [13, 2, 0.28, 0.0057, 2, 0.85, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._log_message_is_logged.set_level(level)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L51_C4", "label": "message", "type": "function", "loc": [51, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:ClassDef_L22_C0", "vector": [2, 1, 0.2971, 0.0171, 1, 0.78, 0.1333, 635, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "message", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def message(self, msg):\n if self._error_message_is_logged(msg.level):\n self._errors.append(msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:If_L52_C8", "label": "if", "type": "if", "loc": [52, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L51_C4", "vector": [4, 2, 0.3, 0.0114, 2, 0.9, 0.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._error_message_is_logged(msg.level):\n self._errors.append(msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L53_C12", "label": "append()", "type": "expression", "loc": [53, 53], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:If_L52_C8", "vector": [8, 3, 0.3029, 0.0057, 3, 0.15, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self._errors.append(msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L55_C4", "label": "log_message", "type": "function", "loc": [55, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:ClassDef_L22_C0", "vector": [2, 1, 0.32, 0.0171, 1, 0.78, 0.1667, 87, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "log_message", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def log_message(self, msg):\n if self._log_message_is_logged(msg.level):\n self._write_message(msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:If_L56_C8", "label": "if", "type": "if", "loc": [56, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L55_C4", "vector": [4, 2, 0.3229, 0.0114, 2, 0.56, 0.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._log_message_is_logged(msg.level):\n self._write_message(msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L57_C12", "label": "_write_message()", "type": "expression", "loc": [57, 57], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:If_L56_C8", "vector": [8, 3, 0.3257, 0.0057, 3, 0.4, 0.0, 257, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_write_message", "arg_names": [], "import_names": [], "rhs_call_name": "_write_message", "annotation": ""}, "snippet": " self._write_message(msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L59_C4", "label": "_write_message", "type": "function", "loc": [59, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:ClassDef_L22_C0", "vector": [2, 1, 0.3543, 0.04, 1, 0.78, 0.2, 257, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_write_message", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _write_message(self, msg):\n attrs = {'timestamp': msg.timestamp, 'level': msg.level}\n if msg.html:\n attrs['html'] = 'yes'\n if msg.linkable:\n attrs['linkable'] = 'yes'\n self._writer.element('msg', msg.message, attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:Assign_L60_C8", "label": "attrs =", "type": "assigned_variable", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L59_C4", "vector": [14, 2, 0.3429, 0.0057, 2, 0.06, 0.0, 251, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "attrs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " attrs = {'timestamp': msg.timestamp, 'level': msg.level}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:If_L61_C8", "label": "if", "type": "if", "loc": [61, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L59_C4", "vector": [4, 2, 0.3514, 0.0114, 2, 0.06, 0.3333, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if msg.html:\n attrs['html'] = 'yes'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:Assign_L62_C12", "label": "assign", "type": "assigned_variable", "loc": [62, 62], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:If_L61_C8", "vector": [14, 3, 0.3543, 0.0057, 3, 0.49, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " attrs['html'] = 'yes'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:If_L63_C8", "label": "if", "type": "if", "loc": [63, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L59_C4", "vector": [4, 2, 0.3629, 0.0114, 2, 0.06, 0.6667, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if msg.linkable:\n attrs['linkable'] = 'yes'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:Assign_L64_C12", "label": "assign", "type": "assigned_variable", "loc": [64, 64], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:If_L63_C8", "vector": [14, 3, 0.3657, 0.0057, 3, 0.04, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " attrs['linkable'] = 'yes'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L65_C8", "label": "element()", "type": "expression", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L59_C4", "vector": [8, 2, 0.3714, 0.0057, 2, 0.06, 1.0, 736, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "element", "arg_names": [], "import_names": [], "rhs_call_name": "element", "annotation": ""}, "snippet": " self._writer.element('msg', msg.message, attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L67_C4", "label": "start_keyword", "type": "function", "loc": [67, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:ClassDef_L22_C0", "vector": [2, 1, 0.3943, 0.0286, 1, 0.78, 0.2333, 776, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "start_keyword", "arg_names": ["self", "kw"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start_keyword(self, kw):\n self._writer.start('kw', {'name': kw.name, 'type': kw.type,\n 'timeout': kw.timeout})\n self._writer.element('doc', kw.doc)\n self._write_list('arguments', 'arg', kw.args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L68_C8", "label": "start()", "type": "expression", "loc": [68, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L67_C4", "vector": [8, 2, 0.3914, 0.0114, 2, 0.04, 0.0, 511, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " self._writer.start('kw', {'name': kw.name, 'type': kw.type,\n 'timeout': kw.timeout})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L70_C8", "label": "element()", "type": "expression", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L67_C4", "vector": [8, 2, 0.4, 0.0057, 2, 0.04, 0.5, 736, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "element", "arg_names": [], "import_names": [], "rhs_call_name": "element", "annotation": ""}, "snippet": " self._writer.element('doc', kw.doc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L71_C8", "label": "_write_list()", "type": "expression", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L67_C4", "vector": [8, 2, 0.4057, 0.0057, 2, 0.04, 1.0, 913, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "_write_list", "arg_names": [], "import_names": [], "rhs_call_name": "_write_list", "annotation": ""}, "snippet": " self._write_list('arguments', 'arg', kw.args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L73_C4", "label": "end_keyword", "type": "function", "loc": [73, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:ClassDef_L22_C0", "vector": [2, 1, 0.4229, 0.0171, 1, 0.78, 0.2667, 959, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "end_keyword", "arg_names": ["self", "kw"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end_keyword(self, kw):\n self._write_status(kw)\n self._writer.end('kw')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L74_C8", "label": "_write_status()", "type": "expression", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L73_C4", "vector": [8, 2, 0.4229, 0.0057, 2, 0.6, 0.0, 808, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_write_status", "arg_names": [], "import_names": [], "rhs_call_name": "_write_status", "annotation": ""}, "snippet": " self._write_status(kw)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L75_C8", "label": "end()", "type": "expression", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L73_C4", "vector": [8, 2, 0.4286, 0.0057, 2, 0.6, 1.0, 128, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "end", "arg_names": [], "import_names": [], "rhs_call_name": "end", "annotation": ""}, "snippet": " self._writer.end('kw')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L77_C4", "label": "start_test", "type": "function", "loc": [77, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:ClassDef_L22_C0", "vector": [2, 1, 0.4486, 0.0229, 1, 0.78, 0.3, 246, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "start_test", "arg_names": ["self", "test"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start_test(self, test):\n self._writer.start('test', {'name': test.name,\n 'timeout': test.timeout})\n self._writer.element('doc', test.doc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L78_C8", "label": "start()", "type": "expression", "loc": [78, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L77_C4", "vector": [8, 2, 0.4486, 0.0114, 2, 0.63, 0.0, 511, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " self._writer.start('test', {'name': test.name,\n 'timeout': test.timeout})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L80_C8", "label": "element()", "type": "expression", "loc": [80, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L77_C4", "vector": [8, 2, 0.4571, 0.0057, 2, 0.63, 1.0, 736, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "element", "arg_names": [], "import_names": [], "rhs_call_name": "element", "annotation": ""}, "snippet": " self._writer.element('doc', test.doc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L82_C4", "label": "end_test", "type": "function", "loc": [82, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:ClassDef_L22_C0", "vector": [2, 1, 0.4771, 0.0229, 1, 0.78, 0.3333, 220, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "end_test", "arg_names": ["self", "test"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end_test(self, test):\n self._write_list('tags', 'tag', test.tags)\n self._write_status(test, test.message, {'critical': test.critical})\n self._writer.end('test')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L83_C8", "label": "_write_list()", "type": "expression", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L82_C4", "vector": [8, 2, 0.4743, 0.0057, 2, 0.27, 0.0, 913, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "_write_list", "arg_names": [], "import_names": [], "rhs_call_name": "_write_list", "annotation": ""}, "snippet": " self._write_list('tags', 'tag', test.tags)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L84_C8", "label": "_write_status()", "type": "expression", "loc": [84, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L82_C4", "vector": [8, 2, 0.48, 0.0057, 2, 0.27, 0.5, 808, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "_write_status", "arg_names": [], "import_names": [], "rhs_call_name": "_write_status", "annotation": ""}, "snippet": " self._write_status(test, test.message, {'critical': test.critical})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L85_C8", "label": "end()", "type": "expression", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L82_C4", "vector": [8, 2, 0.4857, 0.0057, 2, 0.27, 1.0, 128, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "end", "arg_names": [], "import_names": [], "rhs_call_name": "end", "annotation": ""}, "snippet": " self._writer.end('test')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L87_C4", "label": "start_suite", "type": "function", "loc": [87, 96], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:ClassDef_L22_C0", "vector": [2, 1, 0.5229, 0.0571, 1, 0.78, 0.3667, 38, 0, 2, 0, 0, 0, 0, 6], "semantic": {"name": "start_suite", "arg_names": ["self", "suite"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start_suite(self, suite):\n attrs = {'name': suite.name}\n if suite.source:\n attrs['source'] = suite.source\n self._writer.start('suite', attrs)\n self._writer.element('doc', suite.doc)\n self._writer.start('metadata')\n for name, value in suite.get_metadata():"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:Assign_L88_C8", "label": "attrs =", "type": "assigned_variable", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L87_C4", "vector": [14, 2, 0.5029, 0.0057, 2, 0.43, 0.0, 251, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "attrs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " attrs = {'name': suite.name}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:If_L89_C8", "label": "if", "type": "if", "loc": [89, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L87_C4", "vector": [4, 2, 0.5114, 0.0114, 2, 0.43, 0.1667, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if suite.source:\n attrs['source'] = suite.source"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:Assign_L90_C12", "label": "assign", "type": "assigned_variable", "loc": [90, 90], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:If_L89_C8", "vector": [14, 3, 0.5143, 0.0057, 3, 0.32, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " attrs['source'] = suite.source"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L91_C8", "label": "start()", "type": "expression", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L87_C4", "vector": [8, 2, 0.52, 0.0057, 2, 0.43, 0.3333, 511, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " self._writer.start('suite', attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L92_C8", "label": "element()", "type": "expression", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L87_C4", "vector": [8, 2, 0.5257, 0.0057, 2, 0.43, 0.5, 736, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "element", "arg_names": [], "import_names": [], "rhs_call_name": "element", "annotation": ""}, "snippet": " self._writer.element('doc', suite.doc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L93_C8", "label": "start()", "type": "expression", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L87_C4", "vector": [8, 2, 0.5314, 0.0057, 2, 0.43, 0.6667, 511, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " self._writer.start('metadata')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:For_L94_C8", "label": "for name, value", "type": "for", "loc": [94, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L87_C4", "vector": [6, 2, 0.54, 0.0114, 2, 0.43, 0.8333, 509, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "name, value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for name, value in suite.get_metadata():\n self._writer.element('item', value, {'name': name})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L95_C12", "label": "element()", "type": "expression", "loc": [95, 95], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:For_L94_C8", "vector": [8, 3, 0.5429, 0.0057, 3, 0.15, 0.0, 736, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "element", "arg_names": [], "import_names": [], "rhs_call_name": "element", "annotation": ""}, "snippet": " self._writer.element('item', value, {'name': name})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L96_C8", "label": "end()", "type": "expression", "loc": [96, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L87_C4", "vector": [8, 2, 0.5486, 0.0057, 2, 0.43, 1.0, 128, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "end", "arg_names": [], "import_names": [], "rhs_call_name": "end", "annotation": ""}, "snippet": " self._writer.end('metadata')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L98_C4", "label": "end_suite", "type": "function", "loc": [98, 100], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:ClassDef_L22_C0", "vector": [2, 1, 0.5657, 0.0171, 1, 0.78, 0.4, 81, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "end_suite", "arg_names": ["self", "suite"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end_suite(self, suite):\n self._write_status(suite, suite.message)\n self._writer.end('suite')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L99_C8", "label": "_write_status()", "type": "expression", "loc": [99, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L98_C4", "vector": [8, 2, 0.5657, 0.0057, 2, 0.86, 0.0, 808, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_write_status", "arg_names": [], "import_names": [], "rhs_call_name": "_write_status", "annotation": ""}, "snippet": " self._write_status(suite, suite.message)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L100_C8", "label": "end()", "type": "expression", "loc": [100, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L98_C4", "vector": [8, 2, 0.5714, 0.0057, 2, 0.86, 1.0, 128, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "end", "arg_names": [], "import_names": [], "rhs_call_name": "end", "annotation": ""}, "snippet": " self._writer.end('suite')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L102_C4", "label": "start_statistics", "type": "function", "loc": [102, 103], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:ClassDef_L22_C0", "vector": [2, 1, 0.5857, 0.0114, 1, 0.78, 0.4333, 478, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "start_statistics", "arg_names": ["self", "stats"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start_statistics(self, stats):\n self._writer.start('statistics')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L103_C8", "label": "start()", "type": "expression", "loc": [103, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L102_C4", "vector": [8, 2, 0.5886, 0.0057, 2, 0.61, 0.0, 511, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " self._writer.start('statistics')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L105_C4", "label": "end_statistics", "type": "function", "loc": [105, 106], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:ClassDef_L22_C0", "vector": [2, 1, 0.6029, 0.0114, 1, 0.78, 0.4667, 989, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "end_statistics", "arg_names": ["self", "stats"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end_statistics(self, stats):\n self._writer.end('statistics')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L106_C8", "label": "end()", "type": "expression", "loc": [106, 106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L105_C4", "vector": [8, 2, 0.6057, 0.0057, 2, 0.52, 0.0, 128, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "end", "arg_names": [], "import_names": [], "rhs_call_name": "end", "annotation": ""}, "snippet": " self._writer.end('statistics')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L108_C4", "label": "start_total_stats", "type": "function", "loc": [108, 109], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:ClassDef_L22_C0", "vector": [2, 1, 0.62, 0.0114, 1, 0.78, 0.5, 965, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "start_total_stats", "arg_names": ["self", "total_stats"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start_total_stats(self, total_stats):\n self._writer.start('total')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L109_C8", "label": "start()", "type": "expression", "loc": [109, 109], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L108_C4", "vector": [8, 2, 0.6229, 0.0057, 2, 0.02, 0.0, 511, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " self._writer.start('total')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L111_C4", "label": "end_total_stats", "type": "function", "loc": [111, 112], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:ClassDef_L22_C0", "vector": [2, 1, 0.6371, 0.0114, 1, 0.78, 0.5333, 602, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "end_total_stats", "arg_names": ["self", "total_stats"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end_total_stats(self, total_stats):\n self._writer.end('total')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L112_C8", "label": "end()", "type": "expression", "loc": [112, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L111_C4", "vector": [8, 2, 0.64, 0.0057, 2, 0.05, 0.0, 128, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "end", "arg_names": [], "import_names": [], "rhs_call_name": "end", "annotation": ""}, "snippet": " self._writer.end('total')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L114_C4", "label": "start_tag_stats", "type": "function", "loc": [114, 115], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:ClassDef_L22_C0", "vector": [2, 1, 0.6543, 0.0114, 1, 0.78, 0.5667, 5, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "start_tag_stats", "arg_names": ["self", "tag_stats"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start_tag_stats(self, tag_stats):\n self._writer.start('tag')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L115_C8", "label": "start()", "type": "expression", "loc": [115, 115], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L114_C4", "vector": [8, 2, 0.6571, 0.0057, 2, 0.77, 0.0, 511, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " self._writer.start('tag')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L117_C4", "label": "end_tag_stats", "type": "function", "loc": [117, 118], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:ClassDef_L22_C0", "vector": [2, 1, 0.6714, 0.0114, 1, 0.78, 0.6, 676, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "end_tag_stats", "arg_names": ["self", "tag_stats"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end_tag_stats(self, tag_stats):\n self._writer.end('tag')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L118_C8", "label": "end()", "type": "expression", "loc": [118, 118], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L117_C4", "vector": [8, 2, 0.6743, 0.0057, 2, 0.39, 0.0, 128, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "end", "arg_names": [], "import_names": [], "rhs_call_name": "end", "annotation": ""}, "snippet": " self._writer.end('tag')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L120_C4", "label": "start_suite_stats", "type": "function", "loc": [120, 121], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:ClassDef_L22_C0", "vector": [2, 1, 0.6886, 0.0114, 1, 0.78, 0.6333, 41, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "start_suite_stats", "arg_names": ["self", "tag_stats"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start_suite_stats(self, tag_stats):\n self._writer.start('suite')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L121_C8", "label": "start()", "type": "expression", "loc": [121, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L120_C4", "vector": [8, 2, 0.6914, 0.0057, 2, 0.32, 0.0, 511, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " self._writer.start('suite')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L123_C4", "label": "end_suite_stats", "type": "function", "loc": [123, 124], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:ClassDef_L22_C0", "vector": [2, 1, 0.7057, 0.0114, 1, 0.78, 0.6667, 730, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "end_suite_stats", "arg_names": ["self", "tag_stats"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end_suite_stats(self, tag_stats):\n self._writer.end('suite')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L124_C8", "label": "end()", "type": "expression", "loc": [124, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L123_C4", "vector": [8, 2, 0.7086, 0.0057, 2, 0.22, 0.0, 128, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "end", "arg_names": [], "import_names": [], "rhs_call_name": "end", "annotation": ""}, "snippet": " self._writer.end('suite')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L126_C4", "label": "total_stat", "type": "function", "loc": [126, 127], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:ClassDef_L22_C0", "vector": [2, 1, 0.7229, 0.0114, 1, 0.78, 0.7, 85, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "total_stat", "arg_names": ["self", "stat"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def total_stat(self, stat):\n self._stat(stat)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L127_C8", "label": "_stat()", "type": "expression", "loc": [127, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L126_C4", "vector": [8, 2, 0.7257, 0.0057, 2, 0.19, 0.0, 767, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_stat", "arg_names": [], "import_names": [], "rhs_call_name": "_stat", "annotation": ""}, "snippet": " self._stat(stat)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L129_C4", "label": "suite_stat", "type": "function", "loc": [129, 130], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:ClassDef_L22_C0", "vector": [2, 1, 0.74, 0.0114, 1, 0.78, 0.7333, 331, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "suite_stat", "arg_names": ["self", "stat"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def suite_stat(self, stat):\n self._stat(stat, stat.long_name, attrs={'name': stat.name})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L130_C8", "label": "_stat()", "type": "expression", "loc": [130, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L129_C4", "vector": [8, 2, 0.7429, 0.0057, 2, 0.06, 0.0, 767, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "_stat", "arg_names": [], "import_names": [], "rhs_call_name": "_stat", "annotation": ""}, "snippet": " self._stat(stat, stat.long_name, attrs={'name': stat.name})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L132_C4", "label": "tag_stat", "type": "function", "loc": [132, 136], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:ClassDef_L22_C0", "vector": [2, 1, 0.7657, 0.0286, 1, 0.78, 0.7667, 959, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "tag_stat", "arg_names": ["self", "stat"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def tag_stat(self, stat):\n self._stat(stat, attrs={'info': self._get_tag_stat_info(stat),\n 'links': self._get_tag_links(stat),\n 'doc': stat.doc,\n 'combined': stat.combined})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L133_C8", "label": "_stat()", "type": "expression", "loc": [133, 136], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L132_C4", "vector": [8, 2, 0.7686, 0.0229, 2, 0.53, 0.0, 767, 3, 2, 0, 0, 0, 0, 3], "semantic": {"name": "_stat", "arg_names": [], "import_names": [], "rhs_call_name": "_stat", "annotation": ""}, "snippet": " self._stat(stat, attrs={'info': self._get_tag_stat_info(stat),\n 'links': self._get_tag_links(stat),\n 'doc': stat.doc,\n 'combined': stat.combined})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L138_C4", "label": "_get_tag_links", "type": "function", "loc": [138, 139], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:ClassDef_L22_C0", "vector": [2, 1, 0.7914, 0.0114, 1, 0.78, 0.8, 7, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "_get_tag_links", "arg_names": ["self", "stat"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_tag_links(self, stat):\n return ':::'.join(':'.join([title, url]) for url, title in stat.links)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:Return_L139_C8", "label": "return", "type": "return", "loc": [139, 139], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L138_C4", "vector": [13, 2, 0.7943, 0.0057, 2, 0.9, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ':::'.join(':'.join([title, url]) for url, title in stat.links)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L141_C4", "label": "_stat", "type": "function", "loc": [141, 145], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:ClassDef_L22_C0", "vector": [2, 1, 0.8171, 0.0286, 1, 0.78, 0.8333, 767, 0, 4, 0, 0, 0, 0, 3], "semantic": {"name": "_stat", "arg_names": ["self", "stat", "name", "attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _stat(self, stat, name=None, attrs=None):\n attrs = attrs or {}\n attrs['pass'] = str(stat.passed)\n attrs['fail'] = str(stat.failed)\n self._writer.element('stat', name or stat.name, attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:Assign_L142_C8", "label": "attrs =", "type": "assigned_variable", "loc": [142, 142], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L141_C4", "vector": [14, 2, 0.8114, 0.0057, 2, 0.19, 0.0, 251, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "attrs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " attrs = attrs or {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:Assign_L143_C8", "label": " = str()", "type": "assigned_variable", "loc": [143, 143], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L141_C4", "vector": [14, 2, 0.8171, 0.0057, 2, 0.19, 0.3333, 0, 3, 1, 0, 0, 52, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "str", "annotation": ""}, "snippet": " attrs['pass'] = str(stat.passed)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:Assign_L144_C8", "label": " = str()", "type": "assigned_variable", "loc": [144, 144], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L141_C4", "vector": [14, 2, 0.8229, 0.0057, 2, 0.19, 0.6667, 0, 3, 1, 0, 0, 52, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "str", "annotation": ""}, "snippet": " attrs['fail'] = str(stat.failed)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L145_C8", "label": "element()", "type": "expression", "loc": [145, 145], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L141_C4", "vector": [8, 2, 0.8286, 0.0057, 2, 0.19, 1.0, 736, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "element", "arg_names": [], "import_names": [], "rhs_call_name": "element", "annotation": ""}, "snippet": " self._writer.element('stat', name or stat.name, attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L147_C4", "label": "_get_tag_stat_info", "type": "function", "loc": [147, 154], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:ClassDef_L22_C0", "vector": [2, 1, 0.86, 0.0457, 1, 0.78, 0.8667, 270, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "_get_tag_stat_info", "arg_names": ["self", "stat"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_tag_stat_info(self, stat):\n if stat.critical:\n return 'critical'\n if stat.non_critical:\n return 'non-critical'\n if stat.combined:\n return 'combined'\n return ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:If_L148_C8", "label": "if", "type": "if", "loc": [148, 149], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L147_C4", "vector": [4, 2, 0.8486, 0.0114, 2, 0.49, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if stat.critical:\n return 'critical'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:Return_L149_C12", "label": "return", "type": "return", "loc": [149, 149], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:If_L148_C8", "vector": [13, 3, 0.8514, 0.0057, 3, 0.21, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'critical'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:If_L150_C8", "label": "if", "type": "if", "loc": [150, 151], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L147_C4", "vector": [4, 2, 0.86, 0.0114, 2, 0.49, 0.3333, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if stat.non_critical:\n return 'non-critical'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:Return_L151_C12", "label": "return", "type": "return", "loc": [151, 151], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:If_L150_C8", "vector": [13, 3, 0.8629, 0.0057, 3, 0.41, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'non-critical'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:If_L152_C8", "label": "if", "type": "if", "loc": [152, 153], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L147_C4", "vector": [4, 2, 0.8714, 0.0114, 2, 0.49, 0.6667, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if stat.combined:\n return 'combined'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:Return_L153_C12", "label": "return", "type": "return", "loc": [153, 153], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:If_L152_C8", "vector": [13, 3, 0.8743, 0.0057, 3, 0.33, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'combined'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:Return_L154_C8", "label": "return", "type": "return", "loc": [154, 154], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L147_C4", "vector": [13, 2, 0.88, 0.0057, 2, 0.49, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L156_C4", "label": "start_errors", "type": "function", "loc": [156, 157], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:ClassDef_L22_C0", "vector": [2, 1, 0.8943, 0.0114, 1, 0.78, 0.9, 750, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "start_errors", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start_errors(self):\n self._writer.start('errors')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L157_C8", "label": "start()", "type": "expression", "loc": [157, 157], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L156_C4", "vector": [8, 2, 0.8971, 0.0057, 2, 0.49, 0.0, 511, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " self._writer.start('errors')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L159_C4", "label": "end_errors", "type": "function", "loc": [159, 160], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:ClassDef_L22_C0", "vector": [2, 1, 0.9114, 0.0114, 1, 0.78, 0.9333, 230, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "end_errors", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end_errors(self):\n self._writer.end('errors')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L160_C8", "label": "end()", "type": "expression", "loc": [160, 160], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L159_C4", "vector": [8, 2, 0.9143, 0.0057, 2, 0.0, 0.0, 128, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "end", "arg_names": [], "import_names": [], "rhs_call_name": "end", "annotation": ""}, "snippet": " self._writer.end('errors')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L162_C4", "label": "_write_list", "type": "function", "loc": [162, 166], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:ClassDef_L22_C0", "vector": [2, 1, 0.9371, 0.0286, 1, 0.78, 0.9667, 913, 0, 4, 0, 0, 0, 0, 3], "semantic": {"name": "_write_list", "arg_names": ["self", "container_tag", "item_tag", "items"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _write_list(self, container_tag, item_tag, items):\n self._writer.start(container_tag)\n for item in items:\n self._writer.element(item_tag, item)\n self._writer.end(container_tag)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L163_C8", "label": "start()", "type": "expression", "loc": [163, 163], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L162_C4", "vector": [8, 2, 0.9314, 0.0057, 2, 0.02, 0.0, 511, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " self._writer.start(container_tag)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:For_L164_C8", "label": "for item", "type": "for", "loc": [164, 165], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L162_C4", "vector": [6, 2, 0.94, 0.0114, 2, 0.02, 0.5, 434, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "item", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for item in items:\n self._writer.element(item_tag, item)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L165_C12", "label": "element()", "type": "expression", "loc": [165, 165], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:For_L164_C8", "vector": [8, 3, 0.9429, 0.0057, 3, 0.62, 0.0, 736, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "element", "arg_names": [], "import_names": [], "rhs_call_name": "element", "annotation": ""}, "snippet": " self._writer.element(item_tag, item)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L166_C8", "label": "end()", "type": "expression", "loc": [166, 166], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L162_C4", "vector": [8, 2, 0.9486, 0.0057, 2, 0.02, 1.0, 128, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "end", "arg_names": [], "import_names": [], "rhs_call_name": "end", "annotation": ""}, "snippet": " self._writer.end(container_tag)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L168_C4", "label": "_write_status", "type": "function", "loc": [168, 175], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:ClassDef_L22_C0", "vector": [2, 1, 0.98, 0.0457, 1, 0.78, 1.0, 808, 0, 4, 0, 0, 0, 0, 2], "semantic": {"name": "_write_status", "arg_names": ["self", "item", "message", "extra_attrs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _write_status(self, item, message=None, extra_attrs=None):\n attrs = {'status': item.status, 'starttime': item.starttime,\n 'endtime': item.endtime}\n if item.starttime == 'N/A' or item.endtime == 'N/A':\n attrs['elapsedtime'] = item.elapsedtime\n if extra_attrs:\n attrs.update(extra_attrs)\n self._writer.element('status', message, attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:Assign_L169_C8", "label": "attrs =", "type": "assigned_variable", "loc": [169, 170], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L168_C4", "vector": [14, 2, 0.9686, 0.0114, 2, 0.85, 0.0, 251, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "attrs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " attrs = {'status': item.status, 'starttime': item.starttime,\n 'endtime': item.endtime}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:If_L171_C8", "label": "if", "type": "if", "loc": [171, 172], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L168_C4", "vector": [4, 2, 0.98, 0.0114, 2, 0.85, 0.3333, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if item.starttime == 'N/A' or item.endtime == 'N/A':\n attrs['elapsedtime'] = item.elapsedtime"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:Assign_L172_C12", "label": "assign", "type": "assigned_variable", "loc": [172, 172], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:If_L171_C8", "vector": [14, 3, 0.9829, 0.0057, 3, 0.41, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " attrs['elapsedtime'] = item.elapsedtime"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:If_L173_C8", "label": "if", "type": "if", "loc": [173, 174], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L168_C4", "vector": [4, 2, 0.9914, 0.0114, 2, 0.85, 0.6667, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if extra_attrs:\n attrs.update(extra_attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L174_C12", "label": "update()", "type": "expression", "loc": [174, 174], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:If_L173_C8", "vector": [8, 3, 0.9943, 0.0057, 3, 0.78, 0.0, 637, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " attrs.update(extra_attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L175_C8", "label": "element()", "type": "expression", "loc": [175, 175], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L168_C4", "vector": [8, 2, 1.0, 0.0057, 2, 0.85, 1.0, 736, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "element", "arg_names": [], "import_names": [], "rhs_call_name": "element", "annotation": ""}, "snippet": " self._writer.element('status', message, attrs)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99897:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:Assign_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:Assign_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:Assign_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:Assign_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:Try_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:Try_L31_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:Assign_L32_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:Return_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:For_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:For_L42_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L43_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:Return_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L51_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:If_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:If_L52_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L53_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:If_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:If_L56_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L57_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:Assign_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:If_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:If_L61_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:Assign_L62_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:If_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:If_L63_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:Assign_L64_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L67_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L67_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L67_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L73_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L73_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L77_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L77_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L77_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L80_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L82_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L87_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:Assign_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:If_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:If_L89_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:Assign_L90_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:For_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:For_L94_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L95_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L98_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L98_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L99_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L98_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L102_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L103_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L105_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L105_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L106_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L108_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L108_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L109_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L111_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L112_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L114_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L114_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L115_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L117_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L117_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L118_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L120_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L121_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L123_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L123_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L124_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L126_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L126_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L127_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L129_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L130_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L132_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L132_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L133_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L138_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L138_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:Return_L139_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L141_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L141_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:Assign_L142_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L141_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:Assign_L143_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L141_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:Assign_L144_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L141_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L145_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L147_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:If_L148_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:If_L148_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:Return_L149_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:If_L150_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:If_L150_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:Return_L151_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:If_L152_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:If_L152_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:Return_L153_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:Return_L154_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L156_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L156_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L157_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L159_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L159_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L160_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L162_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L162_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L163_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L162_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:For_L164_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:For_L164_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L165_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L162_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L166_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L168_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L168_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:Assign_L169_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L168_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:If_L171_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:If_L171_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:Assign_L172_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L168_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:If_L173_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:If_L173_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L174_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99897:FunctionDef_L168_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99897:Expr_L175_C8"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from robot.common.statistics import Statistics
from loggerhelper import AbstractLogger
from logger import LOGGER
from xmllogger import XmlLogger
from listeners import Listeners
from debugfile import DebugFile
from stdoutlogsplitter import StdoutLogSplitter
class Output(AbstractLogger):
def __init__(self, settings):
AbstractLogger.__init__(self)
self._xmllogger = XmlLogger(settings['Output'], settings['LogLevel'])
self._register_loggers(settings['Listeners'], settings['DebugFile'])
self._settings = settings
self._set_global_output()
def _register_loggers(self, listeners, debugfile):
LOGGER.register_context_changing_logger(self._xmllogger)
for logger in Listeners(listeners), DebugFile(debugfile):
if logger: LOGGER.register_logger(logger)
LOGGER.disable_message_cache()
def _set_global_output(self):
# This is a hack. Hopefully we get rid of it at some point.
from robot import output
output.OUTPUT = self
def close(self, suite):
stats = Statistics(suite, self._settings['SuiteStatLevel'],
self._settings['TagStatInclude'],
self._settings['TagStatExclude'],
self._settings['TagStatCombine'],
self._settings['TagDoc'],
self._settings['TagStatLink'])
stats.serialize(self._xmllogger)
self._xmllogger.close()
LOGGER.unregister_logger(self._xmllogger)
LOGGER.output_file('Output', self._settings['Output'])
def start_suite(self, suite):
LOGGER.start_suite(suite)
def end_suite(self, suite):
LOGGER.end_suite(suite)
def start_test(self, test):
LOGGER.start_test(test)
def end_test(self, test):
LOGGER.end_test(test)
def start_keyword(self, kw):
LOGGER.start_keyword(kw)
def end_keyword(self, kw):
LOGGER.end_keyword(kw)
def log_output(self, output):
for msg in StdoutLogSplitter(output):
self.message(msg)
def message(self, msg):
LOGGER.log_message(msg)
def set_log_level(self, level):
return self._xmllogger.set_log_level(level)
| ajibawa-2023/Python-Code-Large/train/row_99898 | 48 | 83 | 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_99898:ImportFrom_L15_C0", "label": "from robot.common.statistics import Statistics", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.1807, 0.012, 0, 0.66, 0.0, 471, 0, 1, 0, 0, 471, 0, 0], "semantic": {"name": "robot.common.statistics", "arg_names": [], "import_names": ["Statistics"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot.common.statistics import Statistics"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99898:ImportFrom_L17_C0", "label": "from loggerhelper import AbstractLogger", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.2048, 0.012, 0, 0.66, 0.1429, 426, 0, 1, 0, 0, 426, 0, 0], "semantic": {"name": "loggerhelper", "arg_names": [], "import_names": ["AbstractLogger"], "rhs_call_name": "", "annotation": ""}, "snippet": "from loggerhelper import AbstractLogger"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99898:ImportFrom_L18_C0", "label": "from logger import LOGGER", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.2169, 0.012, 0, 0.66, 0.2857, 532, 0, 1, 0, 0, 532, 0, 0], "semantic": {"name": "logger", "arg_names": [], "import_names": ["LOGGER"], "rhs_call_name": "", "annotation": ""}, "snippet": "from logger import LOGGER"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99898:ImportFrom_L19_C0", "label": "from xmllogger import XmlLogger", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.2289, 0.012, 0, 0.66, 0.4286, 950, 0, 1, 0, 0, 950, 0, 0], "semantic": {"name": "xmllogger", "arg_names": [], "import_names": ["XmlLogger"], "rhs_call_name": "", "annotation": ""}, "snippet": "from xmllogger import XmlLogger"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99898:ImportFrom_L20_C0", "label": "from listeners import Listeners", "type": "import", "loc": [20, 20], "level": 0, "parent": null, "vector": [1, 0, 0.241, 0.012, 0, 0.66, 0.5714, 272, 0, 1, 0, 0, 272, 0, 0], "semantic": {"name": "listeners", "arg_names": [], "import_names": ["Listeners"], "rhs_call_name": "", "annotation": ""}, "snippet": "from listeners import Listeners"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99898:ImportFrom_L21_C0", "label": "from debugfile import DebugFile", "type": "import", "loc": [21, 21], "level": 0, "parent": null, "vector": [1, 0, 0.253, 0.012, 0, 0.66, 0.7143, 736, 0, 1, 0, 0, 736, 0, 0], "semantic": {"name": "debugfile", "arg_names": [], "import_names": ["DebugFile"], "rhs_call_name": "", "annotation": ""}, "snippet": "from debugfile import DebugFile"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99898:ImportFrom_L22_C0", "label": "from stdoutlogsplitter import StdoutLogSplitter", "type": "import", "loc": [22, 22], "level": 0, "parent": null, "vector": [1, 0, 0.2651, 0.012, 0, 0.66, 0.8571, 593, 0, 1, 0, 0, 593, 0, 0], "semantic": {"name": "stdoutlogsplitter", "arg_names": [], "import_names": ["StdoutLogSplitter"], "rhs_call_name": "", "annotation": ""}, "snippet": "from stdoutlogsplitter import StdoutLogSplitter"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99898:ClassDef_L25_C0", "label": "Output", "type": "class", "loc": [25, 83], "level": 0, "parent": null, "vector": [3, 0, 0.6506, 0.7108, 0, 0.66, 1.0, 581, 0, 13, 0, 0, 61, 0, 24], "semantic": {"name": "Output", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Output(AbstractLogger):\n\n def __init__(self, settings):\n AbstractLogger.__init__(self)\n self._xmllogger = XmlLogger(settings['Output'], settings['LogLevel'])\n self._register_loggers(settings['Listeners'], settings['DebugFile'])\n self._settings = settings\n self._set_global_output()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L27_C4", "label": "__init__", "type": "function", "loc": [27, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99898:ClassDef_L25_C0", "vector": [2, 1, 0.3554, 0.0723, 1, 0.64, 0.0, 555, 0, 2, 0, 0, 0, 0, 4], "semantic": {"name": "__init__", "arg_names": ["self", "settings"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, settings):\n AbstractLogger.__init__(self)\n self._xmllogger = XmlLogger(settings['Output'], settings['LogLevel'])\n self._register_loggers(settings['Listeners'], settings['DebugFile'])\n self._settings = settings\n self._set_global_output()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99898:Expr_L28_C8", "label": "__init__()", "type": "expression", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L27_C4", "vector": [8, 2, 0.3373, 0.012, 2, 0.33, 0.0, 555, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " AbstractLogger.__init__(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99898:Assign_L29_C8", "label": "self._xmllogger = XmlLogger()", "type": "assigned_variable", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L27_C4", "vector": [14, 2, 0.3494, 0.012, 2, 0.33, 0.25, 384, 3, 2, 0, 0, 137, 10, 1], "semantic": {"name": "self._xmllogger", "arg_names": [], "import_names": [], "rhs_call_name": "XmlLogger", "annotation": ""}, "snippet": " self._xmllogger = XmlLogger(settings['Output'], settings['LogLevel'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99898:Expr_L30_C8", "label": "_register_loggers()", "type": "expression", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L27_C4", "vector": [8, 2, 0.3614, 0.012, 2, 0.33, 0.5, 830, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_register_loggers", "arg_names": [], "import_names": [], "rhs_call_name": "_register_loggers", "annotation": ""}, "snippet": " self._register_loggers(settings['Listeners'], settings['DebugFile'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99898:Assign_L31_C8", "label": "self._settings =", "type": "assigned_variable", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L27_C4", "vector": [14, 2, 0.3735, 0.012, 2, 0.33, 0.75, 417, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._settings", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._settings = settings"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99898:Expr_L32_C8", "label": "_set_global_output()", "type": "expression", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L27_C4", "vector": [8, 2, 0.3855, 0.012, 2, 0.33, 1.0, 881, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_set_global_output", "arg_names": [], "import_names": [], "rhs_call_name": "_set_global_output", "annotation": ""}, "snippet": " self._set_global_output()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L34_C4", "label": "_register_loggers", "type": "function", "loc": [34, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99898:ClassDef_L25_C0", "vector": [2, 1, 0.4337, 0.0602, 1, 0.64, 0.0833, 830, 0, 3, 0, 0, 0, 0, 5], "semantic": {"name": "_register_loggers", "arg_names": ["self", "listeners", "debugfile"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _register_loggers(self, listeners, debugfile):\n LOGGER.register_context_changing_logger(self._xmllogger)\n for logger in Listeners(listeners), DebugFile(debugfile):\n if logger: LOGGER.register_logger(logger)\n LOGGER.disable_message_cache()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99898:Expr_L35_C8", "label": "register_context_changing_logger()", "type": "expression", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L34_C4", "vector": [8, 2, 0.4217, 0.012, 2, 0.24, 0.0, 263, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "register_context_changing_logger", "arg_names": [], "import_names": [], "rhs_call_name": "register_context_changing_logger", "annotation": ""}, "snippet": " LOGGER.register_context_changing_logger(self._xmllogger)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99898:For_L36_C8", "label": "for logger", "type": "for", "loc": [36, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L34_C4", "vector": [6, 2, 0.4398, 0.0241, 2, 0.24, 0.5, 532, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "logger", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for logger in Listeners(listeners), DebugFile(debugfile):\n if logger: LOGGER.register_logger(logger)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99898:If_L37_C12", "label": "if", "type": "if", "loc": [37, 37], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99898:For_L36_C8", "vector": [4, 3, 0.4458, 0.012, 3, 0.6, 0.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if logger: LOGGER.register_logger(logger)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99898:Expr_L37_C23", "label": "register_logger()", "type": "expression", "loc": [37, 37], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99898:If_L37_C12", "vector": [8, 4, 0.4458, 0.012, 4, 0.4, 0.0, 587, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "register_logger", "arg_names": [], "import_names": [], "rhs_call_name": "register_logger", "annotation": ""}, "snippet": " if logger: LOGGER.register_logger(logger)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99898:Expr_L38_C8", "label": "disable_message_cache()", "type": "expression", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L34_C4", "vector": [8, 2, 0.4578, 0.012, 2, 0.24, 1.0, 205, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "disable_message_cache", "arg_names": [], "import_names": [], "rhs_call_name": "disable_message_cache", "annotation": ""}, "snippet": " LOGGER.disable_message_cache()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L40_C4", "label": "_set_global_output", "type": "function", "loc": [40, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99898:ClassDef_L25_C0", "vector": [2, 1, 0.5, 0.0482, 1, 0.64, 0.1667, 881, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "_set_global_output", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _set_global_output(self):\n # This is a hack. Hopefully we get rid of it at some point.\n from robot import output\n output.OUTPUT = self"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99898:ImportFrom_L42_C8", "label": "from robot import output", "type": "import", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L40_C4", "vector": [1, 2, 0.506, 0.012, 2, 0.95, 0.0, 735, 0, 1, 0, 0, 735, 0, 0], "semantic": {"name": "robot", "arg_names": [], "import_names": ["output"], "rhs_call_name": "", "annotation": ""}, "snippet": " from robot import output"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99898:Assign_L43_C8", "label": "output.OUTPUT =", "type": "assigned_variable", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L40_C4", "vector": [14, 2, 0.5181, 0.012, 2, 0.95, 1.0, 787, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "output.OUTPUT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " output.OUTPUT = self"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L45_C4", "label": "close", "type": "function", "loc": [45, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99898:ClassDef_L25_C0", "vector": [2, 1, 0.6024, 0.1325, 1, 0.64, 0.25, 77, 0, 2, 0, 0, 0, 0, 5], "semantic": {"name": "close", "arg_names": ["self", "suite"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def close(self, suite):\n stats = Statistics(suite, self._settings['SuiteStatLevel'],\n self._settings['TagStatInclude'],\n self._settings['TagStatExclude'],\n self._settings['TagStatCombine'],\n self._settings['TagDoc'],\n self._settings['TagStatLink'])\n stats.serialize(self._xmllogger)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99898:Assign_L46_C8", "label": "stats = Statistics()", "type": "assigned_variable", "loc": [46, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L45_C4", "vector": [14, 2, 0.5843, 0.0723, 2, 0.01, 0.0, 318, 3, 7, 0, 0, 138, 10, 1], "semantic": {"name": "stats", "arg_names": [], "import_names": [], "rhs_call_name": "Statistics", "annotation": ""}, "snippet": " stats = Statistics(suite, self._settings['SuiteStatLevel'],\n self._settings['TagStatInclude'],\n self._settings['TagStatExclude'],\n self._settings['TagStatCombine'],\n self._settings['TagDoc'],\n self._settings['TagStatLink'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99898:Expr_L52_C8", "label": "serialize()", "type": "expression", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L45_C4", "vector": [8, 2, 0.6265, 0.012, 2, 0.01, 0.25, 50, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "serialize", "arg_names": [], "import_names": [], "rhs_call_name": "serialize", "annotation": ""}, "snippet": " stats.serialize(self._xmllogger)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99898:Expr_L53_C8", "label": "close()", "type": "expression", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L45_C4", "vector": [8, 2, 0.6386, 0.012, 2, 0.01, 0.5, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " self._xmllogger.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99898:Expr_L54_C8", "label": "unregister_logger()", "type": "expression", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L45_C4", "vector": [8, 2, 0.6506, 0.012, 2, 0.01, 0.75, 898, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "unregister_logger", "arg_names": [], "import_names": [], "rhs_call_name": "unregister_logger", "annotation": ""}, "snippet": " LOGGER.unregister_logger(self._xmllogger)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99898:Expr_L55_C8", "label": "output_file()", "type": "expression", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L45_C4", "vector": [8, 2, 0.6627, 0.012, 2, 0.01, 1.0, 395, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "output_file", "arg_names": [], "import_names": [], "rhs_call_name": "output_file", "annotation": ""}, "snippet": " LOGGER.output_file('Output', self._settings['Output'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L57_C4", "label": "start_suite", "type": "function", "loc": [57, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99898:ClassDef_L25_C0", "vector": [2, 1, 0.6928, 0.0241, 1, 0.64, 0.3333, 38, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "start_suite", "arg_names": ["self", "suite"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start_suite(self, suite):\n LOGGER.start_suite(suite)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99898:Expr_L58_C8", "label": "start_suite()", "type": "expression", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L57_C4", "vector": [8, 2, 0.6988, 0.012, 2, 0.43, 0.0, 38, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "start_suite", "arg_names": [], "import_names": [], "rhs_call_name": "start_suite", "annotation": ""}, "snippet": " LOGGER.start_suite(suite)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L60_C4", "label": "end_suite", "type": "function", "loc": [60, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99898:ClassDef_L25_C0", "vector": [2, 1, 0.7289, 0.0241, 1, 0.64, 0.4167, 81, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "end_suite", "arg_names": ["self", "suite"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end_suite(self, suite):\n LOGGER.end_suite(suite)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99898:Expr_L61_C8", "label": "end_suite()", "type": "expression", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L60_C4", "vector": [8, 2, 0.7349, 0.012, 2, 0.23, 0.0, 81, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "end_suite", "arg_names": [], "import_names": [], "rhs_call_name": "end_suite", "annotation": ""}, "snippet": " LOGGER.end_suite(suite)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L63_C4", "label": "start_test", "type": "function", "loc": [63, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99898:ClassDef_L25_C0", "vector": [2, 1, 0.7651, 0.0241, 1, 0.64, 0.5, 246, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "start_test", "arg_names": ["self", "test"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start_test(self, test):\n LOGGER.start_test(test)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99898:Expr_L64_C8", "label": "start_test()", "type": "expression", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L63_C4", "vector": [8, 2, 0.7711, 0.012, 2, 0.65, 0.0, 246, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "start_test", "arg_names": [], "import_names": [], "rhs_call_name": "start_test", "annotation": ""}, "snippet": " LOGGER.start_test(test)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L66_C4", "label": "end_test", "type": "function", "loc": [66, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99898:ClassDef_L25_C0", "vector": [2, 1, 0.8012, 0.0241, 1, 0.64, 0.5833, 220, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "end_test", "arg_names": ["self", "test"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end_test(self, test):\n LOGGER.end_test(test)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99898:Expr_L67_C8", "label": "end_test()", "type": "expression", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L66_C4", "vector": [8, 2, 0.8072, 0.012, 2, 0.21, 0.0, 220, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "end_test", "arg_names": [], "import_names": [], "rhs_call_name": "end_test", "annotation": ""}, "snippet": " LOGGER.end_test(test)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L69_C4", "label": "start_keyword", "type": "function", "loc": [69, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99898:ClassDef_L25_C0", "vector": [2, 1, 0.8373, 0.0241, 1, 0.64, 0.6667, 776, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "start_keyword", "arg_names": ["self", "kw"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start_keyword(self, kw):\n LOGGER.start_keyword(kw)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99898:Expr_L70_C8", "label": "start_keyword()", "type": "expression", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L69_C4", "vector": [8, 2, 0.8434, 0.012, 2, 0.97, 0.0, 776, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "start_keyword", "arg_names": [], "import_names": [], "rhs_call_name": "start_keyword", "annotation": ""}, "snippet": " LOGGER.start_keyword(kw)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L72_C4", "label": "end_keyword", "type": "function", "loc": [72, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99898:ClassDef_L25_C0", "vector": [2, 1, 0.8735, 0.0241, 1, 0.64, 0.75, 959, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "end_keyword", "arg_names": ["self", "kw"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end_keyword(self, kw):\n LOGGER.end_keyword(kw)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99898:Expr_L73_C8", "label": "end_keyword()", "type": "expression", "loc": [73, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L72_C4", "vector": [8, 2, 0.8795, 0.012, 2, 0.13, 0.0, 959, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "end_keyword", "arg_names": [], "import_names": [], "rhs_call_name": "end_keyword", "annotation": ""}, "snippet": " LOGGER.end_keyword(kw)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L75_C4", "label": "log_output", "type": "function", "loc": [75, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99898:ClassDef_L25_C0", "vector": [2, 1, 0.9157, 0.0361, 1, 0.64, 0.8333, 414, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "log_output", "arg_names": ["self", "output"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def log_output(self, output):\n for msg in StdoutLogSplitter(output):\n self.message(msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99898:For_L76_C8", "label": "for msg", "type": "for", "loc": [76, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L75_C4", "vector": [6, 2, 0.9217, 0.0241, 2, 0.38, 0.0, 712, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for msg in StdoutLogSplitter(output):\n self.message(msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99898:Expr_L77_C12", "label": "message()", "type": "expression", "loc": [77, 77], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99898:For_L76_C8", "vector": [8, 3, 0.9277, 0.012, 3, 0.58, 0.0, 635, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "message", "arg_names": [], "import_names": [], "rhs_call_name": "message", "annotation": ""}, "snippet": " self.message(msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L79_C4", "label": "message", "type": "function", "loc": [79, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99898:ClassDef_L25_C0", "vector": [2, 1, 0.9578, 0.0241, 1, 0.64, 0.9167, 635, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "message", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def message(self, msg):\n LOGGER.log_message(msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99898:Expr_L80_C8", "label": "log_message()", "type": "expression", "loc": [80, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L79_C4", "vector": [8, 2, 0.9639, 0.012, 2, 0.5, 0.0, 87, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "log_message", "arg_names": [], "import_names": [], "rhs_call_name": "log_message", "annotation": ""}, "snippet": " LOGGER.log_message(msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L82_C4", "label": "set_log_level", "type": "function", "loc": [82, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99898:ClassDef_L25_C0", "vector": [2, 1, 0.994, 0.0241, 1, 0.64, 1.0, 796, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "set_log_level", "arg_names": ["self", "level"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_log_level(self, level):\n return self._xmllogger.set_log_level(level)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99898:Return_L83_C8", "label": "return", "type": "return", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L82_C4", "vector": [13, 2, 1.0, 0.012, 2, 0.95, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._xmllogger.set_log_level(level)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99898:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99898:Expr_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99898:Assign_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99898:Expr_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99898:Assign_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99898:Expr_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99898:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99898:Expr_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99898:For_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99898:For_L36_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99898:If_L37_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99898:If_L37_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99898:Expr_L37_C23"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99898:Expr_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99898:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99898:ImportFrom_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99898:Assign_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99898:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99898:Assign_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99898:Expr_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99898:Expr_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99898:Expr_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99898:Expr_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99898:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99898:Expr_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99898:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99898:Expr_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99898:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99898:Expr_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99898:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L66_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99898:Expr_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99898:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99898:Expr_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99898:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L72_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99898:Expr_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99898:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99898:For_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99898:For_L76_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99898:Expr_L77_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99898:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L79_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L79_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99898:Expr_L80_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99898:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L82_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99898:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99898:Return_L83_C8"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import sys
from robot import utils
from highlighting import Highlighter, NoHighlighting
from loggerhelper import IsLogged
class CommandLineMonitor:
def __init__(self, width=78, colors='AUTO'):
self._width = width
self._highlighter = StatusHighlighter(colors)
self._is_logged = IsLogged('WARN')
self._started = False
def start_suite(self, suite):
if not self._started:
self._write_separator('=')
self._started = True
self._write_info(suite.longname, suite.doc, start_suite=True)
self._write_separator('=')
def end_suite(self, suite):
self._write_info(suite.longname, suite.doc)
self._write_status(suite.status)
self._write_message(suite.get_full_message())
self._write_separator('=')
def start_test(self, test):
self._write_info(test.name, test.doc)
def end_test(self, test):
self._write_status(test.status)
self._write_message(test.message)
self._write_separator('-')
def message(self, msg):
if self._is_logged(msg.level):
self._write_with_highlighting('[ ', msg.level, ' ] ' + msg.message,
stream=sys.__stderr__)
def output_file(self, name, path):
self._write('%-8s %s' % (name+':', path))
def _write_info(self, name, doc, start_suite=False):
maxwidth = self._width
if not start_suite:
maxwidth -= len(' | PASS |')
info = self._get_info(name, doc, maxwidth)
self._write(info, newline=start_suite)
def _get_info(self, name, doc, maxwidth):
if utils.get_console_length(name) > maxwidth:
return utils.pad_console_length(name, maxwidth, cut_left=True)
info = name if not doc else '%s :: %s' % (name, doc.splitlines()[0])
return utils.pad_console_length(info, maxwidth)
def _write_status(self, status):
self._write_with_highlighting(' | ', status, ' |')
def _write_message(self, message):
if message:
self._write(message.strip())
def _write_separator(self, sep_char):
self._write(sep_char * self._width)
def _write(self, message, newline=True, stream=sys.__stdout__):
if newline:
message += '\n'
stream.write(utils.encode_output(message).replace('\t', ' '*8))
stream.flush()
def _write_with_highlighting(self, before, highlighted, after,
newline=True, stream=sys.__stdout__):
self._write(before, newline=False, stream=stream)
self._highlighter.start(highlighted, stream)
self._write(highlighted, newline=False, stream=stream)
self._highlighter.end()
self._write(after, newline=newline, stream=stream)
class StatusHighlighter:
def __init__(self, colors):
self._current = None
self._highlighters = {
sys.__stdout__: self._get_highlighter(sys.__stdout__, colors),
sys.__stderr__: self._get_highlighter(sys.__stderr__, colors)
}
def start(self, message, stream=sys.__stdout__):
self._current = self._highlighters[stream]
{'PASS': self._current.green,
'FAIL': self._current.red,
'ERROR': self._current.red,
'WARN': self._current.yellow}[message]()
def end(self):
self._current.reset()
def _get_highlighter(self, stream, colors):
auto = hasattr(stream, 'isatty') and stream.isatty()
enable = {'AUTO': auto,
'ON': True,
'FORCE': True, # compatibility with 2.5.5 and earlier
'OFF': False}.get(colors.upper(), auto)
return Highlighter(stream) if enable else NoHighlighting(stream)
| ajibawa-2023/Python-Code-Large/train/row_99899 | 72 | 121 | 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_99899:Import_L15_C0", "label": "sys import sys", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.124, 0.0083, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99899:ImportFrom_L17_C0", "label": "from robot import utils", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.1405, 0.0083, 0, 0.66, 0.2, 735, 0, 1, 0, 0, 735, 0, 0], "semantic": {"name": "robot", "arg_names": [], "import_names": ["utils"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot import utils"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99899:ImportFrom_L18_C0", "label": "from highlighting import Highlighter, NoHighlighting", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.1488, 0.0083, 0, 0.66, 0.4, 540, 0, 2, 0, 0, 540, 0, 0], "semantic": {"name": "highlighting", "arg_names": [], "import_names": ["Highlighter", "NoHighlighting"], "rhs_call_name": "", "annotation": ""}, "snippet": "from highlighting import Highlighter, NoHighlighting"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99899:ImportFrom_L19_C0", "label": "from loggerhelper import IsLogged", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.157, 0.0083, 0, 0.66, 0.6, 426, 0, 1, 0, 0, 426, 0, 0], "semantic": {"name": "loggerhelper", "arg_names": [], "import_names": ["IsLogged"], "rhs_call_name": "", "annotation": ""}, "snippet": "from loggerhelper import IsLogged"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99899:ClassDef_L22_C0", "label": "CommandLineMonitor", "type": "class", "loc": [22, 93], "level": 0, "parent": null, "vector": [3, 0, 0.4752, 0.595, 0, 0.66, 0.8, 41, 0, 14, 0, 0, 0, 0, 37], "semantic": {"name": "CommandLineMonitor", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class CommandLineMonitor:\n\n def __init__(self, width=78, colors='AUTO'):\n self._width = width\n self._highlighter = StatusHighlighter(colors)\n self._is_logged = IsLogged('WARN')\n self._started = False\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L24_C4", "label": "__init__", "type": "function", "loc": [24, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99899:ClassDef_L22_C0", "vector": [2, 1, 0.2149, 0.0413, 1, 0.84, 0.0, 555, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "width", "colors"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, width=78, colors='AUTO'):\n self._width = width\n self._highlighter = StatusHighlighter(colors)\n self._is_logged = IsLogged('WARN')\n self._started = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99899:Assign_L25_C8", "label": "self._width =", "type": "assigned_variable", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L24_C4", "vector": [14, 2, 0.2066, 0.0083, 2, 0.74, 0.0, 109, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._width", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._width = width"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99899:Assign_L26_C8", "label": "self._highlighter = StatusHighlighter()", "type": "assigned_variable", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L24_C4", "vector": [14, 2, 0.2149, 0.0083, 2, 0.74, 0.3333, 527, 3, 1, 0, 0, 309, 10, 1], "semantic": {"name": "self._highlighter", "arg_names": [], "import_names": [], "rhs_call_name": "StatusHighlighter", "annotation": ""}, "snippet": " self._highlighter = StatusHighlighter(colors)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99899:Assign_L27_C8", "label": "self._is_logged = IsLogged()", "type": "assigned_variable", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L24_C4", "vector": [14, 2, 0.2231, 0.0083, 2, 0.74, 0.6667, 427, 3, 1, 0, 0, 467, 10, 1], "semantic": {"name": "self._is_logged", "arg_names": [], "import_names": [], "rhs_call_name": "IsLogged", "annotation": ""}, "snippet": " self._is_logged = IsLogged('WARN')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99899:Assign_L28_C8", "label": "self._started =", "type": "assigned_variable", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L24_C4", "vector": [14, 2, 0.2314, 0.0083, 2, 0.74, 1.0, 929, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self._started", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._started = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L30_C4", "label": "start_suite", "type": "function", "loc": [30, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99899:ClassDef_L22_C0", "vector": [2, 1, 0.2686, 0.0496, 1, 0.84, 0.0769, 38, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "start_suite", "arg_names": ["self", "suite"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start_suite(self, suite):\n if not self._started:\n self._write_separator('=')\n self._started = True\n self._write_info(suite.longname, suite.doc, start_suite=True)\n self._write_separator('=')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99899:If_L31_C8", "label": "if", "type": "if", "loc": [31, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L30_C4", "vector": [4, 2, 0.2645, 0.0248, 2, 0.6, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self._started:\n self._write_separator('=')\n self._started = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99899:Expr_L32_C12", "label": "_write_separator()", "type": "expression", "loc": [32, 32], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99899:If_L31_C8", "vector": [8, 3, 0.2645, 0.0083, 3, 0.82, 0.0, 947, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_write_separator", "arg_names": [], "import_names": [], "rhs_call_name": "_write_separator", "annotation": ""}, "snippet": " self._write_separator('=')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99899:Assign_L33_C12", "label": "self._started =", "type": "assigned_variable", "loc": [33, 33], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99899:If_L31_C8", "vector": [14, 3, 0.2727, 0.0083, 3, 0.82, 1.0, 929, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self._started", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._started = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99899:Expr_L34_C8", "label": "_write_info()", "type": "expression", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L30_C4", "vector": [8, 2, 0.281, 0.0083, 2, 0.6, 0.5, 387, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "_write_info", "arg_names": [], "import_names": [], "rhs_call_name": "_write_info", "annotation": ""}, "snippet": " self._write_info(suite.longname, suite.doc, start_suite=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99899:Expr_L35_C8", "label": "_write_separator()", "type": "expression", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L30_C4", "vector": [8, 2, 0.2893, 0.0083, 2, 0.6, 1.0, 947, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_write_separator", "arg_names": [], "import_names": [], "rhs_call_name": "_write_separator", "annotation": ""}, "snippet": " self._write_separator('=')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L37_C4", "label": "end_suite", "type": "function", "loc": [37, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99899:ClassDef_L22_C0", "vector": [2, 1, 0.3223, 0.0413, 1, 0.84, 0.1538, 81, 0, 2, 0, 0, 0, 0, 5], "semantic": {"name": "end_suite", "arg_names": ["self", "suite"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end_suite(self, suite):\n self._write_info(suite.longname, suite.doc)\n self._write_status(suite.status)\n self._write_message(suite.get_full_message())\n self._write_separator('=')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99899:Expr_L38_C8", "label": "_write_info()", "type": "expression", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L37_C4", "vector": [8, 2, 0.314, 0.0083, 2, 0.18, 0.0, 387, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_write_info", "arg_names": [], "import_names": [], "rhs_call_name": "_write_info", "annotation": ""}, "snippet": " self._write_info(suite.longname, suite.doc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99899:Expr_L39_C8", "label": "_write_status()", "type": "expression", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L37_C4", "vector": [8, 2, 0.3223, 0.0083, 2, 0.18, 0.3333, 808, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_write_status", "arg_names": [], "import_names": [], "rhs_call_name": "_write_status", "annotation": ""}, "snippet": " self._write_status(suite.status)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99899:Expr_L40_C8", "label": "_write_message()", "type": "expression", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L37_C4", "vector": [8, 2, 0.3306, 0.0083, 2, 0.18, 0.6667, 257, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "_write_message", "arg_names": [], "import_names": [], "rhs_call_name": "_write_message", "annotation": ""}, "snippet": " self._write_message(suite.get_full_message())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99899:Expr_L41_C8", "label": "_write_separator()", "type": "expression", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L37_C4", "vector": [8, 2, 0.3388, 0.0083, 2, 0.18, 1.0, 947, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_write_separator", "arg_names": [], "import_names": [], "rhs_call_name": "_write_separator", "annotation": ""}, "snippet": " self._write_separator('=')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L43_C4", "label": "start_test", "type": "function", "loc": [43, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99899:ClassDef_L22_C0", "vector": [2, 1, 0.3595, 0.0165, 1, 0.84, 0.2308, 246, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "start_test", "arg_names": ["self", "test"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start_test(self, test):\n self._write_info(test.name, test.doc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99899:Expr_L44_C8", "label": "_write_info()", "type": "expression", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L43_C4", "vector": [8, 2, 0.3636, 0.0083, 2, 0.27, 0.0, 387, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_write_info", "arg_names": [], "import_names": [], "rhs_call_name": "_write_info", "annotation": ""}, "snippet": " self._write_info(test.name, test.doc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L46_C4", "label": "end_test", "type": "function", "loc": [46, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99899:ClassDef_L22_C0", "vector": [2, 1, 0.3926, 0.0331, 1, 0.84, 0.3077, 220, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "end_test", "arg_names": ["self", "test"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end_test(self, test):\n self._write_status(test.status)\n self._write_message(test.message)\n self._write_separator('-')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99899:Expr_L47_C8", "label": "_write_status()", "type": "expression", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L46_C4", "vector": [8, 2, 0.3884, 0.0083, 2, 0.04, 0.0, 808, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_write_status", "arg_names": [], "import_names": [], "rhs_call_name": "_write_status", "annotation": ""}, "snippet": " self._write_status(test.status)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99899:Expr_L48_C8", "label": "_write_message()", "type": "expression", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L46_C4", "vector": [8, 2, 0.3967, 0.0083, 2, 0.04, 0.5, 257, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_write_message", "arg_names": [], "import_names": [], "rhs_call_name": "_write_message", "annotation": ""}, "snippet": " self._write_message(test.message)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99899:Expr_L49_C8", "label": "_write_separator()", "type": "expression", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L46_C4", "vector": [8, 2, 0.405, 0.0083, 2, 0.04, 1.0, 947, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_write_separator", "arg_names": [], "import_names": [], "rhs_call_name": "_write_separator", "annotation": ""}, "snippet": " self._write_separator('-')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L51_C4", "label": "message", "type": "function", "loc": [51, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99899:ClassDef_L22_C0", "vector": [2, 1, 0.4339, 0.0331, 1, 0.84, 0.3846, 635, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "message", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def message(self, msg):\n if self._is_logged(msg.level):\n self._write_with_highlighting('[ ', msg.level, ' ] ' + msg.message,\n stream=sys.__stderr__)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99899:If_L52_C8", "label": "if", "type": "if", "loc": [52, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L51_C4", "vector": [4, 2, 0.438, 0.0248, 2, 0.81, 0.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._is_logged(msg.level):\n self._write_with_highlighting('[ ', msg.level, ' ] ' + msg.message,\n stream=sys.__stderr__)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99899:Expr_L53_C12", "label": "_write_with_highlighting()", "type": "expression", "loc": [53, 54], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99899:If_L52_C8", "vector": [8, 3, 0.4421, 0.0165, 3, 0.12, 0.0, 583, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "_write_with_highlighting", "arg_names": [], "import_names": [], "rhs_call_name": "_write_with_highlighting", "annotation": ""}, "snippet": " self._write_with_highlighting('[ ', msg.level, ' ] ' + msg.message,\n stream=sys.__stderr__)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L55_C4", "label": "output_file", "type": "function", "loc": [55, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99899:ClassDef_L22_C0", "vector": [2, 1, 0.4587, 0.0165, 1, 0.84, 0.4615, 395, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "output_file", "arg_names": ["self", "name", "path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def output_file(self, name, path):\n self._write('%-8s %s' % (name+':', path))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99899:Expr_L56_C8", "label": "_write()", "type": "expression", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L55_C4", "vector": [8, 2, 0.4628, 0.0083, 2, 0.44, 0.0, 961, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_write", "arg_names": [], "import_names": [], "rhs_call_name": "_write", "annotation": ""}, "snippet": " self._write('%-8s %s' % (name+':', path))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L58_C4", "label": "_write_info", "type": "function", "loc": [58, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99899:ClassDef_L22_C0", "vector": [2, 1, 0.5, 0.0496, 1, 0.84, 0.5385, 387, 0, 4, 0, 0, 0, 0, 3], "semantic": {"name": "_write_info", "arg_names": ["self", "name", "doc", "start_suite"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _write_info(self, name, doc, start_suite=False):\n maxwidth = self._width\n if not start_suite:\n maxwidth -= len(' | PASS |')\n info = self._get_info(name, doc, maxwidth)\n self._write(info, newline=start_suite)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99899:Assign_L59_C8", "label": "maxwidth =", "type": "assigned_variable", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L58_C4", "vector": [14, 2, 0.4876, 0.0083, 2, 0.17, 0.0, 610, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "maxwidth", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " maxwidth = self._width"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99899:If_L60_C8", "label": "if", "type": "if", "loc": [60, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L58_C4", "vector": [4, 2, 0.5, 0.0165, 2, 0.17, 0.3333, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not start_suite:\n maxwidth -= len(' | PASS |')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99899:Assign_L62_C8", "label": "info = _get_info()", "type": "assigned_variable", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L58_C4", "vector": [14, 2, 0.5124, 0.0083, 2, 0.17, 0.6667, 730, 3, 3, 0, 0, 918, 10, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "_get_info", "annotation": ""}, "snippet": " info = self._get_info(name, doc, maxwidth)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99899:Expr_L63_C8", "label": "_write()", "type": "expression", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L58_C4", "vector": [8, 2, 0.5207, 0.0083, 2, 0.17, 1.0, 961, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_write", "arg_names": [], "import_names": [], "rhs_call_name": "_write", "annotation": ""}, "snippet": " self._write(info, newline=start_suite)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L65_C4", "label": "_get_info", "type": "function", "loc": [65, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99899:ClassDef_L22_C0", "vector": [2, 1, 0.5537, 0.0413, 1, 0.84, 0.6154, 918, 0, 4, 1, 0, 0, 0, 4], "semantic": {"name": "_get_info", "arg_names": ["self", "name", "doc", "maxwidth"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_info(self, name, doc, maxwidth):\n if utils.get_console_length(name) > maxwidth:\n return utils.pad_console_length(name, maxwidth, cut_left=True)\n info = name if not doc else '%s :: %s' % (name, doc.splitlines()[0])\n return utils.pad_console_length(info, maxwidth)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99899:If_L66_C8", "label": "if", "type": "if", "loc": [66, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L65_C4", "vector": [4, 2, 0.5496, 0.0165, 2, 0.4, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if utils.get_console_length(name) > maxwidth:\n return utils.pad_console_length(name, maxwidth, cut_left=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99899:Return_L67_C12", "label": "return", "type": "return", "loc": [67, 67], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99899:If_L66_C8", "vector": [13, 3, 0.5537, 0.0083, 3, 0.47, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return utils.pad_console_length(name, maxwidth, cut_left=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99899:Assign_L68_C8", "label": "info =", "type": "assigned_variable", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L65_C4", "vector": [14, 2, 0.562, 0.0083, 2, 0.4, 0.5, 730, 8, 0, 0, 0, 0, 0, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " info = name if not doc else '%s :: %s' % (name, doc.splitlines()[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99899:Return_L69_C8", "label": "return", "type": "return", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L65_C4", "vector": [13, 2, 0.5702, 0.0083, 2, 0.4, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return utils.pad_console_length(info, maxwidth)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L71_C4", "label": "_write_status", "type": "function", "loc": [71, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99899:ClassDef_L22_C0", "vector": [2, 1, 0.5909, 0.0165, 1, 0.84, 0.6923, 808, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_write_status", "arg_names": ["self", "status"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _write_status(self, status):\n self._write_with_highlighting(' | ', status, ' |')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99899:Expr_L72_C8", "label": "_write_with_highlighting()", "type": "expression", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L71_C4", "vector": [8, 2, 0.595, 0.0083, 2, 0.9, 0.0, 583, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "_write_with_highlighting", "arg_names": [], "import_names": [], "rhs_call_name": "_write_with_highlighting", "annotation": ""}, "snippet": " self._write_with_highlighting(' | ', status, ' |')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L74_C4", "label": "_write_message", "type": "function", "loc": [74, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99899:ClassDef_L22_C0", "vector": [2, 1, 0.6198, 0.0248, 1, 0.84, 0.7692, 257, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "_write_message", "arg_names": ["self", "message"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _write_message(self, message):\n if message:\n self._write(message.strip())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99899:If_L75_C8", "label": "if", "type": "if", "loc": [75, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L74_C4", "vector": [4, 2, 0.624, 0.0165, 2, 0.42, 0.0, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if message:\n self._write(message.strip())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99899:Expr_L76_C12", "label": "_write()", "type": "expression", "loc": [76, 76], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99899:If_L75_C8", "vector": [8, 3, 0.6281, 0.0083, 3, 0.53, 0.0, 961, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "_write", "arg_names": [], "import_names": [], "rhs_call_name": "_write", "annotation": ""}, "snippet": " self._write(message.strip())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L78_C4", "label": "_write_separator", "type": "function", "loc": [78, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99899:ClassDef_L22_C0", "vector": [2, 1, 0.6488, 0.0165, 1, 0.84, 0.8462, 947, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_write_separator", "arg_names": ["self", "sep_char"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _write_separator(self, sep_char):\n self._write(sep_char * self._width)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99899:Expr_L79_C8", "label": "_write()", "type": "expression", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L78_C4", "vector": [8, 2, 0.6529, 0.0083, 2, 0.48, 0.0, 961, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_write", "arg_names": [], "import_names": [], "rhs_call_name": "_write", "annotation": ""}, "snippet": " self._write(sep_char * self._width)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L81_C4", "label": "_write", "type": "function", "loc": [81, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99899:ClassDef_L22_C0", "vector": [2, 1, 0.686, 0.0413, 1, 0.84, 0.9231, 961, 0, 4, 0, 0, 0, 0, 4], "semantic": {"name": "_write", "arg_names": ["self", "message", "newline", "stream"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _write(self, message, newline=True, stream=sys.__stdout__):\n if newline:\n message += '\\n'\n stream.write(utils.encode_output(message).replace('\\t', ' '*8))\n stream.flush()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99899:If_L82_C8", "label": "if", "type": "if", "loc": [82, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L81_C4", "vector": [4, 2, 0.6818, 0.0165, 2, 0.98, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if newline:\n message += '\\n'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99899:Expr_L84_C8", "label": "write()", "type": "expression", "loc": [84, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L81_C4", "vector": [8, 2, 0.6942, 0.0083, 2, 0.98, 0.5, 837, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " stream.write(utils.encode_output(message).replace('\\t', ' '*8))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99899:Expr_L85_C8", "label": "flush()", "type": "expression", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L81_C4", "vector": [8, 2, 0.7025, 0.0083, 2, 0.98, 1.0, 439, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "flush", "arg_names": [], "import_names": [], "rhs_call_name": "flush", "annotation": ""}, "snippet": " stream.flush()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L87_C4", "label": "_write_with_highlighting", "type": "function", "loc": [87, 93], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99899:ClassDef_L22_C0", "vector": [2, 1, 0.7438, 0.0579, 1, 0.84, 1.0, 583, 0, 6, 0, 0, 0, 0, 5], "semantic": {"name": "_write_with_highlighting", "arg_names": ["self", "before", "highlighted", "after", "newline", "stream"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _write_with_highlighting(self, before, highlighted, after,\n newline=True, stream=sys.__stdout__):\n self._write(before, newline=False, stream=stream)\n self._highlighter.start(highlighted, stream)\n self._write(highlighted, newline=False, stream=stream)\n self._highlighter.end()\n self._write(after, newline=newline, stream=stream)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99899:Expr_L89_C8", "label": "_write()", "type": "expression", "loc": [89, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L87_C4", "vector": [8, 2, 0.7355, 0.0083, 2, 0.65, 0.0, 961, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "_write", "arg_names": [], "import_names": [], "rhs_call_name": "_write", "annotation": ""}, "snippet": " self._write(before, newline=False, stream=stream)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99899:Expr_L90_C8", "label": "start()", "type": "expression", "loc": [90, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L87_C4", "vector": [8, 2, 0.7438, 0.0083, 2, 0.65, 0.25, 511, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " self._highlighter.start(highlighted, stream)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99899:Expr_L91_C8", "label": "_write()", "type": "expression", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L87_C4", "vector": [8, 2, 0.7521, 0.0083, 2, 0.65, 0.5, 961, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "_write", "arg_names": [], "import_names": [], "rhs_call_name": "_write", "annotation": ""}, "snippet": " self._write(highlighted, newline=False, stream=stream)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99899:Expr_L92_C8", "label": "end()", "type": "expression", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L87_C4", "vector": [8, 2, 0.7603, 0.0083, 2, 0.65, 0.75, 128, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "end", "arg_names": [], "import_names": [], "rhs_call_name": "end", "annotation": ""}, "snippet": " self._highlighter.end()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99899:Expr_L93_C8", "label": "_write()", "type": "expression", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L87_C4", "vector": [8, 2, 0.7686, 0.0083, 2, 0.65, 1.0, 961, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "_write", "arg_names": [], "import_names": [], "rhs_call_name": "_write", "annotation": ""}, "snippet": " self._write(after, newline=newline, stream=stream)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99899:ClassDef_L96_C0", "label": "StatusHighlighter", "type": "class", "loc": [96, 121], "level": 0, "parent": null, "vector": [3, 0, 0.8967, 0.2149, 0, 0.66, 1.0, 309, 0, 4, 0, 0, 0, 0, 10], "semantic": {"name": "StatusHighlighter", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class StatusHighlighter:\n\n def __init__(self, colors):\n self._current = None\n self._highlighters = {\n sys.__stdout__: self._get_highlighter(sys.__stdout__, colors),\n sys.__stderr__: self._get_highlighter(sys.__stderr__, colors)\n }"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L98_C4", "label": "__init__", "type": "function", "loc": [98, 103], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99899:ClassDef_L96_C0", "vector": [2, 1, 0.8306, 0.0496, 1, 0.15, 0.0, 555, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "colors"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, colors):\n self._current = None\n self._highlighters = {\n sys.__stdout__: self._get_highlighter(sys.__stdout__, colors),\n sys.__stderr__: self._get_highlighter(sys.__stderr__, colors)\n }"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99899:Assign_L99_C8", "label": "self._current =", "type": "assigned_variable", "loc": [99, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L98_C4", "vector": [14, 2, 0.8182, 0.0083, 2, 0.6, 0.0, 649, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self._current", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._current = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99899:Assign_L100_C8", "label": "self._highlighters =", "type": "assigned_variable", "loc": [100, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L98_C4", "vector": [14, 2, 0.8388, 0.0331, 2, 0.6, 1.0, 937, 0, 0, 0, 0, 0, 6, 2], "semantic": {"name": "self._highlighters", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._highlighters = {\n sys.__stdout__: self._get_highlighter(sys.__stdout__, colors),\n sys.__stderr__: self._get_highlighter(sys.__stderr__, colors)\n }"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L105_C4", "label": "start", "type": "function", "loc": [105, 110], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99899:ClassDef_L96_C0", "vector": [2, 1, 0.8884, 0.0496, 1, 0.15, 0.3333, 511, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": ["self", "message", "stream"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start(self, message, stream=sys.__stdout__):\n self._current = self._highlighters[stream]\n {'PASS': self._current.green,\n 'FAIL': self._current.red,\n 'ERROR': self._current.red,\n 'WARN': self._current.yellow}[message]()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99899:Assign_L106_C8", "label": "self._current =", "type": "assigned_variable", "loc": [106, 106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L105_C4", "vector": [14, 2, 0.876, 0.0083, 2, 0.78, 0.0, 649, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._current", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._current = self._highlighters[stream]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99899:Expr_L107_C8", "label": "expression", "type": "expression", "loc": [107, 110], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L105_C4", "vector": [8, 2, 0.8967, 0.0331, 2, 0.78, 1.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " {'PASS': self._current.green,\n 'FAIL': self._current.red,\n 'ERROR': self._current.red,\n 'WARN': self._current.yellow}[message]()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L112_C4", "label": "end", "type": "function", "loc": [112, 113], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99899:ClassDef_L96_C0", "vector": [2, 1, 0.9298, 0.0165, 1, 0.15, 0.6667, 128, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "end", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end(self):\n self._current.reset()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99899:Expr_L113_C8", "label": "reset()", "type": "expression", "loc": [113, 113], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L112_C4", "vector": [8, 2, 0.9339, 0.0083, 2, 0.56, 0.0, 944, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "reset", "arg_names": [], "import_names": [], "rhs_call_name": "reset", "annotation": ""}, "snippet": " self._current.reset()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L115_C4", "label": "_get_highlighter", "type": "function", "loc": [115, 121], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99899:ClassDef_L96_C0", "vector": [2, 1, 0.9752, 0.0579, 1, 0.15, 1.0, 700, 0, 3, 1, 0, 0, 0, 6], "semantic": {"name": "_get_highlighter", "arg_names": ["self", "stream", "colors"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_highlighter(self, stream, colors):\n auto = hasattr(stream, 'isatty') and stream.isatty()\n enable = {'AUTO': auto,\n 'ON': True,\n 'FORCE': True, # compatibility with 2.5.5 and earlier\n 'OFF': False}.get(colors.upper(), auto)\n return Highlighter(stream) if enable else NoHighlighting(stream)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99899:Assign_L116_C8", "label": "auto =", "type": "assigned_variable", "loc": [116, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L115_C4", "vector": [14, 2, 0.9587, 0.0083, 2, 0.47, 0.0, 958, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "auto", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " auto = hasattr(stream, 'isatty') and stream.isatty()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99899:Assign_L117_C8", "label": "enable = get()", "type": "assigned_variable", "loc": [117, 120], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L115_C4", "vector": [14, 2, 0.9793, 0.0331, 2, 0.47, 0.5, 976, 3, 2, 0, 0, 607, 10, 2], "semantic": {"name": "enable", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " enable = {'AUTO': auto,\n 'ON': True,\n 'FORCE': True, # compatibility with 2.5.5 and earlier\n 'OFF': False}.get(colors.upper(), auto)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99899:Return_L121_C8", "label": "return", "type": "return", "loc": [121, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L115_C4", "vector": [13, 2, 1.0, 0.0083, 2, 0.47, 1.0, 0, 8, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return Highlighter(stream) if enable else NoHighlighting(stream)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99899:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99899:Assign_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99899:Assign_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99899:Assign_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99899:Assign_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99899:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99899:If_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99899:If_L31_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99899:Expr_L32_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99899:If_L31_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99899:Assign_L33_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99899:Expr_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99899:Expr_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99899:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99899:Expr_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99899:Expr_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99899:Expr_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99899:Expr_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99899:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99899:Expr_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99899:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99899:Expr_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99899:Expr_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99899:Expr_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99899:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L51_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99899:If_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99899:If_L52_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99899:Expr_L53_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99899:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99899:Expr_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99899:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99899:Assign_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99899:If_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99899:Assign_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99899:Expr_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99899:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L65_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99899:If_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99899:If_L66_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99899:Return_L67_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L65_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99899:Assign_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L65_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99899:Return_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99899:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99899:Expr_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99899:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99899:If_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99899:If_L75_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99899:Expr_L76_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99899:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99899:Expr_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99899:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99899:If_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99899:Expr_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99899:Expr_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99899:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L87_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99899:Expr_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99899:Expr_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99899:Expr_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99899:Expr_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99899:Expr_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99899:ClassDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L98_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L98_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99899:Assign_L99_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L98_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99899:Assign_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99899:ClassDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L105_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L105_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99899:Assign_L106_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L105_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99899:Expr_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99899:ClassDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L112_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L112_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99899:Expr_L113_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99899:ClassDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L115_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L115_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99899:Assign_L116_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L115_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99899:Assign_L117_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99899:FunctionDef_L115_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99899:Return_L121_C8"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import os.path
from robot import utils
from robot.errors import DataError
from robot.common import BaseTestSuite, BaseTestCase, BaseKeyword
from robot.output import LOGGER
from robot.output.loggerhelper import IsLogged, Message
def process_outputs(paths, settings):
if not paths:
raise DataError('No output files given.')
if len(paths) == 1:
return process_output(paths[0], log_level=settings['LogLevel'],
settings=settings)
suite = CombinedTestSuite(settings)
exec_errors = CombinedExecutionErrors()
for path in paths:
subsuite, suberrors = process_output(path, log_level=settings['LogLevel'])
suite.add_suite(subsuite)
exec_errors.add(suberrors)
return suite, exec_errors
def process_output(path, log_level=None, settings=None):
"""Process one output file and return TestSuite and ExecutionErrors"""
if not os.path.isfile(path):
raise DataError("Output file '%s' does not exist." % path)
LOGGER.info("Processing output file '%s'." % path)
try:
root = utils.etreewrapper.get_root(path)
except:
raise DataError("Opening XML file '%s' failed: %s"
% (path, utils.get_error_message()))
suite = TestSuite(_get_suite_node(root, path), log_level=log_level,
settings=settings)
errors = ExecutionErrors(_get_errors_node(root))
return suite, errors
def _get_suite_node(root, path):
if root.tag != 'robot':
raise DataError("File '%s' is not Robot Framework output file." % path)
node = root.find('suite')
node.set('generator', root.get('generator', 'notset').split()[0].lower())
node.set('path', path)
return node
def _get_errors_node(root):
return root.find('errors')
class _MissingStatus:
"""If XML was fixed for example by fixml.py, status tag may be missing"""
text = 'Could not find status.'
get = lambda self, name, default: name == 'status' and 'FAIL' or 'N/A'
class _BaseReader:
def __init__(self, node):
self.doc = self._get_doc(node)
stnode = node.find('status')
if stnode is None:
stnode = _MissingStatus()
self.status = stnode.get('status','').upper()
if self.status not in ['PASS','FAIL', 'NOT_RUN']:
raise DataError("Item '%s' has invalid status '%s'"
% (self.name, self.status))
self.message = stnode.text or ''
self.starttime = stnode.get('starttime', 'N/A')
self.endtime = stnode.get('endtime', 'N/A')
self.elapsedtime = utils.get_elapsed_time(self.starttime, self.endtime)
def _get_doc(self, node):
docnode = node.find('doc')
if docnode is not None:
return docnode.text or ''
return ''
class _TestAndSuiteReader(_BaseReader):
def __init__(self, node, log_level=None):
_BaseReader.__init__(self, node)
self.keywords = [Keyword(kw, log_level) for kw in node.findall('kw')]
if self.keywords and self.keywords[0].type == 'setup':
self.setup = self.keywords.pop(0)
if self.keywords and self.keywords[-1].type == 'teardown':
self.teardown = self.keywords.pop(-1)
class _SuiteReader(_TestAndSuiteReader):
def __init__(self, node, log_level=None):
_TestAndSuiteReader.__init__(self, node, log_level)
del(self.keywords)
for metanode in node.findall('metadata/item'):
self.metadata[metanode.get('name')] = metanode.text
def _get_texts(self, node, path):
return [item.text for item in node.findall(path)]
class _TestReader(_TestAndSuiteReader):
def __init__(self, node, log_level=None):
_TestAndSuiteReader.__init__(self, node, log_level)
self.tags = [tag.text for tag in node.findall('tags/tag')]
self.timeout = node.get('timeout', '')
class _KeywordReader(_BaseReader):
def __init__(self, node, log_level=None):
_BaseReader.__init__(self, node)
del(self.message)
self.args = [(arg.text or '') for arg in node.findall('arguments/arg')]
self.type = node.get('type', 'kw')
self.timeout = node.get('timeout', '')
self.keywords = []
self.messages = []
self.children = []
log_filter = IsLogged(log_level or 'TRACE')
for child in node:
if child.tag == 'kw':
kw = Keyword(child, log_level)
self.keywords.append(kw)
self.children.append(kw)
elif child.tag == 'msg' and log_filter(child.get('level', 'INFO')):
msg = MessageFromXml(child)
self.messages.append(msg)
self.children.append(msg)
class TestSuite(BaseTestSuite, _SuiteReader):
def __init__(self, node, parent=None, log_level=None, settings=None):
BaseTestSuite.__init__(self, node.get('name'),
node.get('source', None), parent)
_SuiteReader.__init__(self, node, log_level=log_level)
self._set_times_from_settings(settings)
for snode in node.findall('suite'):
snode.set('generator', node.get('generator'))
snode.set('path', node.get('path'))
TestSuite(snode, parent=self, log_level=log_level)
for tnode in node.findall('test'):
TestCase(tnode, parent=self, log_level=log_level)
self.set_status()
if node.get('generator') == 'robot' and \
self.teardown and self.teardown.status == 'FAIL':
self.suite_teardown_failed()
def _set_times_from_settings(self, settings):
starttime, endtime = self._times_from_settings(settings)
if not self.starttime or starttime != 'N/A':
self.starttime = starttime
if not self.endtime or endtime != 'N/A':
self.endtime = endtime
self.elapsedtime = utils.get_elapsed_time(self.starttime, self.endtime)
def _times_from_settings(self, settings):
if not settings:
return 'N/A', 'N/A'
return (self._get_time(settings['StartTime']),
self._get_time(settings['EndTime']))
def _get_time(self, timestamp):
if not timestamp or utils.eq(timestamp, 'N/A'):
return 'N/A'
try:
secs = utils.timestamp_to_secs(timestamp, seps=list(' :.-_'),
millis=True)
except ValueError:
return 'N/A'
return utils.secs_to_timestamp(secs, millis=True)
def set_status(self):
BaseTestSuite.set_status(self)
if self.starttime == 'N/A' or self.endtime == 'N/A':
subitems = self.suites + self.tests + [self.setup, self.teardown]
self.elapsedtime = sum(item.elapsedtime for item in subitems
if item is not None )
def _set_critical_tags(self, critical):
BaseTestSuite._set_critical_tags(self, critical)
self.set_status()
def _filter_by_tags(self, incls, excls):
ret = BaseTestSuite._filter_by_tags(self, incls, excls)
self.starttime = self.endtime = 'N/A'
self.set_status()
return ret
def _filter_by_names(self, suites, tests):
ret = BaseTestSuite._filter_by_names(self, suites, tests)
self.starttime = self.endtime = 'N/A'
self.set_status()
return ret
def remove_keywords(self, how):
should_remove = ShouldRemoveCallable(how)
if not should_remove:
return
self._remove_fixture_keywords(should_remove)
for suite in self.suites:
suite.remove_keywords(how)
for test in self.tests:
test.remove_keywords(should_remove)
def _remove_fixture_keywords(self, should_remove):
critical_failures = self.critical_stats.failed != 0
for kw in self.setup, self.teardown:
if should_remove(kw, critical_failures):
kw.remove_data()
class CombinedTestSuite(TestSuite):
def __init__(self, settings):
BaseTestSuite.__init__(self, name='')
self.starttime = self.endtime = None
self._set_times_from_settings(settings)
def add_suite(self, suite):
self.suites.append(suite)
suite.parent = self
self._add_suite_to_stats(suite)
self.status = self.critical_stats.failed == 0 and 'PASS' or 'FAIL'
if self.starttime == 'N/A' or self.endtime == 'N/A':
self.elapsedtime += suite.elapsedtime
class TestCase(BaseTestCase, _TestReader):
def __init__(self, node, parent, log_level=None):
BaseTestCase.__init__(self, node.get('name'), parent)
_TestReader.__init__(self, node, log_level=log_level)
self.set_criticality(parent.critical)
def remove_keywords(self, should_remove):
if should_remove(self, (self.status != 'PASS')):
for kw in self.keywords + [self.setup, self.teardown]:
if kw is not None:
kw.remove_data()
def contains_warnings(self):
return any(kw.contains_warnings() for kw in self.keywords)
class Keyword(BaseKeyword, _KeywordReader):
def __init__(self, node, log_level=None):
self._init_data()
BaseKeyword.__init__(self, node.get('name'))
_KeywordReader.__init__(self, node, log_level)
def _init_data(self):
self.messages = []
self.keywords = []
self.children = []
def remove_data(self):
self._init_data()
def contains_warnings(self):
return any(msg.level == 'WARN' for msg in self.messages) or \
any(kw.contains_warnings() for kw in self.keywords)
def __str__(self):
return self.name
def __repr__(self):
return "'%s'" % self.name
def serialize(self, serializer):
serializer.start_keyword(self)
for child in self.children:
child.serialize(serializer)
serializer.end_keyword(self)
class MessageFromXml(Message):
def __init__(self, node):
Message.__init__(self, node.text,
level=node.get('level', 'INFO'),
html=node.get('html', 'no') == 'yes',
timestamp=node.get('timestamp', 'N/A'),
linkable=node.get('linkable', 'no') == 'yes')
def serialize(self, serializer):
serializer.message(self)
def __str__(self):
return '%s %s %s' % (self.timestamp, self.level, self.message)
def __repr__(self):
lines = self.message.split('\n')
msg = len(lines) > 1 and lines[0] + '...' or lines[0]
return "'%s %s'" % (self.level, msg.replace("'",'"'))
class ExecutionErrors:
def __init__(self, node):
if node is None:
self.messages = []
else:
self.messages = [MessageFromXml(msg) for msg in node.findall('msg')]
def serialize(self, serializer):
serializer.start_errors()
for msg in self.messages:
msg.serialize(serializer)
serializer.end_errors()
class CombinedExecutionErrors(ExecutionErrors):
def __init__(self):
self.messages = []
def add(self, other):
self.messages += other.messages
def ShouldRemoveCallable(how):
def _removes_all(item, critical_failures):
return item is not None
def _removes_passed_not_containing_warnings(item, critical_failures):
if item is None:
return False
if critical_failures:
return False
return not item.contains_warnings()
how = how.upper()
if how == 'ALL':
return _removes_all
return _removes_passed_not_containing_warnings if how == 'PASSED' else None
| ajibawa-2023/Python-Code-Large/train/row_99900 | 241 | 354 | 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_99900:Import_L15_C0", "label": "os.path import os.path", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.0424, 0.0028, 0, 0.66, 0.0, 79, 0, 1, 0, 0, 79, 0, 0], "semantic": {"name": "os.path", "arg_names": [], "import_names": ["os.path"], "rhs_call_name": "", "annotation": ""}, "snippet": "import os.path"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:ImportFrom_L17_C0", "label": "from robot import utils", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.048, 0.0028, 0, 0.66, 0.0435, 735, 0, 1, 0, 0, 735, 0, 0], "semantic": {"name": "robot", "arg_names": [], "import_names": ["utils"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot import utils"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:ImportFrom_L18_C0", "label": "from robot.errors import DataError", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.0508, 0.0028, 0, 0.66, 0.087, 299, 0, 1, 0, 0, 299, 0, 0], "semantic": {"name": "robot.errors", "arg_names": [], "import_names": ["DataError"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot.errors import DataError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:ImportFrom_L19_C0", "label": "from robot.common import BaseTestSuite, BaseTestCase, BaseKeyword", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.0537, 0.0028, 0, 0.66, 0.1304, 355, 0, 3, 0, 0, 355, 0, 0], "semantic": {"name": "robot.common", "arg_names": [], "import_names": ["BaseTestSuite", "BaseTestCase", "BaseKeyword"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot.common import BaseTestSuite, BaseTestCase, BaseKeyword"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:ImportFrom_L20_C0", "label": "from robot.output import LOGGER", "type": "import", "loc": [20, 20], "level": 0, "parent": null, "vector": [1, 0, 0.0565, 0.0028, 0, 0.66, 0.1739, 596, 0, 1, 0, 0, 596, 0, 0], "semantic": {"name": "robot.output", "arg_names": [], "import_names": ["LOGGER"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot.output import LOGGER"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:ImportFrom_L21_C0", "label": "from robot.output.loggerhelper import IsLogged, Message", "type": "import", "loc": [21, 21], "level": 0, "parent": null, "vector": [1, 0, 0.0593, 0.0028, 0, 0.66, 0.2174, 19, 0, 2, 0, 0, 19, 0, 0], "semantic": {"name": "robot.output.loggerhelper", "arg_names": [], "import_names": ["IsLogged", "Message"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot.output.loggerhelper import IsLogged, Message"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L24_C0", "label": "process_outputs", "type": "function", "loc": [24, 36], "level": 0, "parent": null, "vector": [2, 0, 0.0847, 0.0367, 0, 0.66, 0.2609, 210, 0, 2, 1, 0, 0, 0, 8], "semantic": {"name": "process_outputs", "arg_names": ["paths", "settings"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def process_outputs(paths, settings):\n if not paths:\n raise DataError('No output files given.')\n if len(paths) == 1:\n return process_output(paths[0], log_level=settings['LogLevel'],\n settings=settings)\n suite = CombinedTestSuite(settings)\n exec_errors = CombinedExecutionErrors()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L25_C4", "label": "if", "type": "if", "loc": [25, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L24_C0", "vector": [4, 1, 0.072, 0.0056, 1, 0.82, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not paths:\n raise DataError('No output files given.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L27_C4", "label": "if", "type": "if", "loc": [27, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L24_C0", "vector": [4, 1, 0.0791, 0.0085, 1, 0.82, 0.2, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(paths) == 1:\n return process_output(paths[0], log_level=settings['LogLevel'],\n settings=settings)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Return_L28_C8", "label": "return", "type": "return", "loc": [28, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L27_C4", "vector": [13, 2, 0.0805, 0.0056, 2, 0.41, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return process_output(paths[0], log_level=settings['LogLevel'],\n settings=settings)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L30_C4", "label": "suite = CombinedTestSuite()", "type": "assigned_variable", "loc": [30, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L24_C0", "vector": [14, 1, 0.0847, 0.0028, 1, 0.82, 0.4, 425, 3, 1, 0, 0, 973, 10, 1], "semantic": {"name": "suite", "arg_names": [], "import_names": [], "rhs_call_name": "CombinedTestSuite", "annotation": ""}, "snippet": " suite = CombinedTestSuite(settings)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L31_C4", "label": "exec_errors = CombinedExecutionErrors()", "type": "assigned_variable", "loc": [31, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L24_C0", "vector": [14, 1, 0.0876, 0.0028, 1, 0.82, 0.6, 259, 3, 0, 0, 0, 663, 10, 1], "semantic": {"name": "exec_errors", "arg_names": [], "import_names": [], "rhs_call_name": "CombinedExecutionErrors", "annotation": ""}, "snippet": " exec_errors = CombinedExecutionErrors()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:For_L32_C4", "label": "for path", "type": "for", "loc": [32, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L24_C0", "vector": [6, 1, 0.0946, 0.0113, 1, 0.82, 0.8, 358, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "path", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for path in paths:\n subsuite, suberrors = process_output(path, log_level=settings['LogLevel'])\n suite.add_suite(subsuite)\n exec_errors.add(suberrors)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L33_C8", "label": "subsuite, suberrors = process_output()", "type": "assigned_variable", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:For_L32_C4", "vector": [14, 2, 0.0932, 0.0028, 2, 0.78, 0.0, 323, 3, 2, 0, 0, 918, 10, 1], "semantic": {"name": "subsuite, suberrors", "arg_names": [], "import_names": [], "rhs_call_name": "process_output", "annotation": ""}, "snippet": " subsuite, suberrors = process_output(path, log_level=settings['LogLevel'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L34_C8", "label": "add_suite()", "type": "expression", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:For_L32_C4", "vector": [8, 2, 0.096, 0.0028, 2, 0.78, 0.5, 407, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add_suite", "arg_names": [], "import_names": [], "rhs_call_name": "add_suite", "annotation": ""}, "snippet": " suite.add_suite(subsuite)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L35_C8", "label": "add()", "type": "expression", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:For_L32_C4", "vector": [8, 2, 0.0989, 0.0028, 2, 0.78, 1.0, 241, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " exec_errors.add(suberrors)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Return_L36_C4", "label": "return", "type": "return", "loc": [36, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L24_C0", "vector": [13, 1, 0.1017, 0.0028, 1, 0.82, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return suite, exec_errors"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L39_C0", "label": "process_output", "type": "function", "loc": [39, 52], "level": 0, "parent": null, "vector": [2, 0, 0.1285, 0.0395, 0, 0.66, 0.3043, 918, 0, 3, 1, 0, 0, 0, 10], "semantic": {"name": "process_output", "arg_names": ["path", "log_level", "settings"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def process_output(path, log_level=None, settings=None):\n \"\"\"Process one output file and return TestSuite and ExecutionErrors\"\"\"\n if not os.path.isfile(path):\n raise DataError(\"Output file '%s' does not exist.\" % path)\n LOGGER.info(\"Processing output file '%s'.\" % path)\n try:\n root = utils.etreewrapper.get_root(path)\n except:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L40_C4", "label": "expression", "type": "expression", "loc": [40, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L39_C0", "vector": [8, 1, 0.113, 0.0028, 1, 0.22, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Process one output file and return TestSuite and ExecutionErrors\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L41_C4", "label": "if", "type": "if", "loc": [41, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L39_C0", "vector": [4, 1, 0.1172, 0.0056, 1, 0.22, 0.1667, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not os.path.isfile(path):\n raise DataError(\"Output file '%s' does not exist.\" % path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L43_C4", "label": "info()", "type": "expression", "loc": [43, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L39_C0", "vector": [8, 1, 0.1215, 0.0028, 1, 0.22, 0.3333, 730, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": " LOGGER.info(\"Processing output file '%s'.\" % path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Try_L44_C4", "label": "try", "type": "try", "loc": [44, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L39_C0", "vector": [7, 1, 0.1299, 0.0141, 1, 0.22, 0.5, 0, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n root = utils.etreewrapper.get_root(path)\n except:\n raise DataError(\"Opening XML file '%s' failed: %s\"\n % (path, utils.get_error_message()))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L45_C8", "label": "root = get_root()", "type": "assigned_variable", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:Try_L44_C4", "vector": [14, 2, 0.1271, 0.0028, 2, 0.62, 0.0, 696, 3, 1, 0, 0, 534, 10, 1], "semantic": {"name": "root", "arg_names": [], "import_names": [], "rhs_call_name": "get_root", "annotation": ""}, "snippet": " root = utils.etreewrapper.get_root(path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L49_C4", "label": "suite = TestSuite()", "type": "assigned_variable", "loc": [49, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L39_C0", "vector": [14, 1, 0.1398, 0.0056, 1, 0.22, 0.6667, 425, 3, 3, 0, 0, 75, 10, 2], "semantic": {"name": "suite", "arg_names": [], "import_names": [], "rhs_call_name": "TestSuite", "annotation": ""}, "snippet": " suite = TestSuite(_get_suite_node(root, path), log_level=log_level,\n settings=settings)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L51_C4", "label": "errors = ExecutionErrors()", "type": "assigned_variable", "loc": [51, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L39_C0", "vector": [14, 1, 0.1441, 0.0028, 1, 0.22, 0.8333, 841, 3, 1, 0, 0, 325, 10, 2], "semantic": {"name": "errors", "arg_names": [], "import_names": [], "rhs_call_name": "ExecutionErrors", "annotation": ""}, "snippet": " errors = ExecutionErrors(_get_errors_node(root))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Return_L52_C4", "label": "return", "type": "return", "loc": [52, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L39_C0", "vector": [13, 1, 0.1469, 0.0028, 1, 0.22, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return suite, errors"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L55_C0", "label": "_get_suite_node", "type": "function", "loc": [55, 61], "level": 0, "parent": null, "vector": [2, 0, 0.1638, 0.0198, 0, 0.66, 0.3478, 261, 0, 2, 1, 0, 0, 0, 7], "semantic": {"name": "_get_suite_node", "arg_names": ["root", "path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _get_suite_node(root, path):\n if root.tag != 'robot':\n raise DataError(\"File '%s' is not Robot Framework output file.\" % path)\n node = root.find('suite')\n node.set('generator', root.get('generator', 'notset').split()[0].lower())\n node.set('path', path)\n return node"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L56_C4", "label": "if", "type": "if", "loc": [56, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L55_C0", "vector": [4, 1, 0.1596, 0.0056, 1, 0.63, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if root.tag != 'robot':\n raise DataError(\"File '%s' is not Robot Framework output file.\" % path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L58_C4", "label": "node = find()", "type": "assigned_variable", "loc": [58, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L55_C0", "vector": [14, 1, 0.1638, 0.0028, 1, 0.63, 0.25, 772, 3, 1, 0, 0, 340, 10, 1], "semantic": {"name": "node", "arg_names": [], "import_names": [], "rhs_call_name": "find", "annotation": ""}, "snippet": " node = root.find('suite')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L59_C4", "label": "set()", "type": "expression", "loc": [59, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L55_C0", "vector": [8, 1, 0.1667, 0.0028, 1, 0.63, 0.5, 21, 3, 2, 0, 0, 0, 0, 4], "semantic": {"name": "set", "arg_names": [], "import_names": [], "rhs_call_name": "set", "annotation": ""}, "snippet": " node.set('generator', root.get('generator', 'notset').split()[0].lower())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L60_C4", "label": "set()", "type": "expression", "loc": [60, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L55_C0", "vector": [8, 1, 0.1695, 0.0028, 1, 0.63, 0.75, 21, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set", "arg_names": [], "import_names": [], "rhs_call_name": "set", "annotation": ""}, "snippet": " node.set('path', path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Return_L61_C4", "label": "return", "type": "return", "loc": [61, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L55_C0", "vector": [13, 1, 0.1723, 0.0028, 1, 0.63, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return node"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L63_C0", "label": "_get_errors_node", "type": "function", "loc": [63, 64], "level": 0, "parent": null, "vector": [2, 0, 0.1794, 0.0056, 0, 0.66, 0.3913, 782, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "_get_errors_node", "arg_names": ["root"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _get_errors_node(root):\n return root.find('errors')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Return_L64_C4", "label": "return", "type": "return", "loc": [64, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L63_C0", "vector": [13, 1, 0.1808, 0.0028, 1, 0.46, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return root.find('errors')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L67_C0", "label": "_MissingStatus", "type": "class", "loc": [67, 70], "level": 0, "parent": null, "vector": [3, 0, 0.1935, 0.0113, 0, 0.66, 0.4348, 7, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "_MissingStatus", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _MissingStatus:\n \"\"\"If XML was fixed for example by fixml.py, status tag may be missing\"\"\"\n text = 'Could not find status.'\n get = lambda self, name, default: name == 'status' and 'FAIL' or 'N/A'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L68_C4", "label": "expression", "type": "expression", "loc": [68, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L67_C0", "vector": [8, 1, 0.1921, 0.0028, 1, 0.54, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"If XML was fixed for example by fixml.py, status tag may be missing\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L69_C4", "label": "text =", "type": "assigned_variable", "loc": [69, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L67_C0", "vector": [14, 1, 0.1949, 0.0028, 1, 0.54, 0.5, 439, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "text", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " text = 'Could not find status.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L70_C4", "label": "get =", "type": "assigned_variable", "loc": [70, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L67_C0", "vector": [14, 1, 0.1977, 0.0028, 1, 0.54, 1.0, 607, 9, 0, 0, 0, 0, 0, 0], "semantic": {"name": "get", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " get = lambda self, name, default: name == 'status' and 'FAIL' or 'N/A'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L73_C0", "label": "_BaseReader", "type": "class", "loc": [73, 93], "level": 0, "parent": null, "vector": [3, 0, 0.2345, 0.0593, 0, 0.66, 0.4783, 244, 0, 2, 0, 0, 0, 0, 10], "semantic": {"name": "_BaseReader", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _BaseReader:\n\n def __init__(self, node):\n self.doc = self._get_doc(node)\n stnode = node.find('status')\n if stnode is None:\n stnode = _MissingStatus()\n self.status = stnode.get('status','').upper()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L75_C4", "label": "__init__", "type": "function", "loc": [75, 87], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L73_C0", "vector": [2, 1, 0.2288, 0.0367, 1, 0.83, 0.0, 555, 0, 2, 0, 0, 0, 0, 9], "semantic": {"name": "__init__", "arg_names": ["self", "node"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, node):\n self.doc = self._get_doc(node)\n stnode = node.find('status')\n if stnode is None:\n stnode = _MissingStatus()\n self.status = stnode.get('status','').upper()\n if self.status not in ['PASS','FAIL', 'NOT_RUN']:\n raise DataError(\"Item '%s' has invalid status '%s'\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L76_C8", "label": "self.doc = _get_doc()", "type": "assigned_variable", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L75_C4", "vector": [14, 2, 0.2147, 0.0028, 2, 0.06, 0.0, 114, 3, 1, 0, 0, 206, 10, 1], "semantic": {"name": "self.doc", "arg_names": [], "import_names": [], "rhs_call_name": "_get_doc", "annotation": ""}, "snippet": " self.doc = self._get_doc(node)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L77_C8", "label": "stnode = find()", "type": "assigned_variable", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L75_C4", "vector": [14, 2, 0.2175, 0.0028, 2, 0.06, 0.125, 452, 3, 1, 0, 0, 340, 10, 1], "semantic": {"name": "stnode", "arg_names": [], "import_names": [], "rhs_call_name": "find", "annotation": ""}, "snippet": " stnode = node.find('status')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L78_C8", "label": "if", "type": "if", "loc": [78, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L75_C4", "vector": [4, 2, 0.2218, 0.0056, 2, 0.06, 0.25, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if stnode is None:\n stnode = _MissingStatus()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L79_C12", "label": "stnode = _MissingStatus()", "type": "assigned_variable", "loc": [79, 79], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L78_C8", "vector": [14, 3, 0.2232, 0.0028, 3, 0.47, 0.0, 452, 3, 0, 0, 0, 7, 10, 1], "semantic": {"name": "stnode", "arg_names": [], "import_names": [], "rhs_call_name": "_MissingStatus", "annotation": ""}, "snippet": " stnode = _MissingStatus()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L80_C8", "label": "self.status = upper()", "type": "assigned_variable", "loc": [80, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L75_C4", "vector": [14, 2, 0.226, 0.0028, 2, 0.06, 0.375, 651, 3, 0, 0, 0, 347, 10, 2], "semantic": {"name": "self.status", "arg_names": [], "import_names": [], "rhs_call_name": "upper", "annotation": ""}, "snippet": " self.status = stnode.get('status','').upper()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L81_C8", "label": "if", "type": "if", "loc": [81, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L75_C4", "vector": [4, 2, 0.2316, 0.0085, 2, 0.06, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.status not in ['PASS','FAIL', 'NOT_RUN']:\n raise DataError(\"Item '%s' has invalid status '%s'\"\n % (self.name, self.status))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L84_C8", "label": "self.message =", "type": "assigned_variable", "loc": [84, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L75_C4", "vector": [14, 2, 0.2373, 0.0028, 2, 0.06, 0.625, 709, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.message", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.message = stnode.text or ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L85_C8", "label": "self.starttime = get()", "type": "assigned_variable", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L75_C4", "vector": [14, 2, 0.2401, 0.0028, 2, 0.06, 0.75, 705, 3, 2, 0, 0, 607, 10, 1], "semantic": {"name": "self.starttime", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " self.starttime = stnode.get('starttime', 'N/A')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L86_C8", "label": "self.endtime = get()", "type": "assigned_variable", "loc": [86, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L75_C4", "vector": [14, 2, 0.2429, 0.0028, 2, 0.06, 0.875, 196, 3, 2, 0, 0, 607, 10, 1], "semantic": {"name": "self.endtime", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " self.endtime = stnode.get('endtime', 'N/A')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L87_C8", "label": "self.elapsedtime = get_elapsed_time()", "type": "assigned_variable", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L75_C4", "vector": [14, 2, 0.2458, 0.0028, 2, 0.06, 1.0, 947, 3, 2, 0, 0, 17, 10, 1], "semantic": {"name": "self.elapsedtime", "arg_names": [], "import_names": [], "rhs_call_name": "get_elapsed_time", "annotation": ""}, "snippet": " self.elapsedtime = utils.get_elapsed_time(self.starttime, self.endtime)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L89_C4", "label": "_get_doc", "type": "function", "loc": [89, 93], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L73_C0", "vector": [2, 1, 0.2571, 0.0141, 1, 0.83, 1.0, 206, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "_get_doc", "arg_names": ["self", "node"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_doc(self, node):\n docnode = node.find('doc')\n if docnode is not None:\n return docnode.text or ''\n return ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L90_C8", "label": "docnode = find()", "type": "assigned_variable", "loc": [90, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L89_C4", "vector": [14, 2, 0.2542, 0.0028, 2, 0.43, 0.0, 120, 3, 1, 0, 0, 340, 10, 1], "semantic": {"name": "docnode", "arg_names": [], "import_names": [], "rhs_call_name": "find", "annotation": ""}, "snippet": " docnode = node.find('doc')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L91_C8", "label": "if", "type": "if", "loc": [91, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L89_C4", "vector": [4, 2, 0.2585, 0.0056, 2, 0.43, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if docnode is not None:\n return docnode.text or ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Return_L92_C12", "label": "return", "type": "return", "loc": [92, 92], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L91_C8", "vector": [13, 3, 0.2599, 0.0028, 3, 0.07, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return docnode.text or ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Return_L93_C8", "label": "return", "type": "return", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L89_C4", "vector": [13, 2, 0.2627, 0.0028, 2, 0.43, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L96_C0", "label": "_TestAndSuiteReader", "type": "class", "loc": [96, 104], "level": 0, "parent": null, "vector": [3, 0, 0.2825, 0.0254, 0, 0.66, 0.5217, 738, 0, 1, 0, 0, 244, 0, 5], "semantic": {"name": "_TestAndSuiteReader", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _TestAndSuiteReader(_BaseReader):\n\n def __init__(self, node, log_level=None):\n _BaseReader.__init__(self, node)\n self.keywords = [Keyword(kw, log_level) for kw in node.findall('kw')]\n if self.keywords and self.keywords[0].type == 'setup':\n self.setup = self.keywords.pop(0)\n if self.keywords and self.keywords[-1].type == 'teardown':"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L98_C4", "label": "__init__", "type": "function", "loc": [98, 104], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L96_C0", "vector": [2, 1, 0.2853, 0.0198, 1, 0.13, 0.0, 555, 0, 3, 0, 0, 0, 0, 5], "semantic": {"name": "__init__", "arg_names": ["self", "node", "log_level"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, node, log_level=None):\n _BaseReader.__init__(self, node)\n self.keywords = [Keyword(kw, log_level) for kw in node.findall('kw')]\n if self.keywords and self.keywords[0].type == 'setup':\n self.setup = self.keywords.pop(0)\n if self.keywords and self.keywords[-1].type == 'teardown':\n self.teardown = self.keywords.pop(-1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L99_C8", "label": "__init__()", "type": "expression", "loc": [99, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L98_C4", "vector": [8, 2, 0.2797, 0.0028, 2, 0.25, 0.0, 555, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " _BaseReader.__init__(self, node)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L100_C8", "label": "self.keywords =", "type": "assigned_variable", "loc": [100, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L98_C4", "vector": [14, 2, 0.2825, 0.0028, 2, 0.25, 0.3333, 627, 5, 0, 0, 0, 0, 0, 2], "semantic": {"name": "self.keywords", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.keywords = [Keyword(kw, log_level) for kw in node.findall('kw')]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L101_C8", "label": "if", "type": "if", "loc": [101, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L98_C4", "vector": [4, 2, 0.2867, 0.0056, 2, 0.25, 0.6667, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.keywords and self.keywords[0].type == 'setup':\n self.setup = self.keywords.pop(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L102_C12", "label": "self.setup = pop()", "type": "assigned_variable", "loc": [102, 102], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L101_C8", "vector": [14, 3, 0.2881, 0.0028, 3, 0.62, 0.0, 524, 3, 1, 0, 0, 969, 10, 1], "semantic": {"name": "self.setup", "arg_names": [], "import_names": [], "rhs_call_name": "pop", "annotation": ""}, "snippet": " self.setup = self.keywords.pop(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L103_C8", "label": "if", "type": "if", "loc": [103, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L98_C4", "vector": [4, 2, 0.2924, 0.0056, 2, 0.25, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.keywords and self.keywords[-1].type == 'teardown':\n self.teardown = self.keywords.pop(-1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L104_C12", "label": "self.teardown = pop()", "type": "assigned_variable", "loc": [104, 104], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L103_C8", "vector": [14, 3, 0.2938, 0.0028, 3, 0.68, 0.0, 281, 3, 1, 0, 0, 969, 10, 1], "semantic": {"name": "self.teardown", "arg_names": [], "import_names": [], "rhs_call_name": "pop", "annotation": ""}, "snippet": " self.teardown = self.keywords.pop(-1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L107_C0", "label": "_SuiteReader", "type": "class", "loc": [107, 116], "level": 0, "parent": null, "vector": [3, 0, 0.315, 0.0282, 0, 0.66, 0.5652, 515, 0, 2, 0, 0, 738, 0, 4], "semantic": {"name": "_SuiteReader", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _SuiteReader(_TestAndSuiteReader):\n\n def __init__(self, node, log_level=None):\n _TestAndSuiteReader.__init__(self, node, log_level)\n del(self.keywords)\n for metanode in node.findall('metadata/item'):\n self.metadata[metanode.get('name')] = metanode.text\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L109_C4", "label": "__init__", "type": "function", "loc": [109, 113], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L107_C0", "vector": [2, 1, 0.3136, 0.0141, 1, 0.96, 0.0, 555, 0, 3, 0, 0, 0, 0, 3], "semantic": {"name": "__init__", "arg_names": ["self", "node", "log_level"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, node, log_level=None):\n _TestAndSuiteReader.__init__(self, node, log_level)\n del(self.keywords)\n for metanode in node.findall('metadata/item'):\n self.metadata[metanode.get('name')] = metanode.text"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L110_C8", "label": "__init__()", "type": "expression", "loc": [110, 110], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L109_C4", "vector": [8, 2, 0.3107, 0.0028, 2, 0.33, 0.0, 555, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " _TestAndSuiteReader.__init__(self, node, log_level)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:For_L112_C8", "label": "for metanode", "type": "for", "loc": [112, 113], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L109_C4", "vector": [6, 2, 0.3178, 0.0056, 2, 0.33, 1.0, 10, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "metanode", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for metanode in node.findall('metadata/item'):\n self.metadata[metanode.get('name')] = metanode.text"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L113_C12", "label": "assign", "type": "assigned_variable", "loc": [113, 113], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:For_L112_C8", "vector": [14, 3, 0.3192, 0.0028, 3, 0.64, 0.0, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.metadata[metanode.get('name')] = metanode.text"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L115_C4", "label": "_get_texts", "type": "function", "loc": [115, 116], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L107_C0", "vector": [2, 1, 0.3263, 0.0056, 1, 0.96, 1.0, 523, 0, 3, 1, 0, 0, 0, 1], "semantic": {"name": "_get_texts", "arg_names": ["self", "node", "path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_texts(self, node, path):\n return [item.text for item in node.findall(path)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Return_L116_C8", "label": "return", "type": "return", "loc": [116, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L115_C4", "vector": [13, 2, 0.3277, 0.0028, 2, 0.65, 0.0, 0, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [item.text for item in node.findall(path)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L119_C0", "label": "_TestReader", "type": "class", "loc": [119, 124], "level": 0, "parent": null, "vector": [3, 0, 0.3432, 0.0169, 0, 0.66, 0.6087, 306, 0, 1, 0, 0, 738, 0, 3], "semantic": {"name": "_TestReader", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _TestReader(_TestAndSuiteReader):\n\n def __init__(self, node, log_level=None):\n _TestAndSuiteReader.__init__(self, node, log_level)\n self.tags = [tag.text for tag in node.findall('tags/tag')]\n self.timeout = node.get('timeout', '')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L121_C4", "label": "__init__", "type": "function", "loc": [121, 124], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L119_C0", "vector": [2, 1, 0.346, 0.0113, 1, 0.34, 0.0, 555, 0, 3, 0, 0, 0, 0, 3], "semantic": {"name": "__init__", "arg_names": ["self", "node", "log_level"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, node, log_level=None):\n _TestAndSuiteReader.__init__(self, node, log_level)\n self.tags = [tag.text for tag in node.findall('tags/tag')]\n self.timeout = node.get('timeout', '')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L122_C8", "label": "__init__()", "type": "expression", "loc": [122, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L121_C4", "vector": [8, 2, 0.3446, 0.0028, 2, 0.64, 0.0, 555, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " _TestAndSuiteReader.__init__(self, node, log_level)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L123_C8", "label": "self.tags =", "type": "assigned_variable", "loc": [123, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L121_C4", "vector": [14, 2, 0.3475, 0.0028, 2, 0.64, 0.5, 664, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.tags", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.tags = [tag.text for tag in node.findall('tags/tag')]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L124_C8", "label": "self.timeout = get()", "type": "assigned_variable", "loc": [124, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L121_C4", "vector": [14, 2, 0.3503, 0.0028, 2, 0.64, 1.0, 621, 3, 2, 0, 0, 607, 10, 1], "semantic": {"name": "self.timeout", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " self.timeout = node.get('timeout', '')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L127_C0", "label": "_KeywordReader", "type": "class", "loc": [127, 147], "level": 0, "parent": null, "vector": [3, 0, 0.387, 0.0593, 0, 0.66, 0.6522, 810, 0, 1, 0, 0, 244, 0, 13], "semantic": {"name": "_KeywordReader", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _KeywordReader(_BaseReader):\n\n def __init__(self, node, log_level=None):\n _BaseReader.__init__(self, node)\n del(self.message)\n self.args = [(arg.text or '') for arg in node.findall('arguments/arg')]\n self.type = node.get('type', 'kw')\n self.timeout = node.get('timeout', '')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L129_C4", "label": "__init__", "type": "function", "loc": [129, 147], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L127_C0", "vector": [2, 1, 0.3898, 0.0537, 1, 0.93, 0.0, 555, 0, 3, 0, 0, 0, 0, 13], "semantic": {"name": "__init__", "arg_names": ["self", "node", "log_level"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, node, log_level=None):\n _BaseReader.__init__(self, node)\n del(self.message)\n self.args = [(arg.text or '') for arg in node.findall('arguments/arg')]\n self.type = node.get('type', 'kw')\n self.timeout = node.get('timeout', '')\n self.keywords = []\n self.messages = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L130_C8", "label": "__init__()", "type": "expression", "loc": [130, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L129_C4", "vector": [8, 2, 0.3672, 0.0028, 2, 0.97, 0.0, 555, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " _BaseReader.__init__(self, node)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L132_C8", "label": "self.args =", "type": "assigned_variable", "loc": [132, 132], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L129_C4", "vector": [14, 2, 0.3729, 0.0028, 2, 0.97, 0.125, 640, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.args", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.args = [(arg.text or '') for arg in node.findall('arguments/arg')]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L133_C8", "label": "self.type = get()", "type": "assigned_variable", "loc": [133, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L129_C4", "vector": [14, 2, 0.3757, 0.0028, 2, 0.97, 0.25, 398, 3, 2, 0, 0, 607, 10, 1], "semantic": {"name": "self.type", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " self.type = node.get('type', 'kw')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L134_C8", "label": "self.timeout = get()", "type": "assigned_variable", "loc": [134, 134], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L129_C4", "vector": [14, 2, 0.3785, 0.0028, 2, 0.97, 0.375, 621, 3, 2, 0, 0, 607, 10, 1], "semantic": {"name": "self.timeout", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " self.timeout = node.get('timeout', '')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L135_C8", "label": "self.keywords =", "type": "assigned_variable", "loc": [135, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L129_C4", "vector": [14, 2, 0.3814, 0.0028, 2, 0.97, 0.5, 627, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.keywords", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.keywords = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L136_C8", "label": "self.messages =", "type": "assigned_variable", "loc": [136, 136], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L129_C4", "vector": [14, 2, 0.3842, 0.0028, 2, 0.97, 0.625, 44, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.messages", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.messages = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L137_C8", "label": "self.children =", "type": "assigned_variable", "loc": [137, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L129_C4", "vector": [14, 2, 0.387, 0.0028, 2, 0.97, 0.75, 278, 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_99900:Assign_L138_C8", "label": "log_filter = IsLogged()", "type": "assigned_variable", "loc": [138, 138], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L129_C4", "vector": [14, 2, 0.3898, 0.0028, 2, 0.97, 0.875, 596, 3, 1, 0, 0, 467, 10, 1], "semantic": {"name": "log_filter", "arg_names": [], "import_names": [], "rhs_call_name": "IsLogged", "annotation": ""}, "snippet": " log_filter = IsLogged(log_level or 'TRACE')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:For_L139_C8", "label": "for child", "type": "for", "loc": [139, 147], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L129_C4", "vector": [6, 2, 0.404, 0.0254, 2, 0.97, 1.0, 967, 2, 0, 0, 0, 0, 0, 8], "semantic": {"name": "child", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for child in node:\n if child.tag == 'kw':\n kw = Keyword(child, log_level)\n self.keywords.append(kw)\n self.children.append(kw)\n elif child.tag == 'msg' and log_filter(child.get('level', 'INFO')):\n msg = MessageFromXml(child)\n self.messages.append(msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L140_C12", "label": "if", "type": "if", "loc": [140, 147], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:For_L139_C8", "vector": [4, 3, 0.4054, 0.0226, 3, 0.81, 0.0, 0, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if child.tag == 'kw':\n kw = Keyword(child, log_level)\n self.keywords.append(kw)\n self.children.append(kw)\n elif child.tag == 'msg' and log_filter(child.get('level', 'INFO')):\n msg = MessageFromXml(child)\n self.messages.append(msg)\n self.children.append(msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L141_C16", "label": "kw = Keyword()", "type": "assigned_variable", "loc": [141, 141], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L140_C12", "vector": [14, 4, 0.3983, 0.0028, 4, 0.58, 0.0, 755, 3, 2, 0, 0, 582, 10, 1], "semantic": {"name": "kw", "arg_names": [], "import_names": [], "rhs_call_name": "Keyword", "annotation": ""}, "snippet": " kw = Keyword(child, log_level)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L142_C16", "label": "append()", "type": "expression", "loc": [142, 142], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L140_C12", "vector": [8, 4, 0.4011, 0.0028, 4, 0.58, 0.3333, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.keywords.append(kw)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L143_C16", "label": "append()", "type": "expression", "loc": [143, 143], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L140_C12", "vector": [8, 4, 0.404, 0.0028, 4, 0.58, 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(kw)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L144_C12", "label": "if", "type": "if", "loc": [144, 147], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L140_C12", "vector": [4, 4, 0.411, 0.0113, 4, 0.58, 1.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif child.tag == 'msg' and log_filter(child.get('level', 'INFO')):\n msg = MessageFromXml(child)\n self.messages.append(msg)\n self.children.append(msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L145_C16", "label": "msg = MessageFromXml()", "type": "assigned_variable", "loc": [145, 145], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L144_C12", "vector": [14, 5, 0.4096, 0.0028, 5, 0.29, 0.0, 712, 3, 1, 0, 0, 737, 10, 1], "semantic": {"name": "msg", "arg_names": [], "import_names": [], "rhs_call_name": "MessageFromXml", "annotation": ""}, "snippet": " msg = MessageFromXml(child)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L146_C16", "label": "append()", "type": "expression", "loc": [146, 146], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L144_C12", "vector": [8, 5, 0.4124, 0.0028, 5, 0.29, 0.5, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.messages.append(msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L147_C16", "label": "append()", "type": "expression", "loc": [147, 147], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L144_C12", "vector": [8, 5, 0.4153, 0.0028, 5, 0.29, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.children.append(msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L150_C0", "label": "TestSuite", "type": "class", "loc": [150, 229], "level": 0, "parent": null, "vector": [3, 0, 0.5353, 0.226, 0, 0.66, 0.6957, 75, 0, 10, 0, 0, 245, 0, 38], "semantic": {"name": "TestSuite", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class TestSuite(BaseTestSuite, _SuiteReader):\n\n def __init__(self, node, parent=None, log_level=None, settings=None):\n BaseTestSuite.__init__(self, node.get('name'),\n node.get('source', None), parent)\n _SuiteReader.__init__(self, node, log_level=log_level)\n self._set_times_from_settings(settings)\n for snode in node.findall('suite'):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L152_C4", "label": "__init__", "type": "function", "loc": [152, 166], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L150_C0", "vector": [2, 1, 0.4492, 0.0424, 1, 0.99, 0.0, 555, 0, 5, 0, 0, 0, 0, 16], "semantic": {"name": "__init__", "arg_names": ["self", "node", "parent", "log_level", "settings"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, node, parent=None, log_level=None, settings=None):\n BaseTestSuite.__init__(self, node.get('name'),\n node.get('source', None), parent)\n _SuiteReader.__init__(self, node, log_level=log_level)\n self._set_times_from_settings(settings)\n for snode in node.findall('suite'):\n snode.set('generator', node.get('generator'))\n snode.set('path', node.get('path'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L153_C8", "label": "__init__()", "type": "expression", "loc": [153, 154], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L152_C4", "vector": [8, 2, 0.4336, 0.0056, 2, 0.08, 0.0, 555, 3, 4, 0, 0, 0, 0, 3], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " BaseTestSuite.__init__(self, node.get('name'),\n node.get('source', None), parent)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L155_C8", "label": "__init__()", "type": "expression", "loc": [155, 155], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L152_C4", "vector": [8, 2, 0.4379, 0.0028, 2, 0.08, 0.1667, 555, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " _SuiteReader.__init__(self, node, log_level=log_level)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L156_C8", "label": "_set_times_from_settings()", "type": "expression", "loc": [156, 156], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L152_C4", "vector": [8, 2, 0.4407, 0.0028, 2, 0.08, 0.3333, 312, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_set_times_from_settings", "arg_names": [], "import_names": [], "rhs_call_name": "_set_times_from_settings", "annotation": ""}, "snippet": " self._set_times_from_settings(settings)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:For_L157_C8", "label": "for snode", "type": "for", "loc": [157, 160], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L152_C4", "vector": [6, 2, 0.4477, 0.0113, 2, 0.08, 0.5, 52, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "snode", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for snode in node.findall('suite'):\n snode.set('generator', node.get('generator'))\n snode.set('path', node.get('path'))\n TestSuite(snode, parent=self, log_level=log_level)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L158_C12", "label": "set()", "type": "expression", "loc": [158, 158], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:For_L157_C8", "vector": [8, 3, 0.4463, 0.0028, 3, 0.86, 0.0, 21, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "set", "arg_names": [], "import_names": [], "rhs_call_name": "set", "annotation": ""}, "snippet": " snode.set('generator', node.get('generator'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L159_C12", "label": "set()", "type": "expression", "loc": [159, 159], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:For_L157_C8", "vector": [8, 3, 0.4492, 0.0028, 3, 0.86, 0.5, 21, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "set", "arg_names": [], "import_names": [], "rhs_call_name": "set", "annotation": ""}, "snippet": " snode.set('path', node.get('path'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L160_C12", "label": "TestSuite()", "type": "expression", "loc": [160, 160], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:For_L157_C8", "vector": [8, 3, 0.452, 0.0028, 3, 0.86, 1.0, 75, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "TestSuite", "arg_names": [], "import_names": [], "rhs_call_name": "TestSuite", "annotation": ""}, "snippet": " TestSuite(snode, parent=self, log_level=log_level)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:For_L161_C8", "label": "for tnode", "type": "for", "loc": [161, 162], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L152_C4", "vector": [6, 2, 0.4562, 0.0056, 2, 0.08, 0.6667, 401, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "tnode", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for tnode in node.findall('test'):\n TestCase(tnode, parent=self, log_level=log_level)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L162_C12", "label": "TestCase()", "type": "expression", "loc": [162, 162], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:For_L161_C8", "vector": [8, 3, 0.4576, 0.0028, 3, 0.67, 0.0, 3, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "TestCase", "arg_names": [], "import_names": [], "rhs_call_name": "TestCase", "annotation": ""}, "snippet": " TestCase(tnode, parent=self, log_level=log_level)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L163_C8", "label": "set_status()", "type": "expression", "loc": [163, 163], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L152_C4", "vector": [8, 2, 0.4605, 0.0028, 2, 0.08, 0.8333, 636, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "set_status", "arg_names": [], "import_names": [], "rhs_call_name": "set_status", "annotation": ""}, "snippet": " self.set_status()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L164_C8", "label": "if", "type": "if", "loc": [164, 166], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L152_C4", "vector": [4, 2, 0.4661, 0.0085, 2, 0.08, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if node.get('generator') == 'robot' and \\\n self.teardown and self.teardown.status == 'FAIL':\n self.suite_teardown_failed()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L166_C12", "label": "suite_teardown_failed()", "type": "expression", "loc": [166, 166], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L164_C8", "vector": [8, 3, 0.4689, 0.0028, 3, 0.39, 0.0, 553, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "suite_teardown_failed", "arg_names": [], "import_names": [], "rhs_call_name": "suite_teardown_failed", "annotation": ""}, "snippet": " self.suite_teardown_failed()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L168_C4", "label": "_set_times_from_settings", "type": "function", "loc": [168, 174], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L150_C0", "vector": [2, 1, 0.4831, 0.0198, 1, 0.99, 0.1111, 312, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "_set_times_from_settings", "arg_names": ["self", "settings"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _set_times_from_settings(self, settings):\n starttime, endtime = self._times_from_settings(settings)\n if not self.starttime or starttime != 'N/A':\n self.starttime = starttime\n if not self.endtime or endtime != 'N/A':\n self.endtime = endtime\n self.elapsedtime = utils.get_elapsed_time(self.starttime, self.endtime)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L169_C8", "label": "starttime, endtime = _times_from_settings()", "type": "assigned_variable", "loc": [169, 169], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L168_C4", "vector": [14, 2, 0.4774, 0.0028, 2, 0.5, 0.0, 397, 3, 1, 0, 0, 497, 10, 1], "semantic": {"name": "starttime, endtime", "arg_names": [], "import_names": [], "rhs_call_name": "_times_from_settings", "annotation": ""}, "snippet": " starttime, endtime = self._times_from_settings(settings)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L170_C8", "label": "if", "type": "if", "loc": [170, 171], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L168_C4", "vector": [4, 2, 0.4816, 0.0056, 2, 0.5, 0.3333, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.starttime or starttime != 'N/A':\n self.starttime = starttime"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L171_C12", "label": "self.starttime =", "type": "assigned_variable", "loc": [171, 171], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L170_C8", "vector": [14, 3, 0.4831, 0.0028, 3, 0.99, 0.0, 705, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.starttime", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.starttime = starttime"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L172_C8", "label": "if", "type": "if", "loc": [172, 173], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L168_C4", "vector": [4, 2, 0.4873, 0.0056, 2, 0.5, 0.6667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.endtime or endtime != 'N/A':\n self.endtime = endtime"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L173_C12", "label": "self.endtime =", "type": "assigned_variable", "loc": [173, 173], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L172_C8", "vector": [14, 3, 0.4887, 0.0028, 3, 0.25, 0.0, 196, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.endtime", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.endtime = endtime"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L174_C8", "label": "self.elapsedtime = get_elapsed_time()", "type": "assigned_variable", "loc": [174, 174], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L168_C4", "vector": [14, 2, 0.4915, 0.0028, 2, 0.5, 1.0, 947, 3, 2, 0, 0, 17, 10, 1], "semantic": {"name": "self.elapsedtime", "arg_names": [], "import_names": [], "rhs_call_name": "get_elapsed_time", "annotation": ""}, "snippet": " self.elapsedtime = utils.get_elapsed_time(self.starttime, self.endtime)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L176_C4", "label": "_times_from_settings", "type": "function", "loc": [176, 180], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L150_C0", "vector": [2, 1, 0.5028, 0.0141, 1, 0.99, 0.2222, 497, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "_times_from_settings", "arg_names": ["self", "settings"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _times_from_settings(self, settings):\n if not settings:\n return 'N/A', 'N/A'\n return (self._get_time(settings['StartTime']),\n self._get_time(settings['EndTime']))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L177_C8", "label": "if", "type": "if", "loc": [177, 178], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L176_C4", "vector": [4, 2, 0.5014, 0.0056, 2, 0.51, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not settings:\n return 'N/A', 'N/A'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Return_L178_C12", "label": "return", "type": "return", "loc": [178, 178], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L177_C8", "vector": [13, 3, 0.5028, 0.0028, 3, 0.12, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'N/A', 'N/A'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Return_L179_C8", "label": "return", "type": "return", "loc": [179, 180], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L176_C4", "vector": [13, 2, 0.5071, 0.0056, 2, 0.51, 1.0, 0, 0, 0, 0, 0, 0, 8, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return (self._get_time(settings['StartTime']),\n self._get_time(settings['EndTime']))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L182_C4", "label": "_get_time", "type": "function", "loc": [182, 190], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L150_C0", "vector": [2, 1, 0.5254, 0.0254, 1, 0.99, 0.3333, 692, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "_get_time", "arg_names": ["self", "timestamp"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_time(self, timestamp):\n if not timestamp or utils.eq(timestamp, 'N/A'):\n return 'N/A'\n try:\n secs = utils.timestamp_to_secs(timestamp, seps=list(' :.-_'),\n millis=True)\n except ValueError:\n return 'N/A'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L183_C8", "label": "if", "type": "if", "loc": [183, 184], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L182_C4", "vector": [4, 2, 0.5184, 0.0056, 2, 0.66, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not timestamp or utils.eq(timestamp, 'N/A'):\n return 'N/A'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Return_L184_C12", "label": "return", "type": "return", "loc": [184, 184], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L183_C8", "vector": [13, 3, 0.5198, 0.0028, 3, 0.54, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'N/A'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Try_L185_C8", "label": "try", "type": "try", "loc": [185, 189], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L182_C4", "vector": [7, 2, 0.5282, 0.0141, 2, 0.66, 0.5, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n secs = utils.timestamp_to_secs(timestamp, seps=list(' :.-_'),\n millis=True)\n except ValueError:\n return 'N/A'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L186_C12", "label": "secs = timestamp_to_secs()", "type": "assigned_variable", "loc": [186, 187], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:Try_L185_C8", "vector": [14, 3, 0.5268, 0.0056, 3, 0.75, 0.0, 584, 3, 3, 0, 0, 618, 10, 2], "semantic": {"name": "secs", "arg_names": [], "import_names": [], "rhs_call_name": "timestamp_to_secs", "annotation": ""}, "snippet": " secs = utils.timestamp_to_secs(timestamp, seps=list(' :.-_'),\n millis=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Return_L189_C12", "label": "return", "type": "return", "loc": [189, 189], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:Try_L185_C8", "vector": [13, 3, 0.5339, 0.0028, 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 'N/A'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Return_L190_C8", "label": "return", "type": "return", "loc": [190, 190], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L182_C4", "vector": [13, 2, 0.5367, 0.0028, 2, 0.66, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return utils.secs_to_timestamp(secs, millis=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L192_C4", "label": "set_status", "type": "function", "loc": [192, 197], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L150_C0", "vector": [2, 1, 0.5494, 0.0169, 1, 0.99, 0.4444, 636, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "set_status", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_status(self):\n BaseTestSuite.set_status(self)\n if self.starttime == 'N/A' or self.endtime == 'N/A':\n subitems = self.suites + self.tests + [self.setup, self.teardown]\n self.elapsedtime = sum(item.elapsedtime for item in subitems\n if item is not None )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L193_C8", "label": "set_status()", "type": "expression", "loc": [193, 193], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L192_C4", "vector": [8, 2, 0.5452, 0.0028, 2, 0.34, 0.0, 636, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_status", "arg_names": [], "import_names": [], "rhs_call_name": "set_status", "annotation": ""}, "snippet": " BaseTestSuite.set_status(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L194_C8", "label": "if", "type": "if", "loc": [194, 197], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L192_C4", "vector": [4, 2, 0.5523, 0.0113, 2, 0.34, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.starttime == 'N/A' or self.endtime == 'N/A':\n subitems = self.suites + self.tests + [self.setup, self.teardown]\n self.elapsedtime = sum(item.elapsedtime for item in subitems\n if item is not None )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L195_C12", "label": "subitems =", "type": "assigned_variable", "loc": [195, 195], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L194_C8", "vector": [14, 3, 0.5508, 0.0028, 3, 0.73, 0.0, 37, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "subitems", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " subitems = self.suites + self.tests + [self.setup, self.teardown]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L196_C12", "label": "self.elapsedtime = sum()", "type": "assigned_variable", "loc": [196, 197], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L194_C8", "vector": [14, 3, 0.5551, 0.0056, 3, 0.73, 1.0, 947, 3, 1, 0, 0, 824, 10, 1], "semantic": {"name": "self.elapsedtime", "arg_names": [], "import_names": [], "rhs_call_name": "sum", "annotation": ""}, "snippet": " self.elapsedtime = sum(item.elapsedtime for item in subitems\n if item is not None )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L199_C4", "label": "_set_critical_tags", "type": "function", "loc": [199, 201], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L150_C0", "vector": [2, 1, 0.565, 0.0085, 1, 0.99, 0.5556, 214, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "_set_critical_tags", "arg_names": ["self", "critical"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _set_critical_tags(self, critical):\n BaseTestSuite._set_critical_tags(self, critical)\n self.set_status()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L200_C8", "label": "_set_critical_tags()", "type": "expression", "loc": [200, 200], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L199_C4", "vector": [8, 2, 0.565, 0.0028, 2, 0.16, 0.0, 214, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_set_critical_tags", "arg_names": [], "import_names": [], "rhs_call_name": "_set_critical_tags", "annotation": ""}, "snippet": " BaseTestSuite._set_critical_tags(self, critical)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L201_C8", "label": "set_status()", "type": "expression", "loc": [201, 201], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L199_C4", "vector": [8, 2, 0.5678, 0.0028, 2, 0.16, 1.0, 636, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "set_status", "arg_names": [], "import_names": [], "rhs_call_name": "set_status", "annotation": ""}, "snippet": " self.set_status()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L203_C4", "label": "_filter_by_tags", "type": "function", "loc": [203, 207], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L150_C0", "vector": [2, 1, 0.5791, 0.0141, 1, 0.99, 0.6667, 712, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "_filter_by_tags", "arg_names": ["self", "incls", "excls"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _filter_by_tags(self, incls, excls):\n ret = BaseTestSuite._filter_by_tags(self, incls, excls)\n self.starttime = self.endtime = 'N/A'\n self.set_status()\n return ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L204_C8", "label": "ret = _filter_by_tags()", "type": "assigned_variable", "loc": [204, 204], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L203_C4", "vector": [14, 2, 0.5763, 0.0028, 2, 0.71, 0.0, 501, 3, 3, 0, 0, 712, 10, 1], "semantic": {"name": "ret", "arg_names": [], "import_names": [], "rhs_call_name": "_filter_by_tags", "annotation": ""}, "snippet": " ret = BaseTestSuite._filter_by_tags(self, incls, excls)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L205_C8", "label": "self.starttime =", "type": "assigned_variable", "loc": [205, 205], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L203_C4", "vector": [14, 2, 0.5791, 0.0028, 2, 0.71, 0.3333, 705, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.starttime", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.starttime = self.endtime = 'N/A'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L206_C8", "label": "set_status()", "type": "expression", "loc": [206, 206], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L203_C4", "vector": [8, 2, 0.5819, 0.0028, 2, 0.71, 0.6667, 636, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "set_status", "arg_names": [], "import_names": [], "rhs_call_name": "set_status", "annotation": ""}, "snippet": " self.set_status()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Return_L207_C8", "label": "return", "type": "return", "loc": [207, 207], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L203_C4", "vector": [13, 2, 0.5847, 0.0028, 2, 0.71, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L209_C4", "label": "_filter_by_names", "type": "function", "loc": [209, 213], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L150_C0", "vector": [2, 1, 0.596, 0.0141, 1, 0.99, 0.7778, 87, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "_filter_by_names", "arg_names": ["self", "suites", "tests"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _filter_by_names(self, suites, tests):\n ret = BaseTestSuite._filter_by_names(self, suites, tests)\n self.starttime = self.endtime = 'N/A'\n self.set_status()\n return ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L210_C8", "label": "ret = _filter_by_names()", "type": "assigned_variable", "loc": [210, 210], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L209_C4", "vector": [14, 2, 0.5932, 0.0028, 2, 0.99, 0.0, 501, 3, 3, 0, 0, 87, 10, 1], "semantic": {"name": "ret", "arg_names": [], "import_names": [], "rhs_call_name": "_filter_by_names", "annotation": ""}, "snippet": " ret = BaseTestSuite._filter_by_names(self, suites, tests)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L211_C8", "label": "self.starttime =", "type": "assigned_variable", "loc": [211, 211], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L209_C4", "vector": [14, 2, 0.596, 0.0028, 2, 0.99, 0.3333, 705, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.starttime", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.starttime = self.endtime = 'N/A'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L212_C8", "label": "set_status()", "type": "expression", "loc": [212, 212], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L209_C4", "vector": [8, 2, 0.5989, 0.0028, 2, 0.99, 0.6667, 636, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "set_status", "arg_names": [], "import_names": [], "rhs_call_name": "set_status", "annotation": ""}, "snippet": " self.set_status()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Return_L213_C8", "label": "return", "type": "return", "loc": [213, 213], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L209_C4", "vector": [13, 2, 0.6017, 0.0028, 2, 0.99, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L215_C4", "label": "remove_keywords", "type": "function", "loc": [215, 223], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L150_C0", "vector": [2, 1, 0.6186, 0.0254, 1, 0.99, 0.8889, 336, 0, 2, 0, 0, 0, 0, 4], "semantic": {"name": "remove_keywords", "arg_names": ["self", "how"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def remove_keywords(self, how):\n should_remove = ShouldRemoveCallable(how)\n if not should_remove:\n return\n self._remove_fixture_keywords(should_remove)\n for suite in self.suites:\n suite.remove_keywords(how)\n for test in self.tests:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L216_C8", "label": "should_remove = ShouldRemoveCallable()", "type": "assigned_variable", "loc": [216, 216], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L215_C4", "vector": [14, 2, 0.6102, 0.0028, 2, 0.42, 0.0, 268, 3, 1, 0, 0, 828, 10, 1], "semantic": {"name": "should_remove", "arg_names": [], "import_names": [], "rhs_call_name": "ShouldRemoveCallable", "annotation": ""}, "snippet": " should_remove = ShouldRemoveCallable(how)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L217_C8", "label": "if", "type": "if", "loc": [217, 218], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L215_C4", "vector": [4, 2, 0.6144, 0.0056, 2, 0.42, 0.25, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not should_remove:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Return_L218_C12", "label": "return", "type": "return", "loc": [218, 218], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L217_C8", "vector": [13, 3, 0.6158, 0.0028, 3, 0.87, 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_99900:Expr_L219_C8", "label": "_remove_fixture_keywords()", "type": "expression", "loc": [219, 219], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L215_C4", "vector": [8, 2, 0.6186, 0.0028, 2, 0.42, 0.5, 568, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_remove_fixture_keywords", "arg_names": [], "import_names": [], "rhs_call_name": "_remove_fixture_keywords", "annotation": ""}, "snippet": " self._remove_fixture_keywords(should_remove)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:For_L220_C8", "label": "for suite", "type": "for", "loc": [220, 221], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L215_C4", "vector": [6, 2, 0.6229, 0.0056, 2, 0.42, 0.75, 425, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "suite", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for suite in self.suites:\n suite.remove_keywords(how)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L221_C12", "label": "remove_keywords()", "type": "expression", "loc": [221, 221], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:For_L220_C8", "vector": [8, 3, 0.6243, 0.0028, 3, 0.98, 0.0, 336, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "remove_keywords", "arg_names": [], "import_names": [], "rhs_call_name": "remove_keywords", "annotation": ""}, "snippet": " suite.remove_keywords(how)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:For_L222_C8", "label": "for test", "type": "for", "loc": [222, 223], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L215_C4", "vector": [6, 2, 0.6285, 0.0056, 2, 0.42, 1.0, 224, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "test", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for test in self.tests:\n test.remove_keywords(should_remove)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L223_C12", "label": "remove_keywords()", "type": "expression", "loc": [223, 223], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:For_L222_C8", "vector": [8, 3, 0.6299, 0.0028, 3, 0.87, 0.0, 336, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "remove_keywords", "arg_names": [], "import_names": [], "rhs_call_name": "remove_keywords", "annotation": ""}, "snippet": " test.remove_keywords(should_remove)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L225_C4", "label": "_remove_fixture_keywords", "type": "function", "loc": [225, 229], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L150_C0", "vector": [2, 1, 0.6412, 0.0141, 1, 0.99, 1.0, 568, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "_remove_fixture_keywords", "arg_names": ["self", "should_remove"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _remove_fixture_keywords(self, should_remove):\n critical_failures = self.critical_stats.failed != 0\n for kw in self.setup, self.teardown:\n if should_remove(kw, critical_failures):\n kw.remove_data()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L226_C8", "label": "critical_failures =", "type": "assigned_variable", "loc": [226, 226], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L225_C4", "vector": [14, 2, 0.6384, 0.0028, 2, 0.08, 0.0, 310, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "critical_failures", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " critical_failures = self.critical_stats.failed != 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:For_L227_C8", "label": "for kw", "type": "for", "loc": [227, 229], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L225_C4", "vector": [6, 2, 0.6441, 0.0085, 2, 0.08, 1.0, 755, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "kw", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for kw in self.setup, self.teardown:\n if should_remove(kw, critical_failures):\n kw.remove_data()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L228_C12", "label": "if", "type": "if", "loc": [228, 229], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:For_L227_C8", "vector": [4, 3, 0.6455, 0.0056, 3, 0.46, 0.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if should_remove(kw, critical_failures):\n kw.remove_data()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L229_C16", "label": "remove_data()", "type": "expression", "loc": [229, 229], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L228_C12", "vector": [8, 4, 0.6469, 0.0028, 4, 0.59, 0.0, 726, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "remove_data", "arg_names": [], "import_names": [], "rhs_call_name": "remove_data", "annotation": ""}, "snippet": " kw.remove_data()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L232_C0", "label": "CombinedTestSuite", "type": "class", "loc": [232, 245], "level": 0, "parent": null, "vector": [3, 0, 0.6737, 0.0395, 0, 0.66, 0.7391, 973, 0, 2, 0, 0, 75, 0, 4], "semantic": {"name": "CombinedTestSuite", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class CombinedTestSuite(TestSuite):\n\n def __init__(self, settings):\n BaseTestSuite.__init__(self, name='')\n self.starttime = self.endtime = None\n self._set_times_from_settings(settings)\n\n def add_suite(self, suite):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L234_C4", "label": "__init__", "type": "function", "loc": [234, 237], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L232_C0", "vector": [2, 1, 0.6653, 0.0113, 1, 0.61, 0.0, 555, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "settings"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, settings):\n BaseTestSuite.__init__(self, name='')\n self.starttime = self.endtime = None\n self._set_times_from_settings(settings)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L235_C8", "label": "__init__()", "type": "expression", "loc": [235, 235], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L234_C4", "vector": [8, 2, 0.6638, 0.0028, 2, 0.85, 0.0, 555, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " BaseTestSuite.__init__(self, name='')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L236_C8", "label": "self.starttime =", "type": "assigned_variable", "loc": [236, 236], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L234_C4", "vector": [14, 2, 0.6667, 0.0028, 2, 0.85, 0.5, 705, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.starttime", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.starttime = self.endtime = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L237_C8", "label": "_set_times_from_settings()", "type": "expression", "loc": [237, 237], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L234_C4", "vector": [8, 2, 0.6695, 0.0028, 2, 0.85, 1.0, 312, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_set_times_from_settings", "arg_names": [], "import_names": [], "rhs_call_name": "_set_times_from_settings", "annotation": ""}, "snippet": " self._set_times_from_settings(settings)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L239_C4", "label": "add_suite", "type": "function", "loc": [239, 245], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L232_C0", "vector": [2, 1, 0.6836, 0.0198, 1, 0.61, 1.0, 407, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "add_suite", "arg_names": ["self", "suite"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add_suite(self, suite):\n self.suites.append(suite)\n suite.parent = self\n self._add_suite_to_stats(suite)\n self.status = self.critical_stats.failed == 0 and 'PASS' or 'FAIL'\n if self.starttime == 'N/A' or self.endtime == 'N/A':\n self.elapsedtime += suite.elapsedtime"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L240_C8", "label": "append()", "type": "expression", "loc": [240, 240], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L239_C4", "vector": [8, 2, 0.678, 0.0028, 2, 0.0, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.suites.append(suite)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L241_C8", "label": "suite.parent =", "type": "assigned_variable", "loc": [241, 241], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L239_C4", "vector": [14, 2, 0.6808, 0.0028, 2, 0.0, 0.25, 535, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "suite.parent", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " suite.parent = self"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L242_C8", "label": "_add_suite_to_stats()", "type": "expression", "loc": [242, 242], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L239_C4", "vector": [8, 2, 0.6836, 0.0028, 2, 0.0, 0.5, 355, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_add_suite_to_stats", "arg_names": [], "import_names": [], "rhs_call_name": "_add_suite_to_stats", "annotation": ""}, "snippet": " self._add_suite_to_stats(suite)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L243_C8", "label": "self.status =", "type": "assigned_variable", "loc": [243, 243], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L239_C4", "vector": [14, 2, 0.6864, 0.0028, 2, 0.0, 0.75, 651, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.status", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.status = self.critical_stats.failed == 0 and 'PASS' or 'FAIL'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L244_C8", "label": "if", "type": "if", "loc": [244, 245], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L239_C4", "vector": [4, 2, 0.6907, 0.0056, 2, 0.0, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.starttime == 'N/A' or self.endtime == 'N/A':\n self.elapsedtime += suite.elapsedtime"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L248_C0", "label": "TestCase", "type": "class", "loc": [248, 262], "level": 0, "parent": null, "vector": [3, 0, 0.7203, 0.0424, 0, 0.66, 0.7826, 3, 0, 3, 0, 0, 639, 0, 8], "semantic": {"name": "TestCase", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class TestCase(BaseTestCase, _TestReader):\n\n def __init__(self, node, parent, log_level=None):\n BaseTestCase.__init__(self, node.get('name'), parent)\n _TestReader.__init__(self, node, log_level=log_level)\n self.set_criticality(parent.critical)\n\n def remove_keywords(self, should_remove):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L250_C4", "label": "__init__", "type": "function", "loc": [250, 253], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L248_C0", "vector": [2, 1, 0.7105, 0.0113, 1, 0.98, 0.0, 555, 0, 4, 0, 0, 0, 0, 4], "semantic": {"name": "__init__", "arg_names": ["self", "node", "parent", "log_level"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, node, parent, log_level=None):\n BaseTestCase.__init__(self, node.get('name'), parent)\n _TestReader.__init__(self, node, log_level=log_level)\n self.set_criticality(parent.critical)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L251_C8", "label": "__init__()", "type": "expression", "loc": [251, 251], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L250_C4", "vector": [8, 2, 0.709, 0.0028, 2, 0.05, 0.0, 555, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " BaseTestCase.__init__(self, node.get('name'), parent)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L252_C8", "label": "__init__()", "type": "expression", "loc": [252, 252], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L250_C4", "vector": [8, 2, 0.7119, 0.0028, 2, 0.05, 0.5, 555, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " _TestReader.__init__(self, node, log_level=log_level)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L253_C8", "label": "set_criticality()", "type": "expression", "loc": [253, 253], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L250_C4", "vector": [8, 2, 0.7147, 0.0028, 2, 0.05, 1.0, 158, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_criticality", "arg_names": [], "import_names": [], "rhs_call_name": "set_criticality", "annotation": ""}, "snippet": " self.set_criticality(parent.critical)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L255_C4", "label": "remove_keywords", "type": "function", "loc": [255, 259], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L248_C0", "vector": [2, 1, 0.726, 0.0141, 1, 0.98, 0.5, 336, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "remove_keywords", "arg_names": ["self", "should_remove"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def remove_keywords(self, should_remove):\n if should_remove(self, (self.status != 'PASS')):\n for kw in self.keywords + [self.setup, self.teardown]:\n if kw is not None:\n kw.remove_data()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L256_C8", "label": "if", "type": "if", "loc": [256, 259], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L255_C4", "vector": [4, 2, 0.7274, 0.0113, 2, 0.34, 0.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if should_remove(self, (self.status != 'PASS')):\n for kw in self.keywords + [self.setup, self.teardown]:\n if kw is not None:\n kw.remove_data()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:For_L257_C12", "label": "for kw", "type": "for", "loc": [257, 259], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L256_C8", "vector": [6, 3, 0.7288, 0.0085, 3, 0.89, 0.0, 755, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "kw", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for kw in self.keywords + [self.setup, self.teardown]:\n if kw is not None:\n kw.remove_data()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L258_C16", "label": "if", "type": "if", "loc": [258, 259], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:For_L257_C12", "vector": [4, 4, 0.7302, 0.0056, 4, 0.17, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if kw is not None:\n kw.remove_data()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L259_C20", "label": "remove_data()", "type": "expression", "loc": [259, 259], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L258_C16", "vector": [8, 5, 0.7316, 0.0028, 5, 0.46, 0.0, 726, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "remove_data", "arg_names": [], "import_names": [], "rhs_call_name": "remove_data", "annotation": ""}, "snippet": " kw.remove_data()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L261_C4", "label": "contains_warnings", "type": "function", "loc": [261, 262], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L248_C0", "vector": [2, 1, 0.7387, 0.0056, 1, 0.98, 1.0, 137, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "contains_warnings", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def contains_warnings(self):\n return any(kw.contains_warnings() for kw in self.keywords)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Return_L262_C8", "label": "return", "type": "return", "loc": [262, 262], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L261_C4", "vector": [13, 2, 0.7401, 0.0028, 2, 0.87, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return any(kw.contains_warnings() for kw in self.keywords)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L265_C0", "label": "Keyword", "type": "class", "loc": [265, 294], "level": 0, "parent": null, "vector": [3, 0, 0.7895, 0.0847, 0, 0.66, 0.8261, 582, 0, 7, 0, 0, 776, 0, 11], "semantic": {"name": "Keyword", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Keyword(BaseKeyword, _KeywordReader):\n\n def __init__(self, node, log_level=None):\n self._init_data()\n BaseKeyword.__init__(self, node.get('name'))\n _KeywordReader.__init__(self, node, log_level)\n\n def _init_data(self):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L267_C4", "label": "__init__", "type": "function", "loc": [267, 270], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L265_C0", "vector": [2, 1, 0.7585, 0.0113, 1, 0.74, 0.0, 555, 0, 3, 0, 0, 0, 0, 4], "semantic": {"name": "__init__", "arg_names": ["self", "node", "log_level"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, node, log_level=None):\n self._init_data()\n BaseKeyword.__init__(self, node.get('name'))\n _KeywordReader.__init__(self, node, log_level)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L268_C8", "label": "_init_data()", "type": "expression", "loc": [268, 268], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L267_C4", "vector": [8, 2, 0.7571, 0.0028, 2, 0.39, 0.0, 648, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_init_data", "arg_names": [], "import_names": [], "rhs_call_name": "_init_data", "annotation": ""}, "snippet": " self._init_data()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L269_C8", "label": "__init__()", "type": "expression", "loc": [269, 269], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L267_C4", "vector": [8, 2, 0.7599, 0.0028, 2, 0.39, 0.5, 555, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " BaseKeyword.__init__(self, node.get('name'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L270_C8", "label": "__init__()", "type": "expression", "loc": [270, 270], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L267_C4", "vector": [8, 2, 0.7627, 0.0028, 2, 0.39, 1.0, 555, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " _KeywordReader.__init__(self, node, log_level)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L272_C4", "label": "_init_data", "type": "function", "loc": [272, 275], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L265_C0", "vector": [2, 1, 0.7726, 0.0113, 1, 0.74, 0.1667, 648, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "_init_data", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _init_data(self):\n self.messages = []\n self.keywords = []\n self.children = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L273_C8", "label": "self.messages =", "type": "assigned_variable", "loc": [273, 273], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L272_C4", "vector": [14, 2, 0.7712, 0.0028, 2, 0.32, 0.0, 44, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.messages", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.messages = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L274_C8", "label": "self.keywords =", "type": "assigned_variable", "loc": [274, 274], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L272_C4", "vector": [14, 2, 0.774, 0.0028, 2, 0.32, 0.5, 627, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.keywords", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.keywords = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L275_C8", "label": "self.children =", "type": "assigned_variable", "loc": [275, 275], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L272_C4", "vector": [14, 2, 0.7768, 0.0028, 2, 0.32, 1.0, 278, 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_99900:FunctionDef_L277_C4", "label": "remove_data", "type": "function", "loc": [277, 278], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L265_C0", "vector": [2, 1, 0.7839, 0.0056, 1, 0.74, 0.3333, 726, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "remove_data", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def remove_data(self):\n self._init_data()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L278_C8", "label": "_init_data()", "type": "expression", "loc": [278, 278], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L277_C4", "vector": [8, 2, 0.7853, 0.0028, 2, 0.66, 0.0, 648, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_init_data", "arg_names": [], "import_names": [], "rhs_call_name": "_init_data", "annotation": ""}, "snippet": " self._init_data()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L280_C4", "label": "contains_warnings", "type": "function", "loc": [280, 282], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L265_C0", "vector": [2, 1, 0.7938, 0.0085, 1, 0.74, 0.5, 137, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "contains_warnings", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def contains_warnings(self):\n return any(msg.level == 'WARN' for msg in self.messages) or \\\n any(kw.contains_warnings() for kw in self.keywords)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Return_L281_C8", "label": "return", "type": "return", "loc": [281, 282], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L280_C4", "vector": [13, 2, 0.7952, 0.0056, 2, 0.29, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return any(msg.level == 'WARN' for msg in self.messages) or \\\n any(kw.contains_warnings() for kw in self.keywords)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L284_C4", "label": "__str__", "type": "function", "loc": [284, 285], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L265_C0", "vector": [2, 1, 0.8037, 0.0056, 1, 0.74, 0.6667, 527, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "__str__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __str__(self):\n return self.name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Return_L285_C8", "label": "return", "type": "return", "loc": [285, 285], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L284_C4", "vector": [13, 2, 0.8051, 0.0028, 2, 0.77, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L287_C4", "label": "__repr__", "type": "function", "loc": [287, 288], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L265_C0", "vector": [2, 1, 0.8121, 0.0056, 1, 0.74, 0.8333, 204, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "__repr__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __repr__(self):\n return \"'%s'\" % self.name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Return_L288_C8", "label": "return", "type": "return", "loc": [288, 288], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L287_C4", "vector": [13, 2, 0.8136, 0.0028, 2, 0.86, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return \"'%s'\" % self.name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L290_C4", "label": "serialize", "type": "function", "loc": [290, 294], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L265_C0", "vector": [2, 1, 0.8249, 0.0141, 1, 0.74, 1.0, 50, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "serialize", "arg_names": ["self", "serializer"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def serialize(self, serializer):\n serializer.start_keyword(self)\n for child in self.children:\n child.serialize(serializer)\n serializer.end_keyword(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L291_C8", "label": "start_keyword()", "type": "expression", "loc": [291, 291], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L290_C4", "vector": [8, 2, 0.822, 0.0028, 2, 0.25, 0.0, 776, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "start_keyword", "arg_names": [], "import_names": [], "rhs_call_name": "start_keyword", "annotation": ""}, "snippet": " serializer.start_keyword(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:For_L292_C8", "label": "for child", "type": "for", "loc": [292, 293], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L290_C4", "vector": [6, 2, 0.8263, 0.0056, 2, 0.25, 0.5, 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 child.serialize(serializer)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L293_C12", "label": "serialize()", "type": "expression", "loc": [293, 293], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:For_L292_C8", "vector": [8, 3, 0.8277, 0.0028, 3, 0.38, 0.0, 50, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "serialize", "arg_names": [], "import_names": [], "rhs_call_name": "serialize", "annotation": ""}, "snippet": " child.serialize(serializer)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L294_C8", "label": "end_keyword()", "type": "expression", "loc": [294, 294], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L290_C4", "vector": [8, 2, 0.8305, 0.0028, 2, 0.25, 1.0, 959, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "end_keyword", "arg_names": [], "import_names": [], "rhs_call_name": "end_keyword", "annotation": ""}, "snippet": " serializer.end_keyword(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L297_C0", "label": "MessageFromXml", "type": "class", "loc": [297, 315], "level": 0, "parent": null, "vector": [3, 0, 0.8644, 0.0537, 0, 0.66, 0.8696, 737, 0, 4, 0, 0, 6, 0, 9], "semantic": {"name": "MessageFromXml", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class MessageFromXml(Message):\n\n def __init__(self, node):\n Message.__init__(self, node.text,\n level=node.get('level', 'INFO'),\n html=node.get('html', 'no') == 'yes',\n timestamp=node.get('timestamp', 'N/A'),\n linkable=node.get('linkable', 'no') == 'yes')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L299_C4", "label": "__init__", "type": "function", "loc": [299, 304], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L297_C0", "vector": [2, 1, 0.8517, 0.0169, 1, 0.34, 0.0, 555, 0, 2, 0, 0, 0, 0, 5], "semantic": {"name": "__init__", "arg_names": ["self", "node"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, node):\n Message.__init__(self, node.text,\n level=node.get('level', 'INFO'),\n html=node.get('html', 'no') == 'yes',\n timestamp=node.get('timestamp', 'N/A'),\n linkable=node.get('linkable', 'no') == 'yes')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L300_C8", "label": "__init__()", "type": "expression", "loc": [300, 304], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L299_C4", "vector": [8, 2, 0.8531, 0.0141, 2, 0.48, 0.0, 555, 3, 6, 0, 0, 0, 0, 5], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " Message.__init__(self, node.text,\n level=node.get('level', 'INFO'),\n html=node.get('html', 'no') == 'yes',\n timestamp=node.get('timestamp', 'N/A'),\n linkable=node.get('linkable', 'no') == 'yes')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L306_C4", "label": "serialize", "type": "function", "loc": [306, 307], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L297_C0", "vector": [2, 1, 0.8658, 0.0056, 1, 0.34, 0.3333, 50, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "serialize", "arg_names": ["self", "serializer"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def serialize(self, serializer):\n serializer.message(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L307_C8", "label": "message()", "type": "expression", "loc": [307, 307], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L306_C4", "vector": [8, 2, 0.8672, 0.0028, 2, 0.38, 0.0, 635, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "message", "arg_names": [], "import_names": [], "rhs_call_name": "message", "annotation": ""}, "snippet": " serializer.message(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L309_C4", "label": "__str__", "type": "function", "loc": [309, 310], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L297_C0", "vector": [2, 1, 0.8743, 0.0056, 1, 0.34, 0.6667, 527, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "__str__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __str__(self):\n return '%s %s %s' % (self.timestamp, self.level, self.message)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Return_L310_C8", "label": "return", "type": "return", "loc": [310, 310], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L309_C4", "vector": [13, 2, 0.8757, 0.0028, 2, 0.31, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '%s %s %s' % (self.timestamp, self.level, self.message)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L312_C4", "label": "__repr__", "type": "function", "loc": [312, 315], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L297_C0", "vector": [2, 1, 0.8856, 0.0113, 1, 0.34, 1.0, 204, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "__repr__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __repr__(self):\n lines = self.message.split('\\n')\n msg = len(lines) > 1 and lines[0] + '...' or lines[0]\n return \"'%s %s'\" % (self.level, msg.replace(\"'\",'\"'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L313_C8", "label": "lines = split()", "type": "assigned_variable", "loc": [313, 313], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L312_C4", "vector": [14, 2, 0.8842, 0.0028, 2, 0.8, 0.0, 73, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "lines", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " lines = self.message.split('\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L314_C8", "label": "msg =", "type": "assigned_variable", "loc": [314, 314], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L312_C4", "vector": [14, 2, 0.887, 0.0028, 2, 0.8, 0.5, 712, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " msg = len(lines) > 1 and lines[0] + '...' or lines[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Return_L315_C8", "label": "return", "type": "return", "loc": [315, 315], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L312_C4", "vector": [13, 2, 0.8898, 0.0028, 2, 0.8, 1.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return \"'%s %s'\" % (self.level, msg.replace(\"'\",'\"'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L318_C0", "label": "ExecutionErrors", "type": "class", "loc": [318, 330], "level": 0, "parent": null, "vector": [3, 0, 0.9153, 0.0367, 0, 0.66, 0.913, 325, 0, 2, 0, 0, 0, 0, 5], "semantic": {"name": "ExecutionErrors", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ExecutionErrors:\n\n def __init__(self, node):\n if node is None:\n self.messages = []\n else:\n self.messages = [MessageFromXml(msg) for msg in node.findall('msg')]\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L320_C4", "label": "__init__", "type": "function", "loc": [320, 324], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L318_C0", "vector": [2, 1, 0.9096, 0.0141, 1, 0.16, 0.0, 555, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "node"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, node):\n if node is None:\n self.messages = []\n else:\n self.messages = [MessageFromXml(msg) for msg in node.findall('msg')]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L321_C8", "label": "if", "type": "if", "loc": [321, 324], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L320_C4", "vector": [4, 2, 0.911, 0.0113, 2, 0.4, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if node is None:\n self.messages = []\n else:\n self.messages = [MessageFromXml(msg) for msg in node.findall('msg')]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L322_C12", "label": "self.messages =", "type": "assigned_variable", "loc": [322, 322], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L321_C8", "vector": [14, 3, 0.9096, 0.0028, 3, 0.29, 0.0, 44, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.messages", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.messages = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L324_C12", "label": "self.messages =", "type": "assigned_variable", "loc": [324, 324], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L321_C8", "vector": [14, 3, 0.9153, 0.0028, 3, 0.29, 1.0, 44, 5, 0, 0, 0, 0, 0, 2], "semantic": {"name": "self.messages", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.messages = [MessageFromXml(msg) for msg in node.findall('msg')]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L326_C4", "label": "serialize", "type": "function", "loc": [326, 330], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L318_C0", "vector": [2, 1, 0.9266, 0.0141, 1, 0.16, 1.0, 50, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "serialize", "arg_names": ["self", "serializer"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def serialize(self, serializer):\n serializer.start_errors()\n for msg in self.messages:\n msg.serialize(serializer)\n serializer.end_errors()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L327_C8", "label": "start_errors()", "type": "expression", "loc": [327, 327], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L326_C4", "vector": [8, 2, 0.9237, 0.0028, 2, 0.95, 0.0, 750, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start_errors", "arg_names": [], "import_names": [], "rhs_call_name": "start_errors", "annotation": ""}, "snippet": " serializer.start_errors()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:For_L328_C8", "label": "for msg", "type": "for", "loc": [328, 329], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L326_C4", "vector": [6, 2, 0.928, 0.0056, 2, 0.95, 0.5, 712, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for msg in self.messages:\n msg.serialize(serializer)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L329_C12", "label": "serialize()", "type": "expression", "loc": [329, 329], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:For_L328_C8", "vector": [8, 3, 0.9294, 0.0028, 3, 0.4, 0.0, 50, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "serialize", "arg_names": [], "import_names": [], "rhs_call_name": "serialize", "annotation": ""}, "snippet": " msg.serialize(serializer)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L330_C8", "label": "end_errors()", "type": "expression", "loc": [330, 330], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L326_C4", "vector": [8, 2, 0.9322, 0.0028, 2, 0.95, 1.0, 230, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "end_errors", "arg_names": [], "import_names": [], "rhs_call_name": "end_errors", "annotation": ""}, "snippet": " serializer.end_errors()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L333_C0", "label": "CombinedExecutionErrors", "type": "class", "loc": [333, 339], "level": 0, "parent": null, "vector": [3, 0, 0.9492, 0.0198, 0, 0.66, 0.9565, 663, 0, 2, 0, 0, 325, 0, 0], "semantic": {"name": "CombinedExecutionErrors", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class CombinedExecutionErrors(ExecutionErrors):\n\n def __init__(self):\n self.messages = []\n\n def add(self, other):\n self.messages += other.messages"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L335_C4", "label": "__init__", "type": "function", "loc": [335, 336], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L333_C0", "vector": [2, 1, 0.9477, 0.0056, 1, 0.82, 0.0, 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.messages = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L336_C8", "label": "self.messages =", "type": "assigned_variable", "loc": [336, 336], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L335_C4", "vector": [14, 2, 0.9492, 0.0028, 2, 0.13, 0.0, 44, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.messages", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.messages = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L338_C4", "label": "add", "type": "function", "loc": [338, 339], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L333_C0", "vector": [2, 1, 0.9562, 0.0056, 1, 0.82, 1.0, 241, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "add", "arg_names": ["self", "other"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add(self, other):\n self.messages += other.messages"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L342_C0", "label": "ShouldRemoveCallable", "type": "function", "loc": [342, 354], "level": 0, "parent": null, "vector": [2, 0, 0.9831, 0.0367, 0, 0.66, 1.0, 828, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "ShouldRemoveCallable", "arg_names": ["how"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def ShouldRemoveCallable(how):\n def _removes_all(item, critical_failures):\n return item is not None\n def _removes_passed_not_containing_warnings(item, critical_failures):\n if item is None:\n return False\n if critical_failures:\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L343_C4", "label": "_removes_all", "type": "function", "loc": [343, 344], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L342_C0", "vector": [2, 1, 0.9703, 0.0056, 1, 0.62, 0.0, 232, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "_removes_all", "arg_names": ["item", "critical_failures"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _removes_all(item, critical_failures):\n return item is not None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Return_L344_C8", "label": "return", "type": "return", "loc": [344, 344], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L343_C4", "vector": [13, 2, 0.9718, 0.0028, 2, 0.76, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return item is not None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L345_C4", "label": "_removes_passed_not_containing_warnings", "type": "function", "loc": [345, 350], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L342_C0", "vector": [2, 1, 0.9816, 0.0169, 1, 0.62, 0.25, 827, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "_removes_passed_not_containing_warnings", "arg_names": ["item", "critical_failures"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _removes_passed_not_containing_warnings(item, critical_failures):\n if item is None:\n return False\n if critical_failures:\n return False\n return not item.contains_warnings()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L346_C8", "label": "if", "type": "if", "loc": [346, 347], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L345_C4", "vector": [4, 2, 0.9788, 0.0056, 2, 0.85, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if item is None:\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Return_L347_C12", "label": "return", "type": "return", "loc": [347, 347], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L346_C8", "vector": [13, 3, 0.9802, 0.0028, 3, 0.67, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L348_C8", "label": "if", "type": "if", "loc": [348, 349], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L345_C4", "vector": [4, 2, 0.9845, 0.0056, 2, 0.85, 0.5, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if critical_failures:\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Return_L349_C12", "label": "return", "type": "return", "loc": [349, 349], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L348_C8", "vector": [13, 3, 0.9859, 0.0028, 3, 0.48, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Return_L350_C8", "label": "return", "type": "return", "loc": [350, 350], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L345_C4", "vector": [13, 2, 0.9887, 0.0028, 2, 0.85, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return not item.contains_warnings()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L351_C4", "label": "how = upper()", "type": "assigned_variable", "loc": [351, 351], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L342_C0", "vector": [14, 1, 0.9915, 0.0028, 1, 0.62, 0.5, 222, 3, 0, 0, 0, 347, 10, 1], "semantic": {"name": "how", "arg_names": [], "import_names": [], "rhs_call_name": "upper", "annotation": ""}, "snippet": " how = how.upper()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L352_C4", "label": "if", "type": "if", "loc": [352, 353], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L342_C0", "vector": [4, 1, 0.9958, 0.0056, 1, 0.62, 0.75, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if how == 'ALL':\n return _removes_all"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Return_L353_C8", "label": "return", "type": "return", "loc": [353, 353], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L352_C4", "vector": [13, 2, 0.9972, 0.0028, 2, 0.98, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return _removes_all"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99900:Return_L354_C4", "label": "return", "type": "return", "loc": [354, 354], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L342_C0", "vector": [13, 1, 1.0, 0.0028, 1, 0.62, 1.0, 0, 8, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return _removes_passed_not_containing_warnings if how == 'PASSED' else None"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Return_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:For_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:For_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:For_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:For_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Return_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Try_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:Try_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Return_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Return_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L63_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Return_L64_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L73_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L78_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L79_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L80_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L73_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L89_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L91_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Return_L92_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Return_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L98_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L98_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L99_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L98_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L98_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L101_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L101_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L102_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L98_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L103_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L103_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L104_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L107_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L109_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L110_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:For_L112_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:For_L112_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L113_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L107_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L115_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L115_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Return_L116_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L119_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L121_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L122_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L123_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L124_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L127_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L129_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L130_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L132_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L133_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L134_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L135_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L136_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L137_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L138_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:For_L139_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:For_L139_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L140_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L140_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L141_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L140_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L142_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L140_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L143_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L140_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L144_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L144_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L145_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L144_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L146_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L144_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L147_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L150_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L152_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L152_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L153_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L152_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L155_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L152_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L156_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L152_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:For_L157_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:For_L157_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L158_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:For_L157_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L159_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:For_L157_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L160_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L152_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:For_L161_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:For_L161_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L162_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L152_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L163_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L152_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L164_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L164_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L166_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L150_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L168_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L168_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L169_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L168_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L170_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L170_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L171_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L168_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L172_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L172_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L173_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L168_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L174_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L150_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L176_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L176_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L177_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L177_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Return_L178_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L176_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Return_L179_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L150_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L182_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L182_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L183_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L183_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Return_L184_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L182_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Try_L185_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:Try_L185_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L186_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:Try_L185_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Return_L189_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L182_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Return_L190_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L150_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L192_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L192_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L193_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L192_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L194_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L194_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L195_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L194_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L196_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L150_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L199_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L200_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L201_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L150_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L203_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L203_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L204_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L203_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L205_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L203_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L206_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L203_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Return_L207_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L150_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L209_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L209_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L210_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L209_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L211_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L209_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L212_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L209_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Return_L213_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L150_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L215_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L215_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L216_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L215_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L217_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L217_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Return_L218_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L215_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L219_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L215_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:For_L220_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:For_L220_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L221_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L215_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:For_L222_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:For_L222_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L223_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L150_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L225_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L226_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:For_L227_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:For_L227_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L228_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L228_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L229_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L232_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L234_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L234_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L235_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L234_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L236_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L234_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L237_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L232_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L239_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L239_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L240_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L239_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L241_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L239_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L242_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L239_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L243_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L239_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L244_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L248_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L250_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L250_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L251_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L250_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L252_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L250_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L253_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L248_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L255_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L255_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L256_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L256_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:For_L257_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:For_L257_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L258_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L258_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L259_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L248_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L261_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L261_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Return_L262_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L265_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L267_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L267_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L268_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L267_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L269_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L267_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L270_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L265_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L272_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L272_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L273_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L272_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L274_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L272_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L275_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L265_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L277_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L277_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L278_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L265_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L280_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L280_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Return_L281_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L265_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L284_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L284_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Return_L285_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L265_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L287_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L287_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Return_L288_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L265_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L290_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L290_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L291_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L290_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:For_L292_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:For_L292_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L293_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L290_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L294_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L297_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L299_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L299_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L300_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L297_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L306_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L306_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L307_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L297_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L309_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L309_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Return_L310_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L297_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L312_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L312_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L313_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L312_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L314_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L312_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Return_L315_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L318_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L320_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L320_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L321_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L321_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L322_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L321_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L324_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L318_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L326_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L326_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L327_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L326_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:For_L328_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:For_L328_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L329_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L326_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Expr_L330_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L333_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L335_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L335_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L336_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:ClassDef_L333_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L338_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L342_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L343_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L343_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Return_L344_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L342_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L345_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L345_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L346_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L346_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Return_L347_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L345_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L348_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L348_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Return_L349_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L345_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Return_L350_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L342_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Assign_L351_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L342_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L352_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:If_L352_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Return_L353_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99900:FunctionDef_L342_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99900:Return_L354_C4"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import os
from loggerhelper import AbstractLogger
class FileLogger(AbstractLogger):
def __init__(self, path, level):
AbstractLogger.__init__(self, level)
self._writer = self._get_writer(path)
def _get_writer(self, path):
# Hook for unittests
return open(path, 'wb')
def message(self, msg):
if self._is_logged(msg.level):
entry = '%s | %s | %s\n' % (msg.timestamp, msg.level.ljust(5),
msg.message)
self._writer.write(entry.replace('\n', os.linesep).encode('UTF-8'))
def start_suite(self, suite):
self.info("Started test suite '%s'" % suite.name)
def end_suite(self, suite):
self.info("Ended test suite '%s'" % suite.name)
def start_test(self, test):
self.info("Started test case '%s'" % test.name)
def end_test(self, test):
self.info("Ended test case '%s'" % test.name)
def start_keyword(self, kw):
self.debug("Started keyword '%s'" % kw.name)
def end_keyword(self, kw):
self.debug("Ended keyword '%s'" % kw.name)
def output_file(self, name, path):
self.info('%s: %s' % (name, path))
def close(self):
self._writer.close()
| ajibawa-2023/Python-Code-Large/train/row_99901 | 28 | 58 | 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_99901:Import_L15_C0", "label": "os import os", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.2586, 0.0172, 0, 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_99901:ImportFrom_L17_C0", "label": "from loggerhelper import AbstractLogger", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.2931, 0.0172, 0, 0.66, 0.5, 426, 0, 1, 0, 0, 426, 0, 0], "semantic": {"name": "loggerhelper", "arg_names": [], "import_names": ["AbstractLogger"], "rhs_call_name": "", "annotation": ""}, "snippet": "from loggerhelper import AbstractLogger"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99901:ClassDef_L20_C0", "label": "FileLogger", "type": "class", "loc": [20, 58], "level": 0, "parent": null, "vector": [3, 0, 0.6724, 0.6724, 0, 0.66, 1.0, 881, 0, 11, 0, 0, 61, 0, 16], "semantic": {"name": "FileLogger", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class FileLogger(AbstractLogger):\n\n def __init__(self, path, level):\n AbstractLogger.__init__(self, level)\n self._writer = self._get_writer(path)\n\n def _get_writer(self, path):\n # Hook for unittests"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99901:FunctionDef_L22_C4", "label": "__init__", "type": "function", "loc": [22, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99901:ClassDef_L20_C0", "vector": [2, 1, 0.3966, 0.0517, 1, 0.93, 0.0, 555, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "path", "level"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, path, level):\n AbstractLogger.__init__(self, level)\n self._writer = self._get_writer(path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99901:Expr_L23_C8", "label": "__init__()", "type": "expression", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99901:FunctionDef_L22_C4", "vector": [8, 2, 0.3966, 0.0172, 2, 0.61, 0.0, 555, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " AbstractLogger.__init__(self, level)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99901:Assign_L24_C8", "label": "self._writer = _get_writer()", "type": "assigned_variable", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99901:FunctionDef_L22_C4", "vector": [14, 2, 0.4138, 0.0172, 2, 0.61, 1.0, 446, 3, 1, 0, 0, 860, 10, 1], "semantic": {"name": "self._writer", "arg_names": [], "import_names": [], "rhs_call_name": "_get_writer", "annotation": ""}, "snippet": " self._writer = self._get_writer(path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99901:FunctionDef_L26_C4", "label": "_get_writer", "type": "function", "loc": [26, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99901:ClassDef_L20_C0", "vector": [2, 1, 0.4655, 0.0517, 1, 0.93, 0.1, 860, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "_get_writer", "arg_names": ["self", "path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_writer(self, path):\n # Hook for unittests\n return open(path, 'wb')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99901:Return_L28_C8", "label": "return", "type": "return", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99901:FunctionDef_L26_C4", "vector": [13, 2, 0.4828, 0.0172, 2, 0.36, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return open(path, 'wb')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99901:FunctionDef_L30_C4", "label": "message", "type": "function", "loc": [30, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99901:ClassDef_L20_C0", "vector": [2, 1, 0.5517, 0.0862, 1, 0.93, 0.2, 635, 0, 2, 0, 0, 0, 0, 5], "semantic": {"name": "message", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def message(self, msg):\n if self._is_logged(msg.level):\n entry = '%s | %s | %s\\n' % (msg.timestamp, msg.level.ljust(5),\n msg.message)\n self._writer.write(entry.replace('\\n', os.linesep).encode('UTF-8'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99901:If_L31_C8", "label": "if", "type": "if", "loc": [31, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99901:FunctionDef_L30_C4", "vector": [4, 2, 0.5603, 0.069, 2, 0.29, 0.0, 0, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._is_logged(msg.level):\n entry = '%s | %s | %s\\n' % (msg.timestamp, msg.level.ljust(5),\n msg.message)\n self._writer.write(entry.replace('\\n', os.linesep).encode('UTF-8'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99901:Assign_L32_C12", "label": "entry =", "type": "assigned_variable", "loc": [32, 33], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99901:If_L31_C8", "vector": [14, 3, 0.5603, 0.0345, 3, 0.66, 0.0, 812, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "entry", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " entry = '%s | %s | %s\\n' % (msg.timestamp, msg.level.ljust(5),\n msg.message)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99901:Expr_L34_C12", "label": "write()", "type": "expression", "loc": [34, 34], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99901:If_L31_C8", "vector": [8, 3, 0.5862, 0.0172, 3, 0.66, 1.0, 837, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " self._writer.write(entry.replace('\\n', os.linesep).encode('UTF-8'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99901:FunctionDef_L36_C4", "label": "start_suite", "type": "function", "loc": [36, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99901:ClassDef_L20_C0", "vector": [2, 1, 0.6293, 0.0345, 1, 0.93, 0.3, 38, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "start_suite", "arg_names": ["self", "suite"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start_suite(self, suite):\n self.info(\"Started test suite '%s'\" % suite.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99901:Expr_L37_C8", "label": "info()", "type": "expression", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99901:FunctionDef_L36_C4", "vector": [8, 2, 0.6379, 0.0172, 2, 0.19, 0.0, 730, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": " self.info(\"Started test suite '%s'\" % suite.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99901:FunctionDef_L39_C4", "label": "end_suite", "type": "function", "loc": [39, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99901:ClassDef_L20_C0", "vector": [2, 1, 0.681, 0.0345, 1, 0.93, 0.4, 81, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "end_suite", "arg_names": ["self", "suite"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end_suite(self, suite):\n self.info(\"Ended test suite '%s'\" % suite.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99901:Expr_L40_C8", "label": "info()", "type": "expression", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99901:FunctionDef_L39_C4", "vector": [8, 2, 0.6897, 0.0172, 2, 0.78, 0.0, 730, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": " self.info(\"Ended test suite '%s'\" % suite.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99901:FunctionDef_L42_C4", "label": "start_test", "type": "function", "loc": [42, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99901:ClassDef_L20_C0", "vector": [2, 1, 0.7328, 0.0345, 1, 0.93, 0.5, 246, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "start_test", "arg_names": ["self", "test"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start_test(self, test):\n self.info(\"Started test case '%s'\" % test.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99901:Expr_L43_C8", "label": "info()", "type": "expression", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99901:FunctionDef_L42_C4", "vector": [8, 2, 0.7414, 0.0172, 2, 0.42, 0.0, 730, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": " self.info(\"Started test case '%s'\" % test.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99901:FunctionDef_L45_C4", "label": "end_test", "type": "function", "loc": [45, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99901:ClassDef_L20_C0", "vector": [2, 1, 0.7845, 0.0345, 1, 0.93, 0.6, 220, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "end_test", "arg_names": ["self", "test"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end_test(self, test):\n self.info(\"Ended test case '%s'\" % test.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99901:Expr_L46_C8", "label": "info()", "type": "expression", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99901:FunctionDef_L45_C4", "vector": [8, 2, 0.7931, 0.0172, 2, 0.29, 0.0, 730, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": " self.info(\"Ended test case '%s'\" % test.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99901:FunctionDef_L48_C4", "label": "start_keyword", "type": "function", "loc": [48, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99901:ClassDef_L20_C0", "vector": [2, 1, 0.8362, 0.0345, 1, 0.93, 0.7, 776, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "start_keyword", "arg_names": ["self", "kw"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start_keyword(self, kw):\n self.debug(\"Started keyword '%s'\" % kw.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99901:Expr_L49_C8", "label": "debug()", "type": "expression", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99901:FunctionDef_L48_C4", "vector": [8, 2, 0.8448, 0.0172, 2, 0.59, 0.0, 924, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "debug", "arg_names": [], "import_names": [], "rhs_call_name": "debug", "annotation": ""}, "snippet": " self.debug(\"Started keyword '%s'\" % kw.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99901:FunctionDef_L51_C4", "label": "end_keyword", "type": "function", "loc": [51, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99901:ClassDef_L20_C0", "vector": [2, 1, 0.8879, 0.0345, 1, 0.93, 0.8, 959, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "end_keyword", "arg_names": ["self", "kw"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end_keyword(self, kw):\n self.debug(\"Ended keyword '%s'\" % kw.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99901:Expr_L52_C8", "label": "debug()", "type": "expression", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99901:FunctionDef_L51_C4", "vector": [8, 2, 0.8966, 0.0172, 2, 0.08, 0.0, 924, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "debug", "arg_names": [], "import_names": [], "rhs_call_name": "debug", "annotation": ""}, "snippet": " self.debug(\"Ended keyword '%s'\" % kw.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99901:FunctionDef_L54_C4", "label": "output_file", "type": "function", "loc": [54, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99901:ClassDef_L20_C0", "vector": [2, 1, 0.9397, 0.0345, 1, 0.93, 0.9, 395, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "output_file", "arg_names": ["self", "name", "path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def output_file(self, name, path):\n self.info('%s: %s' % (name, path))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99901:Expr_L55_C8", "label": "info()", "type": "expression", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99901:FunctionDef_L54_C4", "vector": [8, 2, 0.9483, 0.0172, 2, 0.92, 0.0, 730, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": " self.info('%s: %s' % (name, path))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99901:FunctionDef_L57_C4", "label": "close", "type": "function", "loc": [57, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99901:ClassDef_L20_C0", "vector": [2, 1, 0.9914, 0.0345, 1, 0.93, 1.0, 77, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def close(self):\n self._writer.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99901:Expr_L58_C8", "label": "close()", "type": "expression", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99901:FunctionDef_L57_C4", "vector": [8, 2, 1.0, 0.0172, 2, 0.76, 0.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " self._writer.close()"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99901:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99901:FunctionDef_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99901:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99901:Expr_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99901:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99901:Assign_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99901:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99901:FunctionDef_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99901:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99901:Return_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99901:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99901:FunctionDef_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99901:FunctionDef_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99901:If_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99901:If_L31_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99901:Assign_L32_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99901:If_L31_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99901:Expr_L34_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99901:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99901:FunctionDef_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99901:FunctionDef_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99901:Expr_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99901:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99901:FunctionDef_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99901:FunctionDef_L39_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99901:Expr_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99901:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99901:FunctionDef_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99901:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99901:Expr_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99901:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99901:FunctionDef_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99901:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99901:Expr_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99901:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99901:FunctionDef_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99901:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99901:Expr_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99901:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99901:FunctionDef_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99901:FunctionDef_L51_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99901:Expr_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99901:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99901:FunctionDef_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99901:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99901:Expr_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99901:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99901:FunctionDef_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99901:FunctionDef_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99901:Expr_L58_C8"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from robot import utils
from logger import LOGGER
from loggerhelper import IsLogged
def DebugFile(path):
if path == 'NONE':
LOGGER.info('No debug file')
return None
try:
LOGGER.info('Debug file: %s' % path)
return _DebugFileWriter(path)
except:
LOGGER.error("Opening debug file '%s' failed and writing to debug file "
"is disabled. Error: %s" % (path, utils.get_error_message()))
return None
class _DebugFileWriter:
_separators = {'SUITE': '=', 'TEST': '-', 'KW': '~'}
def __init__(self, path):
self._indent = 0
self._kw_level = 0
self._separator_written_last = False
self._file = open(path, 'wb')
self._is_logged = IsLogged('DEBUG')
def start_suite(self, suite):
self._separator('SUITE')
self._start('SUITE', suite.longname)
self._separator('SUITE')
def end_suite(self, suite):
self._separator('SUITE')
self._end('SUITE', suite.longname, suite.elapsedtime)
self._separator('SUITE')
if self._indent == 0:
LOGGER.output_file('Debug', self._file.name)
self.close()
def start_test(self, test):
self._separator('TEST')
self._start('TEST', test.name)
self._separator('TEST')
def end_test(self, test):
self._separator('TEST')
self._end('TEST', test.name, test.elapsedtime)
self._separator('TEST')
def start_keyword(self, kw):
if self._kw_level == 0:
self._separator('KW')
self._start(self._get_kw_type(kw), kw.name, kw.args)
self._kw_level += 1
def end_keyword(self, kw):
self._end(self._get_kw_type(kw), kw.name, kw.elapsedtime)
self._kw_level -= 1
def log_message(self, msg):
if self._is_logged(msg.level):
self._write(msg.message)
def close(self):
if not self._file.closed:
self._file.close()
def _get_kw_type(self, kw):
if kw.type in ['setup','teardown']:
return kw.type.upper()
return 'KW'
def _start(self, type_, name, args=''):
args = ' ' + utils.seq2str2(args)
self._write('+%s START %s: %s%s' % ('-'*self._indent, type_, name, args))
self._indent += 1
def _end(self, type_, name, elapsed):
self._indent -= 1
self._write('+%s END %s: %s (%s)' % ('-'*self._indent, type_, name, elapsed))
def _separator(self, type_):
self._write(self._separators[type_] * 78, True)
def _write(self, text, separator=False):
if self._separator_written_last and separator:
return
self._file.write(utils.unic(text).encode('UTF-8').rstrip() + '\n')
self._file.flush()
self._separator_written_last = separator
| ajibawa-2023/Python-Code-Large/train/row_99902 | 68 | 109 | 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_99902:ImportFrom_L16_C0", "label": "from robot import utils", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.1468, 0.0092, 0, 0.66, 0.0, 735, 0, 1, 0, 0, 735, 0, 0], "semantic": {"name": "robot", "arg_names": [], "import_names": ["utils"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot import utils"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99902:ImportFrom_L18_C0", "label": "from logger import LOGGER", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.1651, 0.0092, 0, 0.66, 0.25, 532, 0, 1, 0, 0, 532, 0, 0], "semantic": {"name": "logger", "arg_names": [], "import_names": ["LOGGER"], "rhs_call_name": "", "annotation": ""}, "snippet": "from logger import LOGGER"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99902:ImportFrom_L19_C0", "label": "from loggerhelper import IsLogged", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.1743, 0.0092, 0, 0.66, 0.5, 426, 0, 1, 0, 0, 426, 0, 0], "semantic": {"name": "loggerhelper", "arg_names": [], "import_names": ["IsLogged"], "rhs_call_name": "", "annotation": ""}, "snippet": "from loggerhelper import IsLogged"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L22_C0", "label": "DebugFile", "type": "function", "loc": [22, 32], "level": 0, "parent": null, "vector": [2, 0, 0.2477, 0.1009, 0, 0.66, 0.75, 8, 0, 1, 1, 0, 0, 0, 5], "semantic": {"name": "DebugFile", "arg_names": ["path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def DebugFile(path):\n if path == 'NONE':\n LOGGER.info('No debug file')\n return None\n try:\n LOGGER.info('Debug file: %s' % path)\n return _DebugFileWriter(path)\n except:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99902:If_L23_C4", "label": "if", "type": "if", "loc": [23, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L22_C0", "vector": [4, 1, 0.2202, 0.0275, 1, 0.9, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if path == 'NONE':\n LOGGER.info('No debug file')\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99902:Expr_L24_C8", "label": "info()", "type": "expression", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99902:If_L23_C4", "vector": [8, 2, 0.2202, 0.0092, 2, 0.69, 0.0, 730, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": " LOGGER.info('No debug file')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99902:Return_L25_C8", "label": "return", "type": "return", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99902:If_L23_C4", "vector": [13, 2, 0.2294, 0.0092, 2, 0.69, 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_99902:Try_L26_C4", "label": "try", "type": "try", "loc": [26, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L22_C0", "vector": [7, 1, 0.2661, 0.0642, 1, 0.9, 1.0, 0, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n LOGGER.info('Debug file: %s' % path)\n return _DebugFileWriter(path)\n except:\n LOGGER.error(\"Opening debug file '%s' failed and writing to debug file \"\n \"is disabled. Error: %s\" % (path, utils.get_error_message()))\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99902:Expr_L27_C8", "label": "info()", "type": "expression", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99902:Try_L26_C4", "vector": [8, 2, 0.2477, 0.0092, 2, 0.71, 0.0, 730, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": " LOGGER.info('Debug file: %s' % path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99902:Return_L28_C8", "label": "return", "type": "return", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99902:Try_L26_C4", "vector": [13, 2, 0.2569, 0.0092, 2, 0.71, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return _DebugFileWriter(path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99902:Expr_L30_C8", "label": "error()", "type": "expression", "loc": [30, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99902:Try_L26_C4", "vector": [8, 2, 0.2798, 0.0183, 2, 0.71, 0.0, 771, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "error", "arg_names": [], "import_names": [], "rhs_call_name": "error", "annotation": ""}, "snippet": " LOGGER.error(\"Opening debug file '%s' failed and writing to debug file \"\n \"is disabled. Error: %s\" % (path, utils.get_error_message()))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99902:Return_L32_C8", "label": "return", "type": "return", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99902:Try_L26_C4", "vector": [13, 2, 0.2936, 0.0092, 2, 0.71, 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_99902:ClassDef_L35_C0", "label": "_DebugFileWriter", "type": "class", "loc": [35, 109], "level": 0, "parent": null, "vector": [3, 0, 0.6606, 0.6881, 0, 0.66, 1.0, 819, 0, 14, 0, 0, 0, 0, 34], "semantic": {"name": "_DebugFileWriter", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _DebugFileWriter:\n\n _separators = {'SUITE': '=', 'TEST': '-', 'KW': '~'}\n\n def __init__(self, path):\n self._indent = 0\n self._kw_level = 0\n self._separator_written_last = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99902:Assign_L37_C4", "label": "_separators =", "type": "assigned_variable", "loc": [37, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99902:ClassDef_L35_C0", "vector": [14, 1, 0.3394, 0.0092, 1, 0.34, 0.0, 541, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "_separators", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _separators = {'SUITE': '=', 'TEST': '-', 'KW': '~'}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L39_C4", "label": "__init__", "type": "function", "loc": [39, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99902:ClassDef_L35_C0", "vector": [2, 1, 0.3807, 0.055, 1, 0.34, 0.0714, 555, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, path):\n self._indent = 0\n self._kw_level = 0\n self._separator_written_last = False\n self._file = open(path, 'wb')\n self._is_logged = IsLogged('DEBUG')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99902:Assign_L40_C8", "label": "self._indent =", "type": "assigned_variable", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L39_C4", "vector": [14, 2, 0.367, 0.0092, 2, 0.54, 0.0, 765, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self._indent", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._indent = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99902:Assign_L41_C8", "label": "self._kw_level =", "type": "assigned_variable", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L39_C4", "vector": [14, 2, 0.3761, 0.0092, 2, 0.54, 0.25, 982, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self._kw_level", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._kw_level = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99902:Assign_L42_C8", "label": "self._separator_written_last =", "type": "assigned_variable", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L39_C4", "vector": [14, 2, 0.3853, 0.0092, 2, 0.54, 0.5, 82, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self._separator_written_last", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._separator_written_last = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99902:Assign_L43_C8", "label": "self._file = open()", "type": "assigned_variable", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L39_C4", "vector": [14, 2, 0.3945, 0.0092, 2, 0.54, 0.75, 852, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "self._file", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": " self._file = open(path, 'wb')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99902:Assign_L44_C8", "label": "self._is_logged = IsLogged()", "type": "assigned_variable", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L39_C4", "vector": [14, 2, 0.4037, 0.0092, 2, 0.54, 1.0, 427, 3, 1, 0, 0, 467, 10, 1], "semantic": {"name": "self._is_logged", "arg_names": [], "import_names": [], "rhs_call_name": "IsLogged", "annotation": ""}, "snippet": " self._is_logged = IsLogged('DEBUG')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L46_C4", "label": "start_suite", "type": "function", "loc": [46, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99902:ClassDef_L35_C0", "vector": [2, 1, 0.4358, 0.0367, 1, 0.34, 0.1429, 38, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "start_suite", "arg_names": ["self", "suite"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start_suite(self, suite):\n self._separator('SUITE')\n self._start('SUITE', suite.longname)\n self._separator('SUITE')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99902:Expr_L47_C8", "label": "_separator()", "type": "expression", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L46_C4", "vector": [8, 2, 0.4312, 0.0092, 2, 0.76, 0.0, 23, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_separator", "arg_names": [], "import_names": [], "rhs_call_name": "_separator", "annotation": ""}, "snippet": " self._separator('SUITE')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99902:Expr_L48_C8", "label": "_start()", "type": "expression", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L46_C4", "vector": [8, 2, 0.4404, 0.0092, 2, 0.76, 0.5, 212, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_start", "arg_names": [], "import_names": [], "rhs_call_name": "_start", "annotation": ""}, "snippet": " self._start('SUITE', suite.longname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99902:Expr_L49_C8", "label": "_separator()", "type": "expression", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L46_C4", "vector": [8, 2, 0.4495, 0.0092, 2, 0.76, 1.0, 23, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_separator", "arg_names": [], "import_names": [], "rhs_call_name": "_separator", "annotation": ""}, "snippet": " self._separator('SUITE')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L51_C4", "label": "end_suite", "type": "function", "loc": [51, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99902:ClassDef_L35_C0", "vector": [2, 1, 0.4954, 0.0642, 1, 0.34, 0.2143, 81, 0, 2, 0, 0, 0, 0, 5], "semantic": {"name": "end_suite", "arg_names": ["self", "suite"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end_suite(self, suite):\n self._separator('SUITE')\n self._end('SUITE', suite.longname, suite.elapsedtime)\n self._separator('SUITE')\n if self._indent == 0:\n LOGGER.output_file('Debug', self._file.name)\n self.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99902:Expr_L52_C8", "label": "_separator()", "type": "expression", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L51_C4", "vector": [8, 2, 0.4771, 0.0092, 2, 0.66, 0.0, 23, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_separator", "arg_names": [], "import_names": [], "rhs_call_name": "_separator", "annotation": ""}, "snippet": " self._separator('SUITE')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99902:Expr_L53_C8", "label": "_end()", "type": "expression", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L51_C4", "vector": [8, 2, 0.4862, 0.0092, 2, 0.66, 0.3333, 964, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "_end", "arg_names": [], "import_names": [], "rhs_call_name": "_end", "annotation": ""}, "snippet": " self._end('SUITE', suite.longname, suite.elapsedtime)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99902:Expr_L54_C8", "label": "_separator()", "type": "expression", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L51_C4", "vector": [8, 2, 0.4954, 0.0092, 2, 0.66, 0.6667, 23, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_separator", "arg_names": [], "import_names": [], "rhs_call_name": "_separator", "annotation": ""}, "snippet": " self._separator('SUITE')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99902:If_L55_C8", "label": "if", "type": "if", "loc": [55, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L51_C4", "vector": [4, 2, 0.5138, 0.0275, 2, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._indent == 0:\n LOGGER.output_file('Debug', self._file.name)\n self.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99902:Expr_L56_C12", "label": "output_file()", "type": "expression", "loc": [56, 56], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99902:If_L55_C8", "vector": [8, 3, 0.5138, 0.0092, 3, 0.98, 0.0, 395, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "output_file", "arg_names": [], "import_names": [], "rhs_call_name": "output_file", "annotation": ""}, "snippet": " LOGGER.output_file('Debug', self._file.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99902:Expr_L57_C12", "label": "close()", "type": "expression", "loc": [57, 57], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99902:If_L55_C8", "vector": [8, 3, 0.5229, 0.0092, 3, 0.98, 1.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " self.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L59_C4", "label": "start_test", "type": "function", "loc": [59, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99902:ClassDef_L35_C0", "vector": [2, 1, 0.555, 0.0367, 1, 0.34, 0.2857, 246, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "start_test", "arg_names": ["self", "test"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start_test(self, test):\n self._separator('TEST')\n self._start('TEST', test.name)\n self._separator('TEST')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99902:Expr_L60_C8", "label": "_separator()", "type": "expression", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L59_C4", "vector": [8, 2, 0.5505, 0.0092, 2, 0.52, 0.0, 23, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_separator", "arg_names": [], "import_names": [], "rhs_call_name": "_separator", "annotation": ""}, "snippet": " self._separator('TEST')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99902:Expr_L61_C8", "label": "_start()", "type": "expression", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L59_C4", "vector": [8, 2, 0.5596, 0.0092, 2, 0.52, 0.5, 212, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_start", "arg_names": [], "import_names": [], "rhs_call_name": "_start", "annotation": ""}, "snippet": " self._start('TEST', test.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99902:Expr_L62_C8", "label": "_separator()", "type": "expression", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L59_C4", "vector": [8, 2, 0.5688, 0.0092, 2, 0.52, 1.0, 23, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_separator", "arg_names": [], "import_names": [], "rhs_call_name": "_separator", "annotation": ""}, "snippet": " self._separator('TEST')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L64_C4", "label": "end_test", "type": "function", "loc": [64, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99902:ClassDef_L35_C0", "vector": [2, 1, 0.6009, 0.0367, 1, 0.34, 0.3571, 220, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "end_test", "arg_names": ["self", "test"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end_test(self, test):\n self._separator('TEST')\n self._end('TEST', test.name, test.elapsedtime)\n self._separator('TEST')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99902:Expr_L65_C8", "label": "_separator()", "type": "expression", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L64_C4", "vector": [8, 2, 0.5963, 0.0092, 2, 0.36, 0.0, 23, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_separator", "arg_names": [], "import_names": [], "rhs_call_name": "_separator", "annotation": ""}, "snippet": " self._separator('TEST')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99902:Expr_L66_C8", "label": "_end()", "type": "expression", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L64_C4", "vector": [8, 2, 0.6055, 0.0092, 2, 0.36, 0.5, 964, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "_end", "arg_names": [], "import_names": [], "rhs_call_name": "_end", "annotation": ""}, "snippet": " self._end('TEST', test.name, test.elapsedtime)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99902:Expr_L67_C8", "label": "_separator()", "type": "expression", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L64_C4", "vector": [8, 2, 0.6147, 0.0092, 2, 0.36, 1.0, 23, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_separator", "arg_names": [], "import_names": [], "rhs_call_name": "_separator", "annotation": ""}, "snippet": " self._separator('TEST')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L69_C4", "label": "start_keyword", "type": "function", "loc": [69, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99902:ClassDef_L35_C0", "vector": [2, 1, 0.6514, 0.0459, 1, 0.34, 0.4286, 776, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "start_keyword", "arg_names": ["self", "kw"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start_keyword(self, kw):\n if self._kw_level == 0:\n self._separator('KW')\n self._start(self._get_kw_type(kw), kw.name, kw.args)\n self._kw_level += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99902:If_L70_C8", "label": "if", "type": "if", "loc": [70, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L69_C4", "vector": [4, 2, 0.6468, 0.0183, 2, 0.38, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._kw_level == 0:\n self._separator('KW')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99902:Expr_L71_C12", "label": "_separator()", "type": "expression", "loc": [71, 71], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99902:If_L70_C8", "vector": [8, 3, 0.6514, 0.0092, 3, 0.66, 0.0, 23, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_separator", "arg_names": [], "import_names": [], "rhs_call_name": "_separator", "annotation": ""}, "snippet": " self._separator('KW')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99902:Expr_L72_C8", "label": "_start()", "type": "expression", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L69_C4", "vector": [8, 2, 0.6606, 0.0092, 2, 0.38, 1.0, 212, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "_start", "arg_names": [], "import_names": [], "rhs_call_name": "_start", "annotation": ""}, "snippet": " self._start(self._get_kw_type(kw), kw.name, kw.args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L75_C4", "label": "end_keyword", "type": "function", "loc": [75, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99902:ClassDef_L35_C0", "vector": [2, 1, 0.6972, 0.0275, 1, 0.34, 0.5, 959, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "end_keyword", "arg_names": ["self", "kw"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end_keyword(self, kw):\n self._end(self._get_kw_type(kw), kw.name, kw.elapsedtime)\n self._kw_level -= 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99902:Expr_L76_C8", "label": "_end()", "type": "expression", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L75_C4", "vector": [8, 2, 0.6972, 0.0092, 2, 0.19, 0.0, 964, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "_end", "arg_names": [], "import_names": [], "rhs_call_name": "_end", "annotation": ""}, "snippet": " self._end(self._get_kw_type(kw), kw.name, kw.elapsedtime)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L79_C4", "label": "log_message", "type": "function", "loc": [79, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99902:ClassDef_L35_C0", "vector": [2, 1, 0.7339, 0.0275, 1, 0.34, 0.5714, 87, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "log_message", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def log_message(self, msg):\n if self._is_logged(msg.level):\n self._write(msg.message)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99902:If_L80_C8", "label": "if", "type": "if", "loc": [80, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L79_C4", "vector": [4, 2, 0.7385, 0.0183, 2, 0.43, 0.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._is_logged(msg.level):\n self._write(msg.message)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99902:Expr_L81_C12", "label": "_write()", "type": "expression", "loc": [81, 81], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99902:If_L80_C8", "vector": [8, 3, 0.7431, 0.0092, 3, 0.08, 0.0, 961, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_write", "arg_names": [], "import_names": [], "rhs_call_name": "_write", "annotation": ""}, "snippet": " self._write(msg.message)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L83_C4", "label": "close", "type": "function", "loc": [83, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99902:ClassDef_L35_C0", "vector": [2, 1, 0.7706, 0.0275, 1, 0.34, 0.6429, 77, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def close(self):\n if not self._file.closed:\n self._file.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99902:If_L84_C8", "label": "if", "type": "if", "loc": [84, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L83_C4", "vector": [4, 2, 0.7752, 0.0183, 2, 0.64, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self._file.closed:\n self._file.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99902:Expr_L85_C12", "label": "close()", "type": "expression", "loc": [85, 85], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99902:If_L84_C8", "vector": [8, 3, 0.7798, 0.0092, 3, 0.2, 0.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " self._file.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L87_C4", "label": "_get_kw_type", "type": "function", "loc": [87, 90], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99902:ClassDef_L35_C0", "vector": [2, 1, 0.8119, 0.0367, 1, 0.34, 0.7143, 25, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "_get_kw_type", "arg_names": ["self", "kw"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_kw_type(self, kw):\n if kw.type in ['setup','teardown']:\n return kw.type.upper()\n return 'KW'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99902:If_L88_C8", "label": "if", "type": "if", "loc": [88, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L87_C4", "vector": [4, 2, 0.8119, 0.0183, 2, 0.47, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if kw.type in ['setup','teardown']:\n return kw.type.upper()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99902:Return_L89_C12", "label": "return", "type": "return", "loc": [89, 89], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99902:If_L88_C8", "vector": [13, 3, 0.8165, 0.0092, 3, 0.82, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return kw.type.upper()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99902:Return_L90_C8", "label": "return", "type": "return", "loc": [90, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L87_C4", "vector": [13, 2, 0.8257, 0.0092, 2, 0.47, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'KW'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L92_C4", "label": "_start", "type": "function", "loc": [92, 95], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99902:ClassDef_L35_C0", "vector": [2, 1, 0.8578, 0.0367, 1, 0.34, 0.7857, 212, 0, 4, 0, 0, 0, 0, 2], "semantic": {"name": "_start", "arg_names": ["self", "type_", "name", "args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _start(self, type_, name, args=''):\n args = ' ' + utils.seq2str2(args)\n self._write('+%s START %s: %s%s' % ('-'*self._indent, type_, name, args))\n self._indent += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99902:Assign_L93_C8", "label": "args =", "type": "assigned_variable", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L92_C4", "vector": [14, 2, 0.8532, 0.0092, 2, 0.96, 0.0, 805, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "args", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " args = ' ' + utils.seq2str2(args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99902:Expr_L94_C8", "label": "_write()", "type": "expression", "loc": [94, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L92_C4", "vector": [8, 2, 0.8624, 0.0092, 2, 0.96, 1.0, 961, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_write", "arg_names": [], "import_names": [], "rhs_call_name": "_write", "annotation": ""}, "snippet": " self._write('+%s START %s: %s%s' % ('-'*self._indent, type_, name, args))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L97_C4", "label": "_end", "type": "function", "loc": [97, 99], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99902:ClassDef_L35_C0", "vector": [2, 1, 0.8991, 0.0275, 1, 0.34, 0.8571, 964, 0, 4, 0, 0, 0, 0, 1], "semantic": {"name": "_end", "arg_names": ["self", "type_", "name", "elapsed"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _end(self, type_, name, elapsed):\n self._indent -= 1\n self._write('+%s END %s: %s (%s)' % ('-'*self._indent, type_, name, elapsed))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99902:Expr_L99_C8", "label": "_write()", "type": "expression", "loc": [99, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L97_C4", "vector": [8, 2, 0.9083, 0.0092, 2, 0.01, 0.0, 961, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_write", "arg_names": [], "import_names": [], "rhs_call_name": "_write", "annotation": ""}, "snippet": " self._write('+%s END %s: %s (%s)' % ('-'*self._indent, type_, name, elapsed))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L101_C4", "label": "_separator", "type": "function", "loc": [101, 102], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99902:ClassDef_L35_C0", "vector": [2, 1, 0.9312, 0.0183, 1, 0.34, 0.9286, 23, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_separator", "arg_names": ["self", "type_"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _separator(self, type_):\n self._write(self._separators[type_] * 78, True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99902:Expr_L102_C8", "label": "_write()", "type": "expression", "loc": [102, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L101_C4", "vector": [8, 2, 0.9358, 0.0092, 2, 0.72, 0.0, 961, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_write", "arg_names": [], "import_names": [], "rhs_call_name": "_write", "annotation": ""}, "snippet": " self._write(self._separators[type_] * 78, True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L104_C4", "label": "_write", "type": "function", "loc": [104, 109], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99902:ClassDef_L35_C0", "vector": [2, 1, 0.9771, 0.055, 1, 0.34, 1.0, 961, 0, 3, 0, 0, 0, 0, 5], "semantic": {"name": "_write", "arg_names": ["self", "text", "separator"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _write(self, text, separator=False):\n if self._separator_written_last and separator:\n return\n self._file.write(utils.unic(text).encode('UTF-8').rstrip() + '\\n')\n self._file.flush()\n self._separator_written_last = separator"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99902:If_L105_C8", "label": "if", "type": "if", "loc": [105, 106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L104_C4", "vector": [4, 2, 0.9679, 0.0183, 2, 0.71, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._separator_written_last and separator:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99902:Return_L106_C12", "label": "return", "type": "return", "loc": [106, 106], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99902:If_L105_C8", "vector": [13, 3, 0.9725, 0.0092, 3, 0.45, 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_99902:Expr_L107_C8", "label": "write()", "type": "expression", "loc": [107, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L104_C4", "vector": [8, 2, 0.9817, 0.0092, 2, 0.71, 0.3333, 837, 3, 1, 0, 0, 0, 0, 4], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " self._file.write(utils.unic(text).encode('UTF-8').rstrip() + '\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99902:Expr_L108_C8", "label": "flush()", "type": "expression", "loc": [108, 108], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L104_C4", "vector": [8, 2, 0.9908, 0.0092, 2, 0.71, 0.6667, 439, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "flush", "arg_names": [], "import_names": [], "rhs_call_name": "flush", "annotation": ""}, "snippet": " self._file.flush()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99902:Assign_L109_C8", "label": "self._separator_written_last =", "type": "assigned_variable", "loc": [109, 109], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L104_C4", "vector": [14, 2, 1.0, 0.0092, 2, 0.71, 1.0, 82, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._separator_written_last", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._separator_written_last = separator"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99902:If_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99902:If_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99902:Expr_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99902:If_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99902:Return_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99902:Try_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99902:Try_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99902:Expr_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99902:Try_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99902:Return_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99902:Try_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99902:Expr_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99902:Try_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99902:Return_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99902:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99902:Assign_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99902:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L39_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99902:Assign_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L39_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99902:Assign_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L39_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99902:Assign_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L39_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99902:Assign_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L39_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99902:Assign_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99902:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99902:Expr_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99902:Expr_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99902:Expr_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99902:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L51_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99902:Expr_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L51_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99902:Expr_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L51_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99902:Expr_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L51_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99902:If_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99902:If_L55_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99902:Expr_L56_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99902:If_L55_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99902:Expr_L57_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99902:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99902:Expr_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99902:Expr_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99902:Expr_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99902:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L64_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99902:Expr_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99902:Expr_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99902:Expr_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99902:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99902:If_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99902:If_L70_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99902:Expr_L71_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99902:Expr_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99902:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99902:Expr_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99902:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L79_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L79_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99902:If_L80_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99902:If_L80_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99902:Expr_L81_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99902:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L83_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99902:If_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99902:If_L84_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99902:Expr_L85_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99902:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L87_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99902:If_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99902:If_L88_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99902:Return_L89_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99902:Return_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99902:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L92_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99902:Assign_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99902:Expr_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99902:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L97_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99902:Expr_L99_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99902:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L101_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L101_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99902:Expr_L102_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99902:ClassDef_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L104_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99902:If_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99902:If_L105_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99902:Return_L106_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99902:Expr_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99902:Expr_L108_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99902:FunctionDef_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99902:Assign_L109_C8"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import inspect
import sys
from robot import utils
from robot.errors import DataError
from loggerhelper import AbstractLoggerProxy
from logger import LOGGER
if utils.is_jython:
from java.lang import Object
from java.util import HashMap
class Listeners:
_start_attrs = ['doc', 'starttime', 'longname']
_end_attrs = _start_attrs + ['endtime', 'elapsedtime', 'status', 'message']
def __init__(self, listeners):
self._listeners = self._import_listeners(listeners)
self._running_test = False
self._setup_or_teardown_type = None
def __nonzero__(self):
return bool(self._listeners)
def _import_listeners(self, listener_data):
listeners = []
for name, args in listener_data:
try:
listeners.append(_ListenerProxy(name, args))
except:
message, details = utils.get_error_details()
if args:
name += ':' + ':'.join(args)
LOGGER.error("Taking listener '%s' into use failed: %s"
% (name, message))
LOGGER.info("Details:\n%s" % details)
return listeners
def start_suite(self, suite):
for li in self._listeners:
if li.version == 1:
li.call_method(li.start_suite, suite.name, suite.doc)
else:
attrs = self._get_start_attrs(suite, 'metadata')
attrs.update({'tests' : [t.name for t in suite.tests ],
'suites': [s.name for s in suite.suites],
'totaltests': suite.get_test_count()})
li.call_method(li.start_suite, suite.name, attrs)
def end_suite(self, suite):
for li in self._listeners:
if li.version == 1:
li.call_method(li.end_suite, suite.status,
suite.get_full_message())
else:
attrs = self._get_end_attrs(suite)
attrs.update({'statistics': suite.get_stat_message()})
li.call_method(li.end_suite, suite.name, attrs)
def start_test(self, test):
self._running_test = True
for li in self._listeners:
if li.version == 1:
li.call_method(li.start_test, test.name, test.doc, test.tags)
else:
attrs = self._get_start_attrs(test, 'tags')
li.call_method(li.start_test, test.name, attrs)
def end_test(self, test):
self._running_test = False
for li in self._listeners:
if li.version == 1:
li.call_method(li.end_test, test.status, test.message)
else:
attrs = self._get_end_attrs(test, 'tags')
li.call_method(li.end_test, test.name, attrs)
def start_keyword(self, kw):
for li in self._listeners:
if li.version == 1:
li.call_method(li.start_keyword, kw.name, kw.args)
else:
attrs = self._get_start_attrs(kw, 'args', '-longname')
attrs['type'] = self._get_keyword_type(kw, start=True)
li.call_method(li.start_keyword, kw.name, attrs)
def end_keyword(self, kw):
for li in self._listeners:
if li.version == 1:
li.call_method(li.end_keyword, kw.status)
else:
attrs = self._get_end_attrs(kw, 'args', '-longname', '-message')
attrs['type'] = self._get_keyword_type(kw, start=False)
li.call_method(li.end_keyword, kw.name, attrs)
def _get_keyword_type(self, kw, start=True):
# When running setup or teardown, only the top level keyword has type
# set to setup/teardown but we want to pass that type also to all
# start/end_keyword listener methods called below that keyword.
if kw.type == 'kw':
return self._setup_or_teardown_type or 'Keyword'
kw_type = self._get_setup_or_teardown_type(kw)
self._setup_or_teardown_type = kw_type if start else None
return kw_type
def _get_setup_or_teardown_type(self, kw):
return '%s %s' % (('Test' if self._running_test else 'Suite'),
kw.type.title())
def log_message(self, msg):
for li in self._listeners:
if li.version == 2:
li.call_method(li.log_message, self._create_msg_dict(msg))
def message(self, msg):
for li in self._listeners:
if li.version == 2:
li.call_method(li.message, self._create_msg_dict(msg))
def _create_msg_dict(self, msg):
return {'timestamp': msg.timestamp, 'message': msg.message,
'level': msg.level, 'html': 'yes' if msg.html else 'no'}
def output_file(self, name, path):
for li in self._listeners:
li.call_method(getattr(li, '%s_file' % name.lower()), path)
def close(self):
for li in self._listeners:
li.call_method(li.close)
def _get_start_attrs(self, item, *names):
return self._get_attrs(item, self._start_attrs, names)
def _get_end_attrs(self, item, *names):
return self._get_attrs(item, self._end_attrs, names)
def _get_attrs(self, item, defaults, extras):
names = self._get_attr_names(defaults, extras)
return dict((n, self._get_attr_value(item, n)) for n in names)
def _get_attr_names(self, defaults, extras):
names = list(defaults)
for name in extras:
if name.startswith('-'):
names.remove(name[1:])
else:
names.append(name)
return names
def _get_attr_value(self, item, name):
value = getattr(item, name)
return self._take_copy_of_mutable_value(value)
def _take_copy_of_mutable_value(self, value):
if isinstance(value, (dict, utils.NormalizedDict)):
return dict(value)
if isinstance(value, list):
return list(value)
return value
class _ListenerProxy(AbstractLoggerProxy):
_methods = ['start_suite', 'end_suite', 'start_test', 'end_test',
'start_keyword', 'end_keyword', 'log_message', 'message',
'output_file', 'report_file', 'log_file', 'debug_file',
'xunit_file', 'close']
def __init__(self, name, args):
listener = self._import_listener(name, args)
AbstractLoggerProxy.__init__(self, listener)
self.name = name
self.version = self._get_version(listener)
self.is_java = utils.is_jython and isinstance(listener, Object)
self._failed = []
def _import_listener(self, name, args):
listener, source = utils.import_(name, 'listener')
if not inspect.ismodule(listener):
listener = listener(*args)
elif args:
raise DataError("Listeners implemented as modules do not take arguments")
LOGGER.info("Imported listener '%s' with arguments %s (source %s)"
% (name, utils.seq2str2(args), source))
return listener
def _get_version(self, listener):
try:
return int(getattr(listener, 'ROBOT_LISTENER_API_VERSION', 1))
except ValueError:
return 1
def call_method(self, method, *args):
if method in self._failed:
return
if self.is_java:
args = [self._to_map(a) if isinstance(a, dict) else a for a in args]
try:
method(*args)
except:
self._failed.append(method)
self._report_error(method)
def _report_error(self, method):
message, details = utils.get_error_details()
LOGGER.error("Method '%s' of listener '%s' failed and is disabled: %s"
% (method.__name__, self.name, message))
LOGGER.info("Details:\n%s" % details)
def _to_map(self, dictionary):
map = HashMap()
for key, value in dictionary.iteritems():
map.put(key, value)
return map
| ajibawa-2023/Python-Code-Large/train/row_99903 | 155 | 229 | 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_99903:Import_L15_C0", "label": "inspect import inspect", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.0655, 0.0044, 0, 0.66, 0.0, 878, 0, 1, 0, 0, 878, 0, 0], "semantic": {"name": "inspect", "arg_names": [], "import_names": ["inspect"], "rhs_call_name": "", "annotation": ""}, "snippet": "import inspect"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Import_L16_C0", "label": "sys import sys", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.0699, 0.0044, 0, 0.66, 0.125, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:ImportFrom_L18_C0", "label": "from robot import utils", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.0786, 0.0044, 0, 0.66, 0.25, 735, 0, 1, 0, 0, 735, 0, 0], "semantic": {"name": "robot", "arg_names": [], "import_names": ["utils"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot import utils"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:ImportFrom_L19_C0", "label": "from robot.errors import DataError", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.083, 0.0044, 0, 0.66, 0.375, 299, 0, 1, 0, 0, 299, 0, 0], "semantic": {"name": "robot.errors", "arg_names": [], "import_names": ["DataError"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot.errors import DataError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:ImportFrom_L20_C0", "label": "from loggerhelper import AbstractLoggerProxy", "type": "import", "loc": [20, 20], "level": 0, "parent": null, "vector": [1, 0, 0.0873, 0.0044, 0, 0.66, 0.5, 426, 0, 1, 0, 0, 426, 0, 0], "semantic": {"name": "loggerhelper", "arg_names": [], "import_names": ["AbstractLoggerProxy"], "rhs_call_name": "", "annotation": ""}, "snippet": "from loggerhelper import AbstractLoggerProxy"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:ImportFrom_L21_C0", "label": "from logger import LOGGER", "type": "import", "loc": [21, 21], "level": 0, "parent": null, "vector": [1, 0, 0.0917, 0.0044, 0, 0.66, 0.625, 532, 0, 1, 0, 0, 532, 0, 0], "semantic": {"name": "logger", "arg_names": [], "import_names": ["LOGGER"], "rhs_call_name": "", "annotation": ""}, "snippet": "from logger import LOGGER"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L23_C0", "label": "if", "type": "if", "loc": [23, 25], "level": 0, "parent": null, "vector": [4, 0, 0.1048, 0.0131, 0, 0.66, 0.75, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if utils.is_jython:\n from java.lang import Object\n from java.util import HashMap"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:ImportFrom_L24_C4", "label": "from java.lang import Object", "type": "import", "loc": [24, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L23_C0", "vector": [1, 1, 0.1048, 0.0044, 1, 0.6, 0.0, 100, 0, 1, 0, 0, 100, 0, 0], "semantic": {"name": "java.lang", "arg_names": [], "import_names": ["Object"], "rhs_call_name": "", "annotation": ""}, "snippet": " from java.lang import Object"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:ImportFrom_L25_C4", "label": "from java.util import HashMap", "type": "import", "loc": [25, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L23_C0", "vector": [1, 1, 0.1092, 0.0044, 1, 0.6, 1.0, 62, 0, 1, 0, 0, 62, 0, 0], "semantic": {"name": "java.util", "arg_names": [], "import_names": ["HashMap"], "rhs_call_name": "", "annotation": ""}, "snippet": " from java.util import HashMap"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:ClassDef_L28_C0", "label": "Listeners", "type": "class", "loc": [28, 175], "level": 0, "parent": null, "vector": [3, 0, 0.4432, 0.6463, 0, 0.66, 0.875, 43, 0, 22, 0, 0, 0, 0, 58], "semantic": {"name": "Listeners", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Listeners:\n _start_attrs = ['doc', 'starttime', 'longname']\n _end_attrs = _start_attrs + ['endtime', 'elapsedtime', 'status', 'message']\n\n def __init__(self, listeners):\n self._listeners = self._import_listeners(listeners)\n self._running_test = False\n self._setup_or_teardown_type = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Assign_L29_C4", "label": "_start_attrs =", "type": "assigned_variable", "loc": [29, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:ClassDef_L28_C0", "vector": [14, 1, 0.1266, 0.0044, 1, 0.18, 0.0, 638, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "_start_attrs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _start_attrs = ['doc', 'starttime', 'longname']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Assign_L30_C4", "label": "_end_attrs =", "type": "assigned_variable", "loc": [30, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:ClassDef_L28_C0", "vector": [14, 1, 0.131, 0.0044, 1, 0.18, 0.0435, 340, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "_end_attrs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _end_attrs = _start_attrs + ['endtime', 'elapsedtime', 'status', 'message']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L32_C4", "label": "__init__", "type": "function", "loc": [32, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:ClassDef_L28_C0", "vector": [2, 1, 0.1463, 0.0175, 1, 0.18, 0.087, 555, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "listeners"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, listeners):\n self._listeners = self._import_listeners(listeners)\n self._running_test = False\n self._setup_or_teardown_type = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Assign_L33_C8", "label": "self._listeners = _import_listeners()", "type": "assigned_variable", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L32_C4", "vector": [14, 2, 0.1441, 0.0044, 2, 0.61, 0.0, 977, 3, 1, 0, 0, 133, 10, 1], "semantic": {"name": "self._listeners", "arg_names": [], "import_names": [], "rhs_call_name": "_import_listeners", "annotation": ""}, "snippet": " self._listeners = self._import_listeners(listeners)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Assign_L34_C8", "label": "self._running_test =", "type": "assigned_variable", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L32_C4", "vector": [14, 2, 0.1485, 0.0044, 2, 0.61, 0.5, 193, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self._running_test", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._running_test = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Assign_L35_C8", "label": "self._setup_or_teardown_type =", "type": "assigned_variable", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L32_C4", "vector": [14, 2, 0.1528, 0.0044, 2, 0.61, 1.0, 725, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self._setup_or_teardown_type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._setup_or_teardown_type = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L37_C4", "label": "__nonzero__", "type": "function", "loc": [37, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:ClassDef_L28_C0", "vector": [2, 1, 0.1638, 0.0087, 1, 0.18, 0.1304, 322, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "__nonzero__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __nonzero__(self):\n return bool(self._listeners)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Return_L38_C8", "label": "return", "type": "return", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L37_C4", "vector": [13, 2, 0.1659, 0.0044, 2, 0.12, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return bool(self._listeners)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L40_C4", "label": "_import_listeners", "type": "function", "loc": [40, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:ClassDef_L28_C0", "vector": [2, 1, 0.2009, 0.0568, 1, 0.18, 0.1739, 133, 0, 2, 1, 0, 0, 0, 6], "semantic": {"name": "_import_listeners", "arg_names": ["self", "listener_data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _import_listeners(self, listener_data):\n listeners = []\n for name, args in listener_data:\n try:\n listeners.append(_ListenerProxy(name, args))\n except:\n message, details = utils.get_error_details()\n if args:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Assign_L41_C8", "label": "listeners =", "type": "assigned_variable", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L40_C4", "vector": [14, 2, 0.179, 0.0044, 2, 0.57, 0.0, 272, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "listeners", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " listeners = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:For_L42_C8", "label": "for name, args", "type": "for", "loc": [42, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L40_C4", "vector": [6, 2, 0.2031, 0.0437, 2, 0.57, 0.5, 706, 2, 0, 0, 0, 0, 0, 6], "semantic": {"name": "name, args", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for name, args in listener_data:\n try:\n listeners.append(_ListenerProxy(name, args))\n except:\n message, details = utils.get_error_details()\n if args:\n name += ':' + ':'.join(args)\n LOGGER.error(\"Taking listener '%s' into use failed: %s\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Try_L43_C12", "label": "try", "type": "try", "loc": [43, 51], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:For_L42_C8", "vector": [7, 3, 0.2052, 0.0393, 3, 0.33, 0.0, 0, 0, 1, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n listeners.append(_ListenerProxy(name, args))\n except:\n message, details = utils.get_error_details()\n if args:\n name += ':' + ':'.join(args)\n LOGGER.error(\"Taking listener '%s' into use failed: %s\"\n % (name, message))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Expr_L44_C16", "label": "append()", "type": "expression", "loc": [44, 44], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:Try_L43_C12", "vector": [8, 4, 0.1921, 0.0044, 4, 0.2, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " listeners.append(_ListenerProxy(name, args))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Assign_L46_C16", "label": "message, details = get_error_details()", "type": "assigned_variable", "loc": [46, 46], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:Try_L43_C12", "vector": [14, 4, 0.2009, 0.0044, 4, 0.2, 0.0, 693, 3, 0, 0, 0, 692, 10, 1], "semantic": {"name": "message, details", "arg_names": [], "import_names": [], "rhs_call_name": "get_error_details", "annotation": ""}, "snippet": " message, details = utils.get_error_details()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L47_C16", "label": "if", "type": "if", "loc": [47, 48], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:Try_L43_C12", "vector": [4, 4, 0.2074, 0.0087, 4, 0.2, 0.3333, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if args:\n name += ':' + ':'.join(args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Expr_L49_C16", "label": "error()", "type": "expression", "loc": [49, 50], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:Try_L43_C12", "vector": [8, 4, 0.2162, 0.0087, 4, 0.2, 0.6667, 771, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "error", "arg_names": [], "import_names": [], "rhs_call_name": "error", "annotation": ""}, "snippet": " LOGGER.error(\"Taking listener '%s' into use failed: %s\"\n % (name, message))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Expr_L51_C16", "label": "info()", "type": "expression", "loc": [51, 51], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:Try_L43_C12", "vector": [8, 4, 0.2227, 0.0044, 4, 0.2, 1.0, 730, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": " LOGGER.info(\"Details:\\n%s\" % details)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Return_L52_C8", "label": "return", "type": "return", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L40_C4", "vector": [13, 2, 0.2271, 0.0044, 2, 0.57, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return listeners"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L54_C4", "label": "start_suite", "type": "function", "loc": [54, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:ClassDef_L28_C0", "vector": [2, 1, 0.2555, 0.0437, 1, 0.18, 0.2174, 38, 0, 2, 0, 0, 0, 0, 5], "semantic": {"name": "start_suite", "arg_names": ["self", "suite"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start_suite(self, suite):\n for li in self._listeners:\n if li.version == 1:\n li.call_method(li.start_suite, suite.name, suite.doc)\n else:\n attrs = self._get_start_attrs(suite, 'metadata')\n attrs.update({'tests' : [t.name for t in suite.tests ],\n 'suites': [s.name for s in suite.suites],"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:For_L55_C8", "label": "for li", "type": "for", "loc": [55, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L54_C4", "vector": [6, 2, 0.2576, 0.0393, 2, 0.87, 0.0, 603, 7, 0, 0, 0, 0, 0, 5], "semantic": {"name": "li", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for li in self._listeners:\n if li.version == 1:\n li.call_method(li.start_suite, suite.name, suite.doc)\n else:\n attrs = self._get_start_attrs(suite, 'metadata')\n attrs.update({'tests' : [t.name for t in suite.tests ],\n 'suites': [s.name for s in suite.suites],\n 'totaltests': suite.get_test_count()})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L56_C12", "label": "if", "type": "if", "loc": [56, 63], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:For_L55_C8", "vector": [4, 3, 0.2598, 0.0349, 3, 0.23, 0.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if li.version == 1:\n li.call_method(li.start_suite, suite.name, suite.doc)\n else:\n attrs = self._get_start_attrs(suite, 'metadata')\n attrs.update({'tests' : [t.name for t in suite.tests ],\n 'suites': [s.name for s in suite.suites],\n 'totaltests': suite.get_test_count()})\n li.call_method(li.start_suite, suite.name, attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Expr_L57_C16", "label": "call_method()", "type": "expression", "loc": [57, 57], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L56_C12", "vector": [8, 4, 0.2489, 0.0044, 4, 0.67, 0.0, 94, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "call_method", "arg_names": [], "import_names": [], "rhs_call_name": "call_method", "annotation": ""}, "snippet": " li.call_method(li.start_suite, suite.name, suite.doc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Assign_L59_C16", "label": "attrs = _get_start_attrs()", "type": "assigned_variable", "loc": [59, 59], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L56_C12", "vector": [14, 4, 0.2576, 0.0044, 4, 0.67, 0.3333, 251, 3, 2, 0, 0, 154, 10, 1], "semantic": {"name": "attrs", "arg_names": [], "import_names": [], "rhs_call_name": "_get_start_attrs", "annotation": ""}, "snippet": " attrs = self._get_start_attrs(suite, 'metadata')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Expr_L60_C16", "label": "update()", "type": "expression", "loc": [60, 62], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L56_C12", "vector": [8, 4, 0.2664, 0.0131, 4, 0.67, 0.6667, 637, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " attrs.update({'tests' : [t.name for t in suite.tests ],\n 'suites': [s.name for s in suite.suites],\n 'totaltests': suite.get_test_count()})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Expr_L63_C16", "label": "call_method()", "type": "expression", "loc": [63, 63], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L56_C12", "vector": [8, 4, 0.2751, 0.0044, 4, 0.67, 1.0, 94, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "call_method", "arg_names": [], "import_names": [], "rhs_call_name": "call_method", "annotation": ""}, "snippet": " li.call_method(li.start_suite, suite.name, attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L65_C4", "label": "end_suite", "type": "function", "loc": [65, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:ClassDef_L28_C0", "vector": [2, 1, 0.3013, 0.0393, 1, 0.18, 0.2609, 81, 0, 2, 0, 0, 0, 0, 6], "semantic": {"name": "end_suite", "arg_names": ["self", "suite"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end_suite(self, suite):\n for li in self._listeners:\n if li.version == 1:\n li.call_method(li.end_suite, suite.status,\n suite.get_full_message())\n else:\n attrs = self._get_end_attrs(suite)\n attrs.update({'statistics': suite.get_stat_message()})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:For_L66_C8", "label": "for li", "type": "for", "loc": [66, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L65_C4", "vector": [6, 2, 0.3035, 0.0349, 2, 0.39, 0.0, 603, 7, 0, 0, 0, 0, 0, 6], "semantic": {"name": "li", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for li in self._listeners:\n if li.version == 1:\n li.call_method(li.end_suite, suite.status,\n suite.get_full_message())\n else:\n attrs = self._get_end_attrs(suite)\n attrs.update({'statistics': suite.get_stat_message()})\n li.call_method(li.end_suite, suite.name, attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L67_C12", "label": "if", "type": "if", "loc": [67, 73], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:For_L66_C8", "vector": [4, 3, 0.3057, 0.0306, 3, 0.68, 0.0, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if li.version == 1:\n li.call_method(li.end_suite, suite.status,\n suite.get_full_message())\n else:\n attrs = self._get_end_attrs(suite)\n attrs.update({'statistics': suite.get_stat_message()})\n li.call_method(li.end_suite, suite.name, attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Expr_L68_C16", "label": "call_method()", "type": "expression", "loc": [68, 69], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L67_C12", "vector": [8, 4, 0.2991, 0.0087, 4, 0.67, 0.0, 94, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "call_method", "arg_names": [], "import_names": [], "rhs_call_name": "call_method", "annotation": ""}, "snippet": " li.call_method(li.end_suite, suite.status,\n suite.get_full_message())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Assign_L71_C16", "label": "attrs = _get_end_attrs()", "type": "assigned_variable", "loc": [71, 71], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L67_C12", "vector": [14, 4, 0.31, 0.0044, 4, 0.67, 0.3333, 251, 3, 1, 0, 0, 226, 10, 1], "semantic": {"name": "attrs", "arg_names": [], "import_names": [], "rhs_call_name": "_get_end_attrs", "annotation": ""}, "snippet": " attrs = self._get_end_attrs(suite)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Expr_L72_C16", "label": "update()", "type": "expression", "loc": [72, 72], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L67_C12", "vector": [8, 4, 0.3144, 0.0044, 4, 0.67, 0.6667, 637, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "update", "arg_names": [], "import_names": [], "rhs_call_name": "update", "annotation": ""}, "snippet": " attrs.update({'statistics': suite.get_stat_message()})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Expr_L73_C16", "label": "call_method()", "type": "expression", "loc": [73, 73], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L67_C12", "vector": [8, 4, 0.3188, 0.0044, 4, 0.67, 1.0, 94, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "call_method", "arg_names": [], "import_names": [], "rhs_call_name": "call_method", "annotation": ""}, "snippet": " li.call_method(li.end_suite, suite.name, attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L75_C4", "label": "start_test", "type": "function", "loc": [75, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:ClassDef_L28_C0", "vector": [2, 1, 0.3428, 0.0349, 1, 0.18, 0.3043, 246, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "start_test", "arg_names": ["self", "test"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start_test(self, test):\n self._running_test = True\n for li in self._listeners:\n if li.version == 1:\n li.call_method(li.start_test, test.name, test.doc, test.tags)\n else:\n attrs = self._get_start_attrs(test, 'tags')\n li.call_method(li.start_test, test.name, attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Assign_L76_C8", "label": "self._running_test =", "type": "assigned_variable", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L75_C4", "vector": [14, 2, 0.3319, 0.0044, 2, 0.32, 0.0, 193, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self._running_test", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._running_test = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:For_L77_C8", "label": "for li", "type": "for", "loc": [77, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L75_C4", "vector": [6, 2, 0.3472, 0.0262, 2, 0.32, 1.0, 603, 7, 0, 0, 0, 0, 0, 3], "semantic": {"name": "li", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for li in self._listeners:\n if li.version == 1:\n li.call_method(li.start_test, test.name, test.doc, test.tags)\n else:\n attrs = self._get_start_attrs(test, 'tags')\n li.call_method(li.start_test, test.name, attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L78_C12", "label": "if", "type": "if", "loc": [78, 82], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:For_L77_C8", "vector": [4, 3, 0.3493, 0.0218, 3, 0.66, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if li.version == 1:\n li.call_method(li.start_test, test.name, test.doc, test.tags)\n else:\n attrs = self._get_start_attrs(test, 'tags')\n li.call_method(li.start_test, test.name, attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Expr_L79_C16", "label": "call_method()", "type": "expression", "loc": [79, 79], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L78_C12", "vector": [8, 4, 0.345, 0.0044, 4, 0.81, 0.0, 94, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "call_method", "arg_names": [], "import_names": [], "rhs_call_name": "call_method", "annotation": ""}, "snippet": " li.call_method(li.start_test, test.name, test.doc, test.tags)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Assign_L81_C16", "label": "attrs = _get_start_attrs()", "type": "assigned_variable", "loc": [81, 81], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L78_C12", "vector": [14, 4, 0.3537, 0.0044, 4, 0.81, 0.5, 251, 3, 2, 0, 0, 154, 10, 1], "semantic": {"name": "attrs", "arg_names": [], "import_names": [], "rhs_call_name": "_get_start_attrs", "annotation": ""}, "snippet": " attrs = self._get_start_attrs(test, 'tags')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Expr_L82_C16", "label": "call_method()", "type": "expression", "loc": [82, 82], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L78_C12", "vector": [8, 4, 0.3581, 0.0044, 4, 0.81, 1.0, 94, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "call_method", "arg_names": [], "import_names": [], "rhs_call_name": "call_method", "annotation": ""}, "snippet": " li.call_method(li.start_test, test.name, attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L84_C4", "label": "end_test", "type": "function", "loc": [84, 91], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:ClassDef_L28_C0", "vector": [2, 1, 0.3821, 0.0349, 1, 0.18, 0.3478, 220, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "end_test", "arg_names": ["self", "test"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end_test(self, test):\n self._running_test = False\n for li in self._listeners:\n if li.version == 1:\n li.call_method(li.end_test, test.status, test.message)\n else:\n attrs = self._get_end_attrs(test, 'tags')\n li.call_method(li.end_test, test.name, attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Assign_L85_C8", "label": "self._running_test =", "type": "assigned_variable", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L84_C4", "vector": [14, 2, 0.3712, 0.0044, 2, 0.63, 0.0, 193, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self._running_test", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._running_test = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:For_L86_C8", "label": "for li", "type": "for", "loc": [86, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L84_C4", "vector": [6, 2, 0.3865, 0.0262, 2, 0.63, 1.0, 603, 7, 0, 0, 0, 0, 0, 3], "semantic": {"name": "li", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for li in self._listeners:\n if li.version == 1:\n li.call_method(li.end_test, test.status, test.message)\n else:\n attrs = self._get_end_attrs(test, 'tags')\n li.call_method(li.end_test, test.name, attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L87_C12", "label": "if", "type": "if", "loc": [87, 91], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:For_L86_C8", "vector": [4, 3, 0.3886, 0.0218, 3, 0.25, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if li.version == 1:\n li.call_method(li.end_test, test.status, test.message)\n else:\n attrs = self._get_end_attrs(test, 'tags')\n li.call_method(li.end_test, test.name, attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Expr_L88_C16", "label": "call_method()", "type": "expression", "loc": [88, 88], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L87_C12", "vector": [8, 4, 0.3843, 0.0044, 4, 0.28, 0.0, 94, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "call_method", "arg_names": [], "import_names": [], "rhs_call_name": "call_method", "annotation": ""}, "snippet": " li.call_method(li.end_test, test.status, test.message)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Assign_L90_C16", "label": "attrs = _get_end_attrs()", "type": "assigned_variable", "loc": [90, 90], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L87_C12", "vector": [14, 4, 0.393, 0.0044, 4, 0.28, 0.5, 251, 3, 2, 0, 0, 226, 10, 1], "semantic": {"name": "attrs", "arg_names": [], "import_names": [], "rhs_call_name": "_get_end_attrs", "annotation": ""}, "snippet": " attrs = self._get_end_attrs(test, 'tags')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Expr_L91_C16", "label": "call_method()", "type": "expression", "loc": [91, 91], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L87_C12", "vector": [8, 4, 0.3974, 0.0044, 4, 0.28, 1.0, 94, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "call_method", "arg_names": [], "import_names": [], "rhs_call_name": "call_method", "annotation": ""}, "snippet": " li.call_method(li.end_test, test.name, attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L93_C4", "label": "start_keyword", "type": "function", "loc": [93, 100], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:ClassDef_L28_C0", "vector": [2, 1, 0.4214, 0.0349, 1, 0.18, 0.3913, 776, 0, 2, 0, 0, 0, 0, 4], "semantic": {"name": "start_keyword", "arg_names": ["self", "kw"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start_keyword(self, kw):\n for li in self._listeners:\n if li.version == 1:\n li.call_method(li.start_keyword, kw.name, kw.args)\n else:\n attrs = self._get_start_attrs(kw, 'args', '-longname')\n attrs['type'] = self._get_keyword_type(kw, start=True)\n li.call_method(li.start_keyword, kw.name, attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:For_L94_C8", "label": "for li", "type": "for", "loc": [94, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L93_C4", "vector": [6, 2, 0.4236, 0.0306, 2, 0.24, 0.0, 603, 7, 0, 0, 0, 0, 0, 4], "semantic": {"name": "li", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for li in self._listeners:\n if li.version == 1:\n li.call_method(li.start_keyword, kw.name, kw.args)\n else:\n attrs = self._get_start_attrs(kw, 'args', '-longname')\n attrs['type'] = self._get_keyword_type(kw, start=True)\n li.call_method(li.start_keyword, kw.name, attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L95_C12", "label": "if", "type": "if", "loc": [95, 100], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:For_L94_C8", "vector": [4, 3, 0.4258, 0.0262, 3, 0.32, 0.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if li.version == 1:\n li.call_method(li.start_keyword, kw.name, kw.args)\n else:\n attrs = self._get_start_attrs(kw, 'args', '-longname')\n attrs['type'] = self._get_keyword_type(kw, start=True)\n li.call_method(li.start_keyword, kw.name, attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Expr_L96_C16", "label": "call_method()", "type": "expression", "loc": [96, 96], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L95_C12", "vector": [8, 4, 0.4192, 0.0044, 4, 0.45, 0.0, 94, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "call_method", "arg_names": [], "import_names": [], "rhs_call_name": "call_method", "annotation": ""}, "snippet": " li.call_method(li.start_keyword, kw.name, kw.args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Assign_L98_C16", "label": "attrs = _get_start_attrs()", "type": "assigned_variable", "loc": [98, 98], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L95_C12", "vector": [14, 4, 0.4279, 0.0044, 4, 0.45, 0.3333, 251, 3, 3, 0, 0, 154, 10, 1], "semantic": {"name": "attrs", "arg_names": [], "import_names": [], "rhs_call_name": "_get_start_attrs", "annotation": ""}, "snippet": " attrs = self._get_start_attrs(kw, 'args', '-longname')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Assign_L99_C16", "label": " = _get_keyword_type()", "type": "assigned_variable", "loc": [99, 99], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L95_C12", "vector": [14, 4, 0.4323, 0.0044, 4, 0.45, 0.6667, 0, 3, 2, 0, 0, 825, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "_get_keyword_type", "annotation": ""}, "snippet": " attrs['type'] = self._get_keyword_type(kw, start=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Expr_L100_C16", "label": "call_method()", "type": "expression", "loc": [100, 100], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L95_C12", "vector": [8, 4, 0.4367, 0.0044, 4, 0.45, 1.0, 94, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "call_method", "arg_names": [], "import_names": [], "rhs_call_name": "call_method", "annotation": ""}, "snippet": " li.call_method(li.start_keyword, kw.name, attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L102_C4", "label": "end_keyword", "type": "function", "loc": [102, 109], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:ClassDef_L28_C0", "vector": [2, 1, 0.4607, 0.0349, 1, 0.18, 0.4348, 959, 0, 2, 0, 0, 0, 0, 4], "semantic": {"name": "end_keyword", "arg_names": ["self", "kw"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end_keyword(self, kw):\n for li in self._listeners:\n if li.version == 1:\n li.call_method(li.end_keyword, kw.status)\n else:\n attrs = self._get_end_attrs(kw, 'args', '-longname', '-message')\n attrs['type'] = self._get_keyword_type(kw, start=False)\n li.call_method(li.end_keyword, kw.name, attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:For_L103_C8", "label": "for li", "type": "for", "loc": [103, 109], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L102_C4", "vector": [6, 2, 0.4629, 0.0306, 2, 0.49, 0.0, 603, 7, 0, 0, 0, 0, 0, 4], "semantic": {"name": "li", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for li in self._listeners:\n if li.version == 1:\n li.call_method(li.end_keyword, kw.status)\n else:\n attrs = self._get_end_attrs(kw, 'args', '-longname', '-message')\n attrs['type'] = self._get_keyword_type(kw, start=False)\n li.call_method(li.end_keyword, kw.name, attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L104_C12", "label": "if", "type": "if", "loc": [104, 109], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:For_L103_C8", "vector": [4, 3, 0.4651, 0.0262, 3, 0.47, 0.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if li.version == 1:\n li.call_method(li.end_keyword, kw.status)\n else:\n attrs = self._get_end_attrs(kw, 'args', '-longname', '-message')\n attrs['type'] = self._get_keyword_type(kw, start=False)\n li.call_method(li.end_keyword, kw.name, attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Expr_L105_C16", "label": "call_method()", "type": "expression", "loc": [105, 105], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L104_C12", "vector": [8, 4, 0.4585, 0.0044, 4, 0.23, 0.0, 94, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "call_method", "arg_names": [], "import_names": [], "rhs_call_name": "call_method", "annotation": ""}, "snippet": " li.call_method(li.end_keyword, kw.status)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Assign_L107_C16", "label": "attrs = _get_end_attrs()", "type": "assigned_variable", "loc": [107, 107], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L104_C12", "vector": [14, 4, 0.4672, 0.0044, 4, 0.23, 0.3333, 251, 3, 4, 0, 0, 226, 10, 1], "semantic": {"name": "attrs", "arg_names": [], "import_names": [], "rhs_call_name": "_get_end_attrs", "annotation": ""}, "snippet": " attrs = self._get_end_attrs(kw, 'args', '-longname', '-message')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Assign_L108_C16", "label": " = _get_keyword_type()", "type": "assigned_variable", "loc": [108, 108], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L104_C12", "vector": [14, 4, 0.4716, 0.0044, 4, 0.23, 0.6667, 0, 3, 2, 0, 0, 825, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "_get_keyword_type", "annotation": ""}, "snippet": " attrs['type'] = self._get_keyword_type(kw, start=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Expr_L109_C16", "label": "call_method()", "type": "expression", "loc": [109, 109], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L104_C12", "vector": [8, 4, 0.476, 0.0044, 4, 0.23, 1.0, 94, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "call_method", "arg_names": [], "import_names": [], "rhs_call_name": "call_method", "annotation": ""}, "snippet": " li.call_method(li.end_keyword, kw.name, attrs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L111_C4", "label": "_get_keyword_type", "type": "function", "loc": [111, 119], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:ClassDef_L28_C0", "vector": [2, 1, 0.5022, 0.0393, 1, 0.18, 0.4783, 825, 0, 3, 1, 0, 0, 0, 1], "semantic": {"name": "_get_keyword_type", "arg_names": ["self", "kw", "start"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_keyword_type(self, kw, start=True):\n # When running setup or teardown, only the top level keyword has type\n # set to setup/teardown but we want to pass that type also to all\n # start/end_keyword listener methods called below that keyword.\n if kw.type == 'kw':\n return self._setup_or_teardown_type or 'Keyword'\n kw_type = self._get_setup_or_teardown_type(kw)\n self._setup_or_teardown_type = kw_type if start else None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L115_C8", "label": "if", "type": "if", "loc": [115, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L111_C4", "vector": [4, 2, 0.5044, 0.0087, 2, 0.3, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if kw.type == 'kw':\n return self._setup_or_teardown_type or 'Keyword'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Return_L116_C12", "label": "return", "type": "return", "loc": [116, 116], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L115_C8", "vector": [13, 3, 0.5066, 0.0044, 3, 0.5, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._setup_or_teardown_type or 'Keyword'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Assign_L117_C8", "label": "kw_type = _get_setup_or_teardown_type()", "type": "assigned_variable", "loc": [117, 117], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L111_C4", "vector": [14, 2, 0.5109, 0.0044, 2, 0.3, 0.3333, 168, 3, 1, 0, 0, 576, 10, 1], "semantic": {"name": "kw_type", "arg_names": [], "import_names": [], "rhs_call_name": "_get_setup_or_teardown_type", "annotation": ""}, "snippet": " kw_type = self._get_setup_or_teardown_type(kw)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Assign_L118_C8", "label": "self._setup_or_teardown_type =", "type": "assigned_variable", "loc": [118, 118], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L111_C4", "vector": [14, 2, 0.5153, 0.0044, 2, 0.3, 0.6667, 725, 8, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._setup_or_teardown_type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._setup_or_teardown_type = kw_type if start else None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Return_L119_C8", "label": "return", "type": "return", "loc": [119, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L111_C4", "vector": [13, 2, 0.5197, 0.0044, 2, 0.3, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return kw_type"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L121_C4", "label": "_get_setup_or_teardown_type", "type": "function", "loc": [121, 123], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:ClassDef_L28_C0", "vector": [2, 1, 0.5328, 0.0131, 1, 0.18, 0.5217, 576, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "_get_setup_or_teardown_type", "arg_names": ["self", "kw"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_setup_or_teardown_type(self, kw):\n return '%s %s' % (('Test' if self._running_test else 'Suite'),\n kw.type.title())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Return_L122_C8", "label": "return", "type": "return", "loc": [122, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L121_C4", "vector": [13, 2, 0.5349, 0.0087, 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 '%s %s' % (('Test' if self._running_test else 'Suite'),\n kw.type.title())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L125_C4", "label": "log_message", "type": "function", "loc": [125, 128], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:ClassDef_L28_C0", "vector": [2, 1, 0.5524, 0.0175, 1, 0.18, 0.5652, 87, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "log_message", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def log_message(self, msg):\n for li in self._listeners:\n if li.version == 2:\n li.call_method(li.log_message, self._create_msg_dict(msg))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:For_L126_C8", "label": "for li", "type": "for", "loc": [126, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L125_C4", "vector": [6, 2, 0.5546, 0.0131, 2, 0.61, 0.0, 603, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "li", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for li in self._listeners:\n if li.version == 2:\n li.call_method(li.log_message, self._create_msg_dict(msg))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L127_C12", "label": "if", "type": "if", "loc": [127, 128], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:For_L126_C8", "vector": [4, 3, 0.5568, 0.0087, 3, 0.26, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if li.version == 2:\n li.call_method(li.log_message, self._create_msg_dict(msg))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Expr_L128_C16", "label": "call_method()", "type": "expression", "loc": [128, 128], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L127_C12", "vector": [8, 4, 0.559, 0.0044, 4, 0.95, 0.0, 94, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "call_method", "arg_names": [], "import_names": [], "rhs_call_name": "call_method", "annotation": ""}, "snippet": " li.call_method(li.log_message, self._create_msg_dict(msg))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L130_C4", "label": "message", "type": "function", "loc": [130, 133], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:ClassDef_L28_C0", "vector": [2, 1, 0.5742, 0.0175, 1, 0.18, 0.6087, 635, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "message", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def message(self, msg):\n for li in self._listeners:\n if li.version == 2:\n li.call_method(li.message, self._create_msg_dict(msg))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:For_L131_C8", "label": "for li", "type": "for", "loc": [131, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L130_C4", "vector": [6, 2, 0.5764, 0.0131, 2, 0.9, 0.0, 603, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "li", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for li in self._listeners:\n if li.version == 2:\n li.call_method(li.message, self._create_msg_dict(msg))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L132_C12", "label": "if", "type": "if", "loc": [132, 133], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:For_L131_C8", "vector": [4, 3, 0.5786, 0.0087, 3, 0.3, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if li.version == 2:\n li.call_method(li.message, self._create_msg_dict(msg))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Expr_L133_C16", "label": "call_method()", "type": "expression", "loc": [133, 133], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L132_C12", "vector": [8, 4, 0.5808, 0.0044, 4, 0.34, 0.0, 94, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "call_method", "arg_names": [], "import_names": [], "rhs_call_name": "call_method", "annotation": ""}, "snippet": " li.call_method(li.message, self._create_msg_dict(msg))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L135_C4", "label": "_create_msg_dict", "type": "function", "loc": [135, 137], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:ClassDef_L28_C0", "vector": [2, 1, 0.5939, 0.0131, 1, 0.18, 0.6522, 284, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "_create_msg_dict", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _create_msg_dict(self, msg):\n return {'timestamp': msg.timestamp, 'message': msg.message,\n 'level': msg.level, 'html': 'yes' if msg.html else 'no'}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Return_L136_C8", "label": "return", "type": "return", "loc": [136, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L135_C4", "vector": [13, 2, 0.5961, 0.0087, 2, 0.97, 0.0, 0, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return {'timestamp': msg.timestamp, 'message': msg.message,\n 'level': msg.level, 'html': 'yes' if msg.html else 'no'}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L139_C4", "label": "output_file", "type": "function", "loc": [139, 141], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:ClassDef_L28_C0", "vector": [2, 1, 0.6114, 0.0131, 1, 0.18, 0.6957, 395, 0, 3, 0, 0, 0, 0, 3], "semantic": {"name": "output_file", "arg_names": ["self", "name", "path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def output_file(self, name, path):\n for li in self._listeners:\n li.call_method(getattr(li, '%s_file' % name.lower()), path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:For_L140_C8", "label": "for li", "type": "for", "loc": [140, 141], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L139_C4", "vector": [6, 2, 0.6135, 0.0087, 2, 0.11, 0.0, 603, 7, 0, 0, 0, 0, 0, 3], "semantic": {"name": "li", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for li in self._listeners:\n li.call_method(getattr(li, '%s_file' % name.lower()), path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Expr_L141_C12", "label": "call_method()", "type": "expression", "loc": [141, 141], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:For_L140_C8", "vector": [8, 3, 0.6157, 0.0044, 3, 0.04, 0.0, 94, 3, 2, 0, 0, 0, 0, 3], "semantic": {"name": "call_method", "arg_names": [], "import_names": [], "rhs_call_name": "call_method", "annotation": ""}, "snippet": " li.call_method(getattr(li, '%s_file' % name.lower()), path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L143_C4", "label": "close", "type": "function", "loc": [143, 145], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:ClassDef_L28_C0", "vector": [2, 1, 0.6288, 0.0131, 1, 0.18, 0.7391, 77, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def close(self):\n for li in self._listeners:\n li.call_method(li.close)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:For_L144_C8", "label": "for li", "type": "for", "loc": [144, 145], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L143_C4", "vector": [6, 2, 0.631, 0.0087, 2, 0.86, 0.0, 603, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "li", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for li in self._listeners:\n li.call_method(li.close)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Expr_L145_C12", "label": "call_method()", "type": "expression", "loc": [145, 145], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:For_L144_C8", "vector": [8, 3, 0.6332, 0.0044, 3, 0.56, 0.0, 94, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "call_method", "arg_names": [], "import_names": [], "rhs_call_name": "call_method", "annotation": ""}, "snippet": " li.call_method(li.close)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L147_C4", "label": "_get_start_attrs", "type": "function", "loc": [147, 148], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:ClassDef_L28_C0", "vector": [2, 1, 0.6441, 0.0087, 1, 0.18, 0.7826, 154, 0, 3, 1, 0, 0, 0, 1], "semantic": {"name": "_get_start_attrs", "arg_names": ["self", "item", "names"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_start_attrs(self, item, *names):\n return self._get_attrs(item, self._start_attrs, names)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Return_L148_C8", "label": "return", "type": "return", "loc": [148, 148], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L147_C4", "vector": [13, 2, 0.6463, 0.0044, 2, 0.48, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._get_attrs(item, self._start_attrs, names)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L150_C4", "label": "_get_end_attrs", "type": "function", "loc": [150, 151], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:ClassDef_L28_C0", "vector": [2, 1, 0.6572, 0.0087, 1, 0.18, 0.8261, 226, 0, 3, 1, 0, 0, 0, 1], "semantic": {"name": "_get_end_attrs", "arg_names": ["self", "item", "names"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_end_attrs(self, item, *names):\n return self._get_attrs(item, self._end_attrs, names)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Return_L151_C8", "label": "return", "type": "return", "loc": [151, 151], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L150_C4", "vector": [13, 2, 0.6594, 0.0044, 2, 0.99, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._get_attrs(item, self._end_attrs, names)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L153_C4", "label": "_get_attrs", "type": "function", "loc": [153, 155], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:ClassDef_L28_C0", "vector": [2, 1, 0.6725, 0.0131, 1, 0.18, 0.8696, 866, 0, 4, 1, 0, 0, 0, 3], "semantic": {"name": "_get_attrs", "arg_names": ["self", "item", "defaults", "extras"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_attrs(self, item, defaults, extras):\n names = self._get_attr_names(defaults, extras)\n return dict((n, self._get_attr_value(item, n)) for n in names)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Assign_L154_C8", "label": "names = _get_attr_names()", "type": "assigned_variable", "loc": [154, 154], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L153_C4", "vector": [14, 2, 0.6725, 0.0044, 2, 0.21, 0.0, 382, 3, 2, 0, 0, 585, 10, 1], "semantic": {"name": "names", "arg_names": [], "import_names": [], "rhs_call_name": "_get_attr_names", "annotation": ""}, "snippet": " names = self._get_attr_names(defaults, extras)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Return_L155_C8", "label": "return", "type": "return", "loc": [155, 155], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L153_C4", "vector": [13, 2, 0.6769, 0.0044, 2, 0.21, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return dict((n, self._get_attr_value(item, n)) for n in names)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L157_C4", "label": "_get_attr_names", "type": "function", "loc": [157, 164], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:ClassDef_L28_C0", "vector": [2, 1, 0.7009, 0.0349, 1, 0.18, 0.913, 585, 0, 3, 1, 0, 0, 0, 4], "semantic": {"name": "_get_attr_names", "arg_names": ["self", "defaults", "extras"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_attr_names(self, defaults, extras):\n names = list(defaults)\n for name in extras:\n if name.startswith('-'):\n names.remove(name[1:])\n else:\n names.append(name)\n return names"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Assign_L158_C8", "label": "names = list()", "type": "assigned_variable", "loc": [158, 158], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L157_C4", "vector": [14, 2, 0.69, 0.0044, 2, 0.01, 0.0, 382, 3, 1, 0, 0, 430, 10, 1], "semantic": {"name": "names", "arg_names": [], "import_names": [], "rhs_call_name": "list", "annotation": ""}, "snippet": " names = list(defaults)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:For_L159_C8", "label": "for name", "type": "for", "loc": [159, 163], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L157_C4", "vector": [6, 2, 0.7031, 0.0218, 2, 0.01, 0.5, 57, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for name in extras:\n if name.startswith('-'):\n names.remove(name[1:])\n else:\n names.append(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L160_C12", "label": "if", "type": "if", "loc": [160, 163], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:For_L159_C8", "vector": [4, 3, 0.7052, 0.0175, 3, 0.37, 0.0, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if name.startswith('-'):\n names.remove(name[1:])\n else:\n names.append(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Expr_L161_C16", "label": "remove()", "type": "expression", "loc": [161, 161], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L160_C12", "vector": [8, 4, 0.7031, 0.0044, 4, 0.51, 0.0, 185, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "remove", "arg_names": [], "import_names": [], "rhs_call_name": "remove", "annotation": ""}, "snippet": " names.remove(name[1:])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Expr_L163_C16", "label": "append()", "type": "expression", "loc": [163, 163], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L160_C12", "vector": [8, 4, 0.7118, 0.0044, 4, 0.51, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " names.append(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Return_L164_C8", "label": "return", "type": "return", "loc": [164, 164], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L157_C4", "vector": [13, 2, 0.7162, 0.0044, 2, 0.01, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return names"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L166_C4", "label": "_get_attr_value", "type": "function", "loc": [166, 168], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:ClassDef_L28_C0", "vector": [2, 1, 0.7293, 0.0131, 1, 0.18, 0.9565, 649, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "_get_attr_value", "arg_names": ["self", "item", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_attr_value(self, item, name):\n value = getattr(item, name)\n return self._take_copy_of_mutable_value(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Assign_L167_C8", "label": "value = getattr()", "type": "assigned_variable", "loc": [167, 167], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L166_C4", "vector": [14, 2, 0.7293, 0.0044, 2, 0.61, 0.0, 441, 3, 2, 0, 0, 121, 10, 1], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "getattr", "annotation": ""}, "snippet": " value = getattr(item, name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Return_L168_C8", "label": "return", "type": "return", "loc": [168, 168], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L166_C4", "vector": [13, 2, 0.7336, 0.0044, 2, 0.61, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._take_copy_of_mutable_value(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L170_C4", "label": "_take_copy_of_mutable_value", "type": "function", "loc": [170, 175], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:ClassDef_L28_C0", "vector": [2, 1, 0.7533, 0.0262, 1, 0.18, 1.0, 438, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "_take_copy_of_mutable_value", "arg_names": ["self", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _take_copy_of_mutable_value(self, value):\n if isinstance(value, (dict, utils.NormalizedDict)):\n return dict(value)\n if isinstance(value, list):\n return list(value)\n return value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L171_C8", "label": "if", "type": "if", "loc": [171, 172], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L170_C4", "vector": [4, 2, 0.7489, 0.0087, 2, 0.92, 0.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(value, (dict, utils.NormalizedDict)):\n return dict(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Return_L172_C12", "label": "return", "type": "return", "loc": [172, 172], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L171_C8", "vector": [13, 3, 0.7511, 0.0044, 3, 0.51, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return dict(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L173_C8", "label": "if", "type": "if", "loc": [173, 174], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L170_C4", "vector": [4, 2, 0.7576, 0.0087, 2, 0.92, 0.5, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(value, list):\n return list(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Return_L174_C12", "label": "return", "type": "return", "loc": [174, 174], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L173_C8", "vector": [13, 3, 0.7598, 0.0044, 3, 0.52, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return list(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Return_L175_C8", "label": "return", "type": "return", "loc": [175, 175], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L170_C4", "vector": [13, 2, 0.7642, 0.0044, 2, 0.92, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:ClassDef_L178_C0", "label": "_ListenerProxy", "type": "class", "loc": [178, 229], "level": 0, "parent": null, "vector": [3, 0, 0.8886, 0.2271, 0, 0.66, 1.0, 782, 0, 6, 0, 0, 7, 0, 23], "semantic": {"name": "_ListenerProxy", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _ListenerProxy(AbstractLoggerProxy):\n _methods = ['start_suite', 'end_suite', 'start_test', 'end_test',\n 'start_keyword', 'end_keyword', 'log_message', 'message',\n 'output_file', 'report_file', 'log_file', 'debug_file',\n 'xunit_file', 'close']\n\n def __init__(self, name, args):\n listener = self._import_listener(name, args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Assign_L179_C4", "label": "_methods =", "type": "assigned_variable", "loc": [179, 182], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:ClassDef_L178_C0", "vector": [14, 1, 0.7882, 0.0175, 1, 0.06, 0.0, 904, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "_methods", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _methods = ['start_suite', 'end_suite', 'start_test', 'end_test',\n 'start_keyword', 'end_keyword', 'log_message', 'message',\n 'output_file', 'report_file', 'log_file', 'debug_file',\n 'xunit_file', 'close']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L184_C4", "label": "__init__", "type": "function", "loc": [184, 190], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:ClassDef_L178_C0", "vector": [2, 1, 0.8166, 0.0306, 1, 0.06, 0.1667, 555, 0, 3, 0, 0, 0, 0, 4], "semantic": {"name": "__init__", "arg_names": ["self", "name", "args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, name, args):\n listener = self._import_listener(name, args)\n AbstractLoggerProxy.__init__(self, listener)\n self.name = name\n self.version = self._get_version(listener)\n self.is_java = utils.is_jython and isinstance(listener, Object)\n self._failed = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Assign_L185_C8", "label": "listener = _import_listener()", "type": "assigned_variable", "loc": [185, 185], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L184_C4", "vector": [14, 2, 0.8079, 0.0044, 2, 0.05, 0.0, 870, 3, 2, 0, 0, 707, 10, 1], "semantic": {"name": "listener", "arg_names": [], "import_names": [], "rhs_call_name": "_import_listener", "annotation": ""}, "snippet": " listener = self._import_listener(name, args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Expr_L186_C8", "label": "__init__()", "type": "expression", "loc": [186, 186], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L184_C4", "vector": [8, 2, 0.8122, 0.0044, 2, 0.05, 0.2, 555, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " AbstractLoggerProxy.__init__(self, listener)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Assign_L187_C8", "label": "self.name =", "type": "assigned_variable", "loc": [187, 187], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L184_C4", "vector": [14, 2, 0.8166, 0.0044, 2, 0.05, 0.4, 689, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.name = name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Assign_L188_C8", "label": "self.version = _get_version()", "type": "assigned_variable", "loc": [188, 188], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L184_C4", "vector": [14, 2, 0.821, 0.0044, 2, 0.05, 0.6, 686, 3, 1, 0, 0, 602, 10, 1], "semantic": {"name": "self.version", "arg_names": [], "import_names": [], "rhs_call_name": "_get_version", "annotation": ""}, "snippet": " self.version = self._get_version(listener)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Assign_L189_C8", "label": "self.is_java =", "type": "assigned_variable", "loc": [189, 189], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L184_C4", "vector": [14, 2, 0.8253, 0.0044, 2, 0.05, 0.8, 746, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.is_java", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.is_java = utils.is_jython and isinstance(listener, Object)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Assign_L190_C8", "label": "self._failed =", "type": "assigned_variable", "loc": [190, 190], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L184_C4", "vector": [14, 2, 0.8297, 0.0044, 2, 0.05, 1.0, 24, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self._failed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._failed = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L192_C4", "label": "_import_listener", "type": "function", "loc": [192, 200], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:ClassDef_L178_C0", "vector": [2, 1, 0.8559, 0.0393, 1, 0.06, 0.3333, 707, 0, 3, 1, 0, 0, 0, 6], "semantic": {"name": "_import_listener", "arg_names": ["self", "name", "args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _import_listener(self, name, args):\n listener, source = utils.import_(name, 'listener')\n if not inspect.ismodule(listener):\n listener = listener(*args)\n elif args:\n raise DataError(\"Listeners implemented as modules do not take arguments\")\n LOGGER.info(\"Imported listener '%s' with arguments %s (source %s)\"\n % (name, utils.seq2str2(args), source))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Assign_L193_C8", "label": "listener, source = import_()", "type": "assigned_variable", "loc": [193, 193], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L192_C4", "vector": [14, 2, 0.8428, 0.0044, 2, 0.96, 0.0, 584, 3, 2, 0, 0, 10, 10, 1], "semantic": {"name": "listener, source", "arg_names": [], "import_names": [], "rhs_call_name": "import_", "annotation": ""}, "snippet": " listener, source = utils.import_(name, 'listener')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L194_C8", "label": "if", "type": "if", "loc": [194, 197], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L192_C4", "vector": [4, 2, 0.8537, 0.0175, 2, 0.96, 0.3333, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not inspect.ismodule(listener):\n listener = listener(*args)\n elif args:\n raise DataError(\"Listeners implemented as modules do not take arguments\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Assign_L195_C12", "label": "listener = listener()", "type": "assigned_variable", "loc": [195, 195], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L194_C8", "vector": [14, 3, 0.8515, 0.0044, 3, 0.1, 0.0, 870, 3, 1, 0, 0, 870, 10, 1], "semantic": {"name": "listener", "arg_names": [], "import_names": [], "rhs_call_name": "listener", "annotation": ""}, "snippet": " listener = listener(*args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L196_C8", "label": "if", "type": "if", "loc": [196, 197], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L194_C8", "vector": [4, 3, 0.8581, 0.0087, 3, 0.1, 1.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif args:\n raise DataError(\"Listeners implemented as modules do not take arguments\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Expr_L198_C8", "label": "info()", "type": "expression", "loc": [198, 199], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L192_C4", "vector": [8, 2, 0.8668, 0.0087, 2, 0.96, 0.6667, 730, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": " LOGGER.info(\"Imported listener '%s' with arguments %s (source %s)\"\n % (name, utils.seq2str2(args), source))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Return_L200_C8", "label": "return", "type": "return", "loc": [200, 200], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L192_C4", "vector": [13, 2, 0.8734, 0.0044, 2, 0.96, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return listener"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L202_C4", "label": "_get_version", "type": "function", "loc": [202, 206], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:ClassDef_L178_C0", "vector": [2, 1, 0.8908, 0.0218, 1, 0.06, 0.5, 602, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "_get_version", "arg_names": ["self", "listener"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_version(self, listener):\n try:\n return int(getattr(listener, 'ROBOT_LISTENER_API_VERSION', 1))\n except ValueError:\n return 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Try_L203_C8", "label": "try", "type": "try", "loc": [203, 206], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L202_C4", "vector": [7, 2, 0.893, 0.0175, 2, 0.24, 0.0, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n return int(getattr(listener, 'ROBOT_LISTENER_API_VERSION', 1))\n except ValueError:\n return 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Return_L204_C12", "label": "return", "type": "return", "loc": [204, 204], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:Try_L203_C8", "vector": [13, 3, 0.8908, 0.0044, 3, 0.39, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return int(getattr(listener, 'ROBOT_LISTENER_API_VERSION', 1))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Return_L206_C12", "label": "return", "type": "return", "loc": [206, 206], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:Try_L203_C8", "vector": [13, 3, 0.8996, 0.0044, 3, 0.39, 0.0, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L208_C4", "label": "call_method", "type": "function", "loc": [208, 217], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:ClassDef_L178_C0", "vector": [2, 1, 0.9279, 0.0437, 1, 0.06, 0.6667, 94, 0, 3, 0, 0, 0, 0, 5], "semantic": {"name": "call_method", "arg_names": ["self", "method", "args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def call_method(self, method, *args):\n if method in self._failed:\n return\n if self.is_java:\n args = [self._to_map(a) if isinstance(a, dict) else a for a in args]\n try:\n method(*args)\n except:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L209_C8", "label": "if", "type": "if", "loc": [209, 210], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L208_C4", "vector": [4, 2, 0.9148, 0.0087, 2, 0.64, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if method in self._failed:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Return_L210_C12", "label": "return", "type": "return", "loc": [210, 210], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L209_C8", "vector": [13, 3, 0.917, 0.0044, 3, 0.8, 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_99903:If_L211_C8", "label": "if", "type": "if", "loc": [211, 212], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L208_C4", "vector": [4, 2, 0.9236, 0.0087, 2, 0.64, 0.5, 0, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.is_java:\n args = [self._to_map(a) if isinstance(a, dict) else a for a in args]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Assign_L212_C12", "label": "args =", "type": "assigned_variable", "loc": [212, 212], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L211_C8", "vector": [14, 3, 0.9258, 0.0044, 3, 0.63, 0.0, 805, 5, 0, 0, 0, 0, 0, 2], "semantic": {"name": "args", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " args = [self._to_map(a) if isinstance(a, dict) else a for a in args]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Try_L213_C8", "label": "try", "type": "try", "loc": [213, 217], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L208_C4", "vector": [7, 2, 0.9389, 0.0218, 2, 0.64, 1.0, 0, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n method(*args)\n except:\n self._failed.append(method)\n self._report_error(method)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Expr_L214_C12", "label": "method()", "type": "expression", "loc": [214, 214], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:Try_L213_C8", "vector": [8, 3, 0.9345, 0.0044, 3, 0.09, 0.0, 445, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "method", "arg_names": [], "import_names": [], "rhs_call_name": "method", "annotation": ""}, "snippet": " method(*args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Expr_L216_C12", "label": "append()", "type": "expression", "loc": [216, 216], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:Try_L213_C8", "vector": [8, 3, 0.9432, 0.0044, 3, 0.09, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self._failed.append(method)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Expr_L217_C12", "label": "_report_error()", "type": "expression", "loc": [217, 217], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:Try_L213_C8", "vector": [8, 3, 0.9476, 0.0044, 3, 0.09, 1.0, 593, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_report_error", "arg_names": [], "import_names": [], "rhs_call_name": "_report_error", "annotation": ""}, "snippet": " self._report_error(method)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L219_C4", "label": "_report_error", "type": "function", "loc": [219, 223], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:ClassDef_L178_C0", "vector": [2, 1, 0.9651, 0.0218, 1, 0.06, 0.8333, 593, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "_report_error", "arg_names": ["self", "method"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _report_error(self, method):\n message, details = utils.get_error_details()\n LOGGER.error(\"Method '%s' of listener '%s' failed and is disabled: %s\"\n % (method.__name__, self.name, message))\n LOGGER.info(\"Details:\\n%s\" % details)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Assign_L220_C8", "label": "message, details = get_error_details()", "type": "assigned_variable", "loc": [220, 220], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L219_C4", "vector": [14, 2, 0.9607, 0.0044, 2, 0.32, 0.0, 693, 3, 0, 0, 0, 692, 10, 1], "semantic": {"name": "message, details", "arg_names": [], "import_names": [], "rhs_call_name": "get_error_details", "annotation": ""}, "snippet": " message, details = utils.get_error_details()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Expr_L221_C8", "label": "error()", "type": "expression", "loc": [221, 222], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L219_C4", "vector": [8, 2, 0.9672, 0.0087, 2, 0.32, 0.5, 771, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "error", "arg_names": [], "import_names": [], "rhs_call_name": "error", "annotation": ""}, "snippet": " LOGGER.error(\"Method '%s' of listener '%s' failed and is disabled: %s\"\n % (method.__name__, self.name, message))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Expr_L223_C8", "label": "info()", "type": "expression", "loc": [223, 223], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L219_C4", "vector": [8, 2, 0.9738, 0.0044, 2, 0.32, 1.0, 730, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "info", "annotation": ""}, "snippet": " LOGGER.info(\"Details:\\n%s\" % details)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L225_C4", "label": "_to_map", "type": "function", "loc": [225, 229], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:ClassDef_L178_C0", "vector": [2, 1, 0.9913, 0.0218, 1, 0.06, 1.0, 509, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "_to_map", "arg_names": ["self", "dictionary"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _to_map(self, dictionary):\n map = HashMap()\n for key, value in dictionary.iteritems():\n map.put(key, value)\n return map"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Assign_L226_C8", "label": "map = HashMap()", "type": "assigned_variable", "loc": [226, 226], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L225_C4", "vector": [14, 2, 0.9869, 0.0044, 2, 0.87, 0.0, 53, 3, 0, 0, 0, 219, 10, 1], "semantic": {"name": "map", "arg_names": [], "import_names": [], "rhs_call_name": "HashMap", "annotation": ""}, "snippet": " map = HashMap()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:For_L227_C8", "label": "for key, value", "type": "for", "loc": [227, 228], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L225_C4", "vector": [6, 2, 0.9934, 0.0087, 2, 0.87, 0.5, 839, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "key, value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for key, value in dictionary.iteritems():\n map.put(key, value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Expr_L228_C12", "label": "put()", "type": "expression", "loc": [228, 228], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:For_L227_C8", "vector": [8, 3, 0.9956, 0.0044, 3, 0.03, 0.0, 636, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "put", "arg_names": [], "import_names": [], "rhs_call_name": "put", "annotation": ""}, "snippet": " map.put(key, value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99903:Return_L229_C8", "label": "return", "type": "return", "loc": [229, 229], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L225_C4", "vector": [13, 2, 1.0, 0.0044, 2, 0.87, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return map"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:ImportFrom_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:ImportFrom_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Assign_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Assign_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Assign_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Assign_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Assign_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Return_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Assign_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:For_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:For_L42_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Try_L43_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:Try_L43_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Expr_L44_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:Try_L43_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Assign_L46_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:Try_L43_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L47_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:Try_L43_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Expr_L49_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:Try_L43_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Expr_L51_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Return_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:For_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:For_L55_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L56_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L56_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Expr_L57_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L56_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Assign_L59_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L56_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Expr_L60_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L56_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Expr_L63_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L65_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:For_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:For_L66_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L67_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L67_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Expr_L68_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L67_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Assign_L71_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L67_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Expr_L72_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L67_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Expr_L73_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Assign_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:For_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:For_L77_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L78_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L78_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Expr_L79_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L78_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Assign_L81_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L78_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Expr_L82_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L84_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Assign_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:For_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:For_L86_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L87_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L87_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Expr_L88_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L87_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Assign_L90_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L87_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Expr_L91_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L93_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L93_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:For_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:For_L94_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L95_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L95_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Expr_L96_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L95_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Assign_L98_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L95_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Assign_L99_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L95_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Expr_L100_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L102_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:For_L103_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:For_L103_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L104_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L104_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Expr_L105_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L104_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Assign_L107_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L104_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Assign_L108_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L104_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Expr_L109_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L111_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L115_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L115_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Return_L116_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Assign_L117_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Assign_L118_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Return_L119_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L121_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Return_L122_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L125_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L125_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:For_L126_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:For_L126_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L127_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L127_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Expr_L128_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L130_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L130_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:For_L131_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:For_L131_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L132_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L132_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Expr_L133_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L135_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L135_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Return_L136_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L139_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L139_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:For_L140_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:For_L140_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Expr_L141_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L143_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:For_L144_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:For_L144_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Expr_L145_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L147_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Return_L148_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L150_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L150_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Return_L151_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L153_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Assign_L154_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Return_L155_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L157_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L157_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Assign_L158_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L157_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:For_L159_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:For_L159_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L160_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L160_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Expr_L161_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L160_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Expr_L163_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L157_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Return_L164_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L166_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L166_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Assign_L167_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L166_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Return_L168_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L170_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L170_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L171_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L171_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Return_L172_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L170_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L173_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L173_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Return_L174_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L170_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Return_L175_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:ClassDef_L178_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Assign_L179_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:ClassDef_L178_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L184_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L184_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Assign_L185_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L184_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Expr_L186_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L184_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Assign_L187_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L184_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Assign_L188_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L184_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Assign_L189_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L184_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Assign_L190_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:ClassDef_L178_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L192_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L192_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Assign_L193_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L192_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L194_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L194_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Assign_L195_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L194_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L196_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L192_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Expr_L198_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L192_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Return_L200_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:ClassDef_L178_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L202_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L202_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Try_L203_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:Try_L203_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Return_L204_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:Try_L203_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Return_L206_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:ClassDef_L178_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L208_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L208_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L209_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L209_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Return_L210_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L208_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L211_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:If_L211_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Assign_L212_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L208_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Try_L213_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:Try_L213_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Expr_L214_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:Try_L213_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Expr_L216_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:Try_L213_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Expr_L217_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:ClassDef_L178_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L219_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L219_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Assign_L220_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L219_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Expr_L221_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L219_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Expr_L223_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:ClassDef_L178_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L225_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Assign_L226_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:For_L227_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:For_L227_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Expr_L228_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99903:FunctionDef_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99903:Return_L229_C8"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Module to configure Python's standard `logging` module.
After this module is imported, messages logged with `logging` module
are, by default, propagated to Robot's log file.
"""
import logging
from robot.api import logger
class RobotHandler(logging.Handler):
def emit(self, record):
method = self._get_logger_method(record.levelno)
method(record.getMessage())
def _get_logger_method(self, level):
if level >= logging.WARNING:
return logger.warn
if level <= logging.DEBUG:
return logger.debug
return logger.info
class NullStream(object):
def write(self, message):
pass
def close(self):
pass
def flush(self):
pass
logging.basicConfig(level=logging.NOTSET, stream=NullStream())
logging.getLogger().addHandler(RobotHandler())
| ajibawa-2023/Python-Code-Large/train/row_99904 | 19 | 53 | 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_99904:Expr_L15_C0", "label": "expression", "type": "expression", "loc": [15, 19], "level": 0, "parent": null, "vector": [8, 0, 0.3208, 0.0943, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"Module to configure Python's standard `logging` module.\n\nAfter this module is imported, messages logged with `logging` module\nare, by default, propagated to Robot's log file.\n\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99904:Import_L21_C0", "label": "logging import logging", "type": "import", "loc": [21, 21], "level": 0, "parent": null, "vector": [1, 0, 0.3962, 0.0189, 0, 0.66, 0.1667, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "logging", "arg_names": [], "import_names": ["logging"], "rhs_call_name": "", "annotation": ""}, "snippet": "import logging"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99904:ImportFrom_L23_C0", "label": "from robot.api import logger", "type": "import", "loc": [23, 23], "level": 0, "parent": null, "vector": [1, 0, 0.434, 0.0189, 0, 0.66, 0.3333, 855, 0, 1, 0, 0, 855, 0, 0], "semantic": {"name": "robot.api", "arg_names": [], "import_names": ["logger"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot.api import logger"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99904:ClassDef_L26_C0", "label": "RobotHandler", "type": "class", "loc": [26, 37], "level": 0, "parent": null, "vector": [3, 0, 0.5943, 0.2264, 0, 0.66, 0.5, 542, 0, 2, 0, 0, 981, 0, 3], "semantic": {"name": "RobotHandler", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class RobotHandler(logging.Handler):\n\n def emit(self, record):\n method = self._get_logger_method(record.levelno)\n method(record.getMessage())\n\n def _get_logger_method(self, level):\n if level >= logging.WARNING:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99904:FunctionDef_L28_C4", "label": "emit", "type": "function", "loc": [28, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99904:ClassDef_L26_C0", "vector": [2, 1, 0.5472, 0.0566, 1, 0.28, 0.0, 627, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "emit", "arg_names": ["self", "record"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def emit(self, record):\n method = self._get_logger_method(record.levelno)\n method(record.getMessage())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99904:Assign_L29_C8", "label": "method = _get_logger_method()", "type": "assigned_variable", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99904:FunctionDef_L28_C4", "vector": [14, 2, 0.5472, 0.0189, 2, 0.4, 0.0, 445, 3, 1, 0, 0, 894, 10, 1], "semantic": {"name": "method", "arg_names": [], "import_names": [], "rhs_call_name": "_get_logger_method", "annotation": ""}, "snippet": " method = self._get_logger_method(record.levelno)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99904:Expr_L30_C8", "label": "method()", "type": "expression", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99904:FunctionDef_L28_C4", "vector": [8, 2, 0.566, 0.0189, 2, 0.4, 1.0, 445, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "method", "arg_names": [], "import_names": [], "rhs_call_name": "method", "annotation": ""}, "snippet": " method(record.getMessage())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99904:FunctionDef_L32_C4", "label": "_get_logger_method", "type": "function", "loc": [32, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99904:ClassDef_L26_C0", "vector": [2, 1, 0.6509, 0.1132, 1, 0.28, 1.0, 894, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "_get_logger_method", "arg_names": ["self", "level"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_logger_method(self, level):\n if level >= logging.WARNING:\n return logger.warn\n if level <= logging.DEBUG:\n return logger.debug\n return logger.info"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99904:If_L33_C8", "label": "if", "type": "if", "loc": [33, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99904:FunctionDef_L32_C4", "vector": [4, 2, 0.6321, 0.0377, 2, 0.4, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if level >= logging.WARNING:\n return logger.warn"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99904:Return_L34_C12", "label": "return", "type": "return", "loc": [34, 34], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99904:If_L33_C8", "vector": [13, 3, 0.6415, 0.0189, 3, 0.4, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return logger.warn"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99904:If_L35_C8", "label": "if", "type": "if", "loc": [35, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99904:FunctionDef_L32_C4", "vector": [4, 2, 0.6698, 0.0377, 2, 0.4, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if level <= logging.DEBUG:\n return logger.debug"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99904:Return_L36_C12", "label": "return", "type": "return", "loc": [36, 36], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99904:If_L35_C8", "vector": [13, 3, 0.6792, 0.0189, 3, 0.62, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return logger.debug"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99904:Return_L37_C8", "label": "return", "type": "return", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99904:FunctionDef_L32_C4", "vector": [13, 2, 0.6981, 0.0189, 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 logger.info"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99904:ClassDef_L40_C0", "label": "NullStream", "type": "class", "loc": [40, 49], "level": 0, "parent": null, "vector": [3, 0, 0.8396, 0.1887, 0, 0.66, 0.6667, 337, 0, 3, 0, 0, 186, 0, 0], "semantic": {"name": "NullStream", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class NullStream(object):\n\n def write(self, message):\n pass\n\n def close(self):\n pass\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99904:FunctionDef_L42_C4", "label": "write", "type": "function", "loc": [42, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99904:ClassDef_L40_C0", "vector": [2, 1, 0.8019, 0.0377, 1, 0.85, 0.0, 837, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "write", "arg_names": ["self", "message"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def write(self, message):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99904:FunctionDef_L45_C4", "label": "close", "type": "function", "loc": [45, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99904:ClassDef_L40_C0", "vector": [2, 1, 0.8585, 0.0377, 1, 0.85, 0.5, 77, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "close", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def close(self):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99904:FunctionDef_L48_C4", "label": "flush", "type": "function", "loc": [48, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99904:ClassDef_L40_C0", "vector": [2, 1, 0.9151, 0.0377, 1, 0.85, 1.0, 439, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "flush", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def flush(self):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99904:Expr_L52_C0", "label": "basicConfig()", "type": "expression", "loc": [52, 52], "level": 0, "parent": null, "vector": [8, 0, 0.9811, 0.0189, 0, 0.66, 0.8333, 256, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "basicConfig", "arg_names": [], "import_names": [], "rhs_call_name": "basicConfig", "annotation": ""}, "snippet": "logging.basicConfig(level=logging.NOTSET, stream=NullStream())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99904:Expr_L53_C0", "label": "addHandler()", "type": "expression", "loc": [53, 53], "level": 0, "parent": null, "vector": [8, 0, 1.0, 0.0189, 0, 0.66, 1.0, 255, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "addHandler", "arg_names": [], "import_names": [], "rhs_call_name": "addHandler", "annotation": ""}, "snippet": "logging.getLogger().addHandler(RobotHandler())"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99904:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99904:FunctionDef_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99904:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99904:Assign_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99904:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99904:Expr_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99904:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99904:FunctionDef_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99904:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99904:If_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99904:If_L33_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99904:Return_L34_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99904:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99904:If_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99904:If_L35_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99904:Return_L36_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99904:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99904:Return_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99904:ClassDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99904:FunctionDef_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99904:ClassDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99904:FunctionDef_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99904:ClassDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99904:FunctionDef_L48_C4"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import os
from robot import utils
from loggerhelper import AbstractLogger, AbstractLoggerProxy, Message
from filelogger import FileLogger
from monitor import CommandLineMonitor
class Logger(AbstractLogger):
"""A global logger proxy to which new loggers may be registered.
Whenever something is written to LOGGER in code, all registered loggers are
notified. Messages are also cached and cached messages written to new
loggers when they are registered.
Tools using Robot Framework's internal modules should register their own
loggers at least to get notifications about errors and warnings. A shortcut
to get errors/warnings into console is using 'register_console_logger'.
"""
def __init__(self):
self._loggers = LoggerCollection()
self._message_cache = []
self._register_console_logger()
self._console_logger_disabled = False
def disable_message_cache(self):
self._message_cache = None
def disable_automatic_console_logger(self):
if not self._console_logger_disabled:
self._console_logger_disabled = True
return self._loggers.remove_first_regular_logger()
def register_logger(self, *loggers):
for log in loggers:
logger = self._loggers.register_regular_logger(log)
self._relay_cached_messages_to(logger)
def register_context_changing_logger(self, logger):
log = self._loggers.register_context_changing_logger(logger)
self._relay_cached_messages_to(log)
def _relay_cached_messages_to(self, logger):
if self._message_cache:
for msg in self._message_cache:
logger.message(msg)
def unregister_logger(self, *loggers):
for log in loggers:
self._loggers.unregister_logger(log)
def register_console_logger(self, width=78, colors='AUTO'):
self.disable_automatic_console_logger()
self._register_console_logger(width, colors)
def _register_console_logger(self, width=78, colors='AUTO'):
monitor = CommandLineMonitor(width, colors)
self._loggers.register_regular_logger(monitor)
def register_file_logger(self, path=None, level='INFO'):
if not path:
path = os.environ.get('ROBOT_SYSLOG_FILE', 'NONE')
level = os.environ.get('ROBOT_SYSLOG_LEVEL', level)
if path.upper() == 'NONE':
return
try:
logger = FileLogger(path, level)
except:
self.error("Opening syslog file '%s' failed: %s"
% (path, utils.get_error_message()))
else:
self.register_logger(logger)
def message(self, msg):
"""Messages about what the framework is doing, warnings, errors, ..."""
for logger in self._loggers.all_loggers():
logger.message(msg)
if self._message_cache is not None:
self._message_cache.append(msg)
def log_message(self, msg):
"""Log messages written (mainly) by libraries"""
for logger in self._loggers.all_loggers():
logger.log_message(msg)
if msg.level == 'WARN':
msg.linkable = True
self.message(msg)
def warn(self, msg, log=False):
method = self.log_message if log else self.message
method(Message(msg, 'WARN'))
def output_file(self, name, path):
"""Finished output, report, log, debug, or xunit file"""
for logger in self._loggers.all_loggers():
logger.output_file(name, path)
def close(self):
for logger in self._loggers.all_loggers():
logger.close()
self._loggers = LoggerCollection()
self._message_cache = []
def start_suite(self, suite):
for logger in self._loggers.starting_loggers():
logger.start_suite(suite)
def end_suite(self, suite):
for logger in self._loggers.ending_loggers():
logger.end_suite(suite)
def start_test(self, test):
for logger in self._loggers.starting_loggers():
logger.start_test(test)
def end_test(self, test):
for logger in self._loggers.ending_loggers():
logger.end_test(test)
def start_keyword(self, keyword):
for logger in self._loggers.starting_loggers():
logger.start_keyword(keyword)
def end_keyword(self, keyword):
for logger in self._loggers.ending_loggers():
logger.end_keyword(keyword)
def __iter__(self):
return iter(self._loggers)
class LoggerCollection(object):
def __init__(self):
self._regular_loggers = []
self._context_changing_loggers = []
def register_regular_logger(self, logger):
self._regular_loggers.append(_LoggerProxy(logger))
return self._regular_loggers[-1]
def register_context_changing_logger(self, logger):
self._context_changing_loggers.append(_LoggerProxy(logger))
return self._context_changing_loggers[-1]
def remove_first_regular_logger(self):
return self._regular_loggers.pop(0)
def unregister_logger(self, logger):
self._regular_loggers = [proxy for proxy in self._regular_loggers
if proxy.logger is not logger]
self._context_changing_loggers = [proxy for proxy
in self._context_changing_loggers
if proxy.logger is not logger]
def starting_loggers(self):
return self.all_loggers()
def ending_loggers(self):
return self._regular_loggers + self._context_changing_loggers
def all_loggers(self):
return self._context_changing_loggers + self._regular_loggers
def __iter__(self):
return iter(self.all_loggers())
class _LoggerProxy(AbstractLoggerProxy):
_methods = ['message', 'log_message', 'output_file', 'close',
'start_suite', 'end_suite', 'start_test', 'end_test',
'start_keyword', 'end_keyword']
LOGGER = Logger()
| ajibawa-2023/Python-Code-Large/train/row_99905 | 119 | 192 | 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_99905:Import_L16_C0", "label": "os import os", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.0833, 0.0052, 0, 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_99905:ImportFrom_L18_C0", "label": "from robot import utils", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.0938, 0.0052, 0, 0.66, 0.125, 735, 0, 1, 0, 0, 735, 0, 0], "semantic": {"name": "robot", "arg_names": [], "import_names": ["utils"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot import utils"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:ImportFrom_L20_C0", "label": "from loggerhelper import AbstractLogger, AbstractLoggerProxy, Message", "type": "import", "loc": [20, 20], "level": 0, "parent": null, "vector": [1, 0, 0.1042, 0.0052, 0, 0.66, 0.25, 426, 0, 3, 0, 0, 426, 0, 0], "semantic": {"name": "loggerhelper", "arg_names": [], "import_names": ["AbstractLogger", "AbstractLoggerProxy", "Message"], "rhs_call_name": "", "annotation": ""}, "snippet": "from loggerhelper import AbstractLogger, AbstractLoggerProxy, Message"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:ImportFrom_L21_C0", "label": "from filelogger import FileLogger", "type": "import", "loc": [21, 21], "level": 0, "parent": null, "vector": [1, 0, 0.1094, 0.0052, 0, 0.66, 0.375, 445, 0, 1, 0, 0, 445, 0, 0], "semantic": {"name": "filelogger", "arg_names": [], "import_names": ["FileLogger"], "rhs_call_name": "", "annotation": ""}, "snippet": "from filelogger import FileLogger"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:ImportFrom_L22_C0", "label": "from monitor import CommandLineMonitor", "type": "import", "loc": [22, 22], "level": 0, "parent": null, "vector": [1, 0, 0.1146, 0.0052, 0, 0.66, 0.5, 68, 0, 1, 0, 0, 68, 0, 0], "semantic": {"name": "monitor", "arg_names": [], "import_names": ["CommandLineMonitor"], "rhs_call_name": "", "annotation": ""}, "snippet": "from monitor import CommandLineMonitor"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:ClassDef_L25_C0", "label": "Logger", "type": "class", "loc": [25, 146], "level": 0, "parent": null, "vector": [3, 0, 0.4453, 0.6354, 0, 0.66, 0.625, 658, 0, 22, 0, 0, 61, 0, 46], "semantic": {"name": "Logger", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Logger(AbstractLogger):\n \"\"\"A global logger proxy to which new loggers may be registered.\n\n Whenever something is written to LOGGER in code, all registered loggers are\n notified. Messages are also cached and cached messages written to new\n loggers when they are registered.\n\n Tools using Robot Framework's internal modules should register their own"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:Expr_L26_C4", "label": "expression", "type": "expression", "loc": [26, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:ClassDef_L25_C0", "vector": [8, 1, 0.1589, 0.0521, 1, 0.02, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"A global logger proxy to which new loggers may be registered.\n\n Whenever something is written to LOGGER in code, all registered loggers are\n notified. Messages are also cached and cached messages written to new\n loggers when they are registered.\n\n Tools using Robot Framework's internal modules should register their own\n loggers at least to get notifications about errors and warnings. A shortcut"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L37_C4", "label": "__init__", "type": "function", "loc": [37, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:ClassDef_L25_C0", "vector": [2, 1, 0.2031, 0.026, 1, 0.02, 0.0455, 555, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self):\n self._loggers = LoggerCollection()\n self._message_cache = []\n self._register_console_logger()\n self._console_logger_disabled = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:Assign_L38_C8", "label": "self._loggers = LoggerCollection()", "type": "assigned_variable", "loc": [38, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L37_C4", "vector": [14, 2, 0.1979, 0.0052, 2, 0.78, 0.0, 678, 3, 0, 0, 0, 287, 10, 1], "semantic": {"name": "self._loggers", "arg_names": [], "import_names": [], "rhs_call_name": "LoggerCollection", "annotation": ""}, "snippet": " self._loggers = LoggerCollection()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:Assign_L39_C8", "label": "self._message_cache =", "type": "assigned_variable", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L37_C4", "vector": [14, 2, 0.2031, 0.0052, 2, 0.78, 0.3333, 866, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self._message_cache", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._message_cache = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:Expr_L40_C8", "label": "_register_console_logger()", "type": "expression", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L37_C4", "vector": [8, 2, 0.2083, 0.0052, 2, 0.78, 0.6667, 785, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_register_console_logger", "arg_names": [], "import_names": [], "rhs_call_name": "_register_console_logger", "annotation": ""}, "snippet": " self._register_console_logger()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:Assign_L41_C8", "label": "self._console_logger_disabled =", "type": "assigned_variable", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L37_C4", "vector": [14, 2, 0.2135, 0.0052, 2, 0.78, 1.0, 396, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self._console_logger_disabled", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._console_logger_disabled = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L43_C4", "label": "disable_message_cache", "type": "function", "loc": [43, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:ClassDef_L25_C0", "vector": [2, 1, 0.2266, 0.0104, 1, 0.02, 0.0909, 205, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "disable_message_cache", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def disable_message_cache(self):\n self._message_cache = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:Assign_L44_C8", "label": "self._message_cache =", "type": "assigned_variable", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L43_C4", "vector": [14, 2, 0.2292, 0.0052, 2, 0.55, 0.0, 866, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self._message_cache", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._message_cache = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L46_C4", "label": "disable_automatic_console_logger", "type": "function", "loc": [46, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:ClassDef_L25_C0", "vector": [2, 1, 0.2474, 0.0208, 1, 0.02, 0.1364, 234, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "disable_automatic_console_logger", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def disable_automatic_console_logger(self):\n if not self._console_logger_disabled:\n self._console_logger_disabled = True\n return self._loggers.remove_first_regular_logger()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:If_L47_C8", "label": "if", "type": "if", "loc": [47, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L46_C4", "vector": [4, 2, 0.25, 0.0156, 2, 0.34, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self._console_logger_disabled:\n self._console_logger_disabled = True\n return self._loggers.remove_first_regular_logger()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:Assign_L48_C12", "label": "self._console_logger_disabled =", "type": "assigned_variable", "loc": [48, 48], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:If_L47_C8", "vector": [14, 3, 0.25, 0.0052, 3, 0.91, 0.0, 396, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self._console_logger_disabled", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._console_logger_disabled = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:Return_L49_C12", "label": "return", "type": "return", "loc": [49, 49], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:If_L47_C8", "vector": [13, 3, 0.2552, 0.0052, 3, 0.91, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._loggers.remove_first_regular_logger()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L51_C4", "label": "register_logger", "type": "function", "loc": [51, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:ClassDef_L25_C0", "vector": [2, 1, 0.2734, 0.0208, 1, 0.02, 0.1818, 587, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "register_logger", "arg_names": ["self", "loggers"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def register_logger(self, *loggers):\n for log in loggers:\n logger = self._loggers.register_regular_logger(log)\n self._relay_cached_messages_to(logger)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:For_L52_C8", "label": "for log", "type": "for", "loc": [52, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L51_C4", "vector": [6, 2, 0.276, 0.0156, 2, 0.4, 0.0, 432, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "log", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for log in loggers:\n logger = self._loggers.register_regular_logger(log)\n self._relay_cached_messages_to(logger)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:Assign_L53_C12", "label": "logger = register_regular_logger()", "type": "assigned_variable", "loc": [53, 53], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:For_L52_C8", "vector": [14, 3, 0.276, 0.0052, 3, 0.19, 0.0, 532, 3, 1, 0, 0, 477, 10, 1], "semantic": {"name": "logger", "arg_names": [], "import_names": [], "rhs_call_name": "register_regular_logger", "annotation": ""}, "snippet": " logger = self._loggers.register_regular_logger(log)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:Expr_L54_C12", "label": "_relay_cached_messages_to()", "type": "expression", "loc": [54, 54], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:For_L52_C8", "vector": [8, 3, 0.2812, 0.0052, 3, 0.19, 1.0, 144, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_relay_cached_messages_to", "arg_names": [], "import_names": [], "rhs_call_name": "_relay_cached_messages_to", "annotation": ""}, "snippet": " self._relay_cached_messages_to(logger)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L56_C4", "label": "register_context_changing_logger", "type": "function", "loc": [56, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:ClassDef_L25_C0", "vector": [2, 1, 0.2969, 0.0156, 1, 0.02, 0.2273, 263, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "register_context_changing_logger", "arg_names": ["self", "logger"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def register_context_changing_logger(self, logger):\n log = self._loggers.register_context_changing_logger(logger)\n self._relay_cached_messages_to(log)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:Assign_L57_C8", "label": "log = register_context_changing_logger()", "type": "assigned_variable", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L56_C4", "vector": [14, 2, 0.2969, 0.0052, 2, 0.45, 0.0, 432, 3, 1, 0, 0, 263, 10, 1], "semantic": {"name": "log", "arg_names": [], "import_names": [], "rhs_call_name": "register_context_changing_logger", "annotation": ""}, "snippet": " log = self._loggers.register_context_changing_logger(logger)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:Expr_L58_C8", "label": "_relay_cached_messages_to()", "type": "expression", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L56_C4", "vector": [8, 2, 0.3021, 0.0052, 2, 0.45, 1.0, 144, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_relay_cached_messages_to", "arg_names": [], "import_names": [], "rhs_call_name": "_relay_cached_messages_to", "annotation": ""}, "snippet": " self._relay_cached_messages_to(log)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L60_C4", "label": "_relay_cached_messages_to", "type": "function", "loc": [60, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:ClassDef_L25_C0", "vector": [2, 1, 0.3203, 0.0208, 1, 0.02, 0.2727, 144, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_relay_cached_messages_to", "arg_names": ["self", "logger"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _relay_cached_messages_to(self, logger):\n if self._message_cache:\n for msg in self._message_cache:\n logger.message(msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:If_L61_C8", "label": "if", "type": "if", "loc": [61, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L60_C4", "vector": [4, 2, 0.3229, 0.0156, 2, 0.24, 0.0, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._message_cache:\n for msg in self._message_cache:\n logger.message(msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:For_L62_C12", "label": "for msg", "type": "for", "loc": [62, 63], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:If_L61_C8", "vector": [6, 3, 0.3255, 0.0104, 3, 0.8, 0.0, 712, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for msg in self._message_cache:\n logger.message(msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:Expr_L63_C16", "label": "message()", "type": "expression", "loc": [63, 63], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:For_L62_C12", "vector": [8, 4, 0.3281, 0.0052, 4, 0.5, 0.0, 635, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "message", "arg_names": [], "import_names": [], "rhs_call_name": "message", "annotation": ""}, "snippet": " logger.message(msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L65_C4", "label": "unregister_logger", "type": "function", "loc": [65, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:ClassDef_L25_C0", "vector": [2, 1, 0.3438, 0.0156, 1, 0.02, 0.3182, 898, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "unregister_logger", "arg_names": ["self", "loggers"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def unregister_logger(self, *loggers):\n for log in loggers:\n self._loggers.unregister_logger(log)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:For_L66_C8", "label": "for log", "type": "for", "loc": [66, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L65_C4", "vector": [6, 2, 0.3464, 0.0104, 2, 0.9, 0.0, 432, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "log", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for log in loggers:\n self._loggers.unregister_logger(log)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:Expr_L67_C12", "label": "unregister_logger()", "type": "expression", "loc": [67, 67], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:For_L66_C8", "vector": [8, 3, 0.349, 0.0052, 3, 0.28, 0.0, 898, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "unregister_logger", "arg_names": [], "import_names": [], "rhs_call_name": "unregister_logger", "annotation": ""}, "snippet": " self._loggers.unregister_logger(log)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L69_C4", "label": "register_console_logger", "type": "function", "loc": [69, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:ClassDef_L25_C0", "vector": [2, 1, 0.3646, 0.0156, 1, 0.02, 0.3636, 745, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "register_console_logger", "arg_names": ["self", "width", "colors"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def register_console_logger(self, width=78, colors='AUTO'):\n self.disable_automatic_console_logger()\n self._register_console_logger(width, colors)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:Expr_L70_C8", "label": "disable_automatic_console_logger()", "type": "expression", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L69_C4", "vector": [8, 2, 0.3646, 0.0052, 2, 0.93, 0.0, 234, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "disable_automatic_console_logger", "arg_names": [], "import_names": [], "rhs_call_name": "disable_automatic_console_logger", "annotation": ""}, "snippet": " self.disable_automatic_console_logger()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:Expr_L71_C8", "label": "_register_console_logger()", "type": "expression", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L69_C4", "vector": [8, 2, 0.3698, 0.0052, 2, 0.93, 1.0, 785, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_register_console_logger", "arg_names": [], "import_names": [], "rhs_call_name": "_register_console_logger", "annotation": ""}, "snippet": " self._register_console_logger(width, colors)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L73_C4", "label": "_register_console_logger", "type": "function", "loc": [73, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:ClassDef_L25_C0", "vector": [2, 1, 0.3854, 0.0156, 1, 0.02, 0.4091, 785, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "_register_console_logger", "arg_names": ["self", "width", "colors"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _register_console_logger(self, width=78, colors='AUTO'):\n monitor = CommandLineMonitor(width, colors)\n self._loggers.register_regular_logger(monitor)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:Assign_L74_C8", "label": "monitor = CommandLineMonitor()", "type": "assigned_variable", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L73_C4", "vector": [14, 2, 0.3854, 0.0052, 2, 0.6, 0.0, 68, 3, 2, 0, 0, 41, 10, 1], "semantic": {"name": "monitor", "arg_names": [], "import_names": [], "rhs_call_name": "CommandLineMonitor", "annotation": ""}, "snippet": " monitor = CommandLineMonitor(width, colors)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:Expr_L75_C8", "label": "register_regular_logger()", "type": "expression", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L73_C4", "vector": [8, 2, 0.3906, 0.0052, 2, 0.6, 1.0, 477, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "register_regular_logger", "arg_names": [], "import_names": [], "rhs_call_name": "register_regular_logger", "annotation": ""}, "snippet": " self._loggers.register_regular_logger(monitor)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L77_C4", "label": "register_file_logger", "type": "function", "loc": [77, 89], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:ClassDef_L25_C0", "vector": [2, 1, 0.4323, 0.0677, 1, 0.02, 0.4545, 194, 0, 3, 0, 0, 0, 0, 7], "semantic": {"name": "register_file_logger", "arg_names": ["self", "path", "level"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def register_file_logger(self, path=None, level='INFO'):\n if not path:\n path = os.environ.get('ROBOT_SYSLOG_FILE', 'NONE')\n level = os.environ.get('ROBOT_SYSLOG_LEVEL', level)\n if path.upper() == 'NONE':\n return\n try:\n logger = FileLogger(path, level)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:If_L78_C8", "label": "if", "type": "if", "loc": [78, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L77_C4", "vector": [4, 2, 0.4115, 0.0156, 2, 0.81, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not path:\n path = os.environ.get('ROBOT_SYSLOG_FILE', 'NONE')\n level = os.environ.get('ROBOT_SYSLOG_LEVEL', level)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:Assign_L79_C12", "label": "path = get()", "type": "assigned_variable", "loc": [79, 79], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:If_L78_C8", "vector": [14, 3, 0.4115, 0.0052, 3, 0.43, 0.0, 358, 3, 2, 0, 0, 607, 10, 1], "semantic": {"name": "path", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " path = os.environ.get('ROBOT_SYSLOG_FILE', 'NONE')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:Assign_L80_C12", "label": "level = get()", "type": "assigned_variable", "loc": [80, 80], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:If_L78_C8", "vector": [14, 3, 0.4167, 0.0052, 3, 0.43, 1.0, 479, 3, 2, 0, 0, 607, 10, 1], "semantic": {"name": "level", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " level = os.environ.get('ROBOT_SYSLOG_LEVEL', level)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:If_L81_C8", "label": "if", "type": "if", "loc": [81, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L77_C4", "vector": [4, 2, 0.4245, 0.0104, 2, 0.81, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if path.upper() == 'NONE':\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:Return_L82_C12", "label": "return", "type": "return", "loc": [82, 82], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:If_L81_C8", "vector": [13, 3, 0.4271, 0.0052, 3, 0.85, 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_99905:Try_L83_C8", "label": "try", "type": "try", "loc": [83, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L77_C4", "vector": [7, 2, 0.4479, 0.0365, 2, 0.81, 1.0, 0, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n logger = FileLogger(path, level)\n except:\n self.error(\"Opening syslog file '%s' failed: %s\"\n % (path, utils.get_error_message()))\n else:\n self.register_logger(logger)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:Assign_L84_C12", "label": "logger = FileLogger()", "type": "assigned_variable", "loc": [84, 84], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:Try_L83_C8", "vector": [14, 3, 0.4375, 0.0052, 3, 0.36, 0.0, 532, 3, 2, 0, 0, 881, 10, 1], "semantic": {"name": "logger", "arg_names": [], "import_names": [], "rhs_call_name": "FileLogger", "annotation": ""}, "snippet": " logger = FileLogger(path, level)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:Expr_L86_C12", "label": "error()", "type": "expression", "loc": [86, 87], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:Try_L83_C8", "vector": [8, 3, 0.4505, 0.0104, 3, 0.36, 0.0, 771, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "error", "arg_names": [], "import_names": [], "rhs_call_name": "error", "annotation": ""}, "snippet": " self.error(\"Opening syslog file '%s' failed: %s\"\n % (path, utils.get_error_message()))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:Expr_L89_C12", "label": "register_logger()", "type": "expression", "loc": [89, 89], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:Try_L83_C8", "vector": [8, 3, 0.4635, 0.0052, 3, 0.36, 1.0, 587, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "register_logger", "arg_names": [], "import_names": [], "rhs_call_name": "register_logger", "annotation": ""}, "snippet": " self.register_logger(logger)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L91_C4", "label": "message", "type": "function", "loc": [91, 96], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:ClassDef_L25_C0", "vector": [2, 1, 0.487, 0.0312, 1, 0.02, 0.5, 635, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "message", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def message(self, msg):\n \"\"\"Messages about what the framework is doing, warnings, errors, ...\"\"\"\n for logger in self._loggers.all_loggers():\n logger.message(msg)\n if self._message_cache is not None:\n self._message_cache.append(msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:Expr_L92_C8", "label": "expression", "type": "expression", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L91_C4", "vector": [8, 2, 0.4792, 0.0052, 2, 0.27, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Messages about what the framework is doing, warnings, errors, ...\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:For_L93_C8", "label": "for logger", "type": "for", "loc": [93, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L91_C4", "vector": [6, 2, 0.487, 0.0104, 2, 0.27, 0.5, 532, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "logger", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for logger in self._loggers.all_loggers():\n logger.message(msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:Expr_L94_C12", "label": "message()", "type": "expression", "loc": [94, 94], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:For_L93_C8", "vector": [8, 3, 0.4896, 0.0052, 3, 0.77, 0.0, 635, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "message", "arg_names": [], "import_names": [], "rhs_call_name": "message", "annotation": ""}, "snippet": " logger.message(msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:If_L95_C8", "label": "if", "type": "if", "loc": [95, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L91_C4", "vector": [4, 2, 0.4974, 0.0104, 2, 0.27, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._message_cache is not None:\n self._message_cache.append(msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:Expr_L96_C12", "label": "append()", "type": "expression", "loc": [96, 96], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:If_L95_C8", "vector": [8, 3, 0.5, 0.0052, 3, 0.54, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self._message_cache.append(msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L98_C4", "label": "log_message", "type": "function", "loc": [98, 104], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:ClassDef_L25_C0", "vector": [2, 1, 0.526, 0.0365, 1, 0.02, 0.5455, 87, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "log_message", "arg_names": ["self", "msg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def log_message(self, msg):\n \"\"\"Log messages written (mainly) by libraries\"\"\"\n for logger in self._loggers.all_loggers():\n logger.log_message(msg)\n if msg.level == 'WARN':\n msg.linkable = True\n self.message(msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:Expr_L99_C8", "label": "expression", "type": "expression", "loc": [99, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L98_C4", "vector": [8, 2, 0.5156, 0.0052, 2, 0.06, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Log messages written (mainly) by libraries\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:For_L100_C8", "label": "for logger", "type": "for", "loc": [100, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L98_C4", "vector": [6, 2, 0.5234, 0.0104, 2, 0.06, 0.5, 532, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "logger", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for logger in self._loggers.all_loggers():\n logger.log_message(msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:Expr_L101_C12", "label": "log_message()", "type": "expression", "loc": [101, 101], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:For_L100_C8", "vector": [8, 3, 0.526, 0.0052, 3, 0.98, 0.0, 87, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "log_message", "arg_names": [], "import_names": [], "rhs_call_name": "log_message", "annotation": ""}, "snippet": " logger.log_message(msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:If_L102_C8", "label": "if", "type": "if", "loc": [102, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L98_C4", "vector": [4, 2, 0.5365, 0.0156, 2, 0.06, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if msg.level == 'WARN':\n msg.linkable = True\n self.message(msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:Assign_L103_C12", "label": "msg.linkable =", "type": "assigned_variable", "loc": [103, 103], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:If_L102_C8", "vector": [14, 3, 0.5365, 0.0052, 3, 0.88, 0.0, 676, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "msg.linkable", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " msg.linkable = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:Expr_L104_C12", "label": "message()", "type": "expression", "loc": [104, 104], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:If_L102_C8", "vector": [8, 3, 0.5417, 0.0052, 3, 0.88, 1.0, 635, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "message", "arg_names": [], "import_names": [], "rhs_call_name": "message", "annotation": ""}, "snippet": " self.message(msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L106_C4", "label": "warn", "type": "function", "loc": [106, 108], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:ClassDef_L25_C0", "vector": [2, 1, 0.5573, 0.0156, 1, 0.02, 0.5909, 960, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "warn", "arg_names": ["self", "msg", "log"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def warn(self, msg, log=False):\n method = self.log_message if log else self.message\n method(Message(msg, 'WARN'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:Assign_L107_C8", "label": "method =", "type": "assigned_variable", "loc": [107, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L106_C4", "vector": [14, 2, 0.5573, 0.0052, 2, 0.49, 0.0, 445, 8, 0, 0, 0, 0, 0, 0], "semantic": {"name": "method", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " method = self.log_message if log else self.message"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:Expr_L108_C8", "label": "method()", "type": "expression", "loc": [108, 108], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L106_C4", "vector": [8, 2, 0.5625, 0.0052, 2, 0.49, 1.0, 445, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "method", "arg_names": [], "import_names": [], "rhs_call_name": "method", "annotation": ""}, "snippet": " method(Message(msg, 'WARN'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L110_C4", "label": "output_file", "type": "function", "loc": [110, 113], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:ClassDef_L25_C0", "vector": [2, 1, 0.5807, 0.0208, 1, 0.02, 0.6364, 395, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "output_file", "arg_names": ["self", "name", "path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def output_file(self, name, path):\n \"\"\"Finished output, report, log, debug, or xunit file\"\"\"\n for logger in self._loggers.all_loggers():\n logger.output_file(name, path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:Expr_L111_C8", "label": "expression", "type": "expression", "loc": [111, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L110_C4", "vector": [8, 2, 0.5781, 0.0052, 2, 0.46, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Finished output, report, log, debug, or xunit file\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:For_L112_C8", "label": "for logger", "type": "for", "loc": [112, 113], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L110_C4", "vector": [6, 2, 0.5859, 0.0104, 2, 0.46, 1.0, 532, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "logger", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for logger in self._loggers.all_loggers():\n logger.output_file(name, path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:Expr_L113_C12", "label": "output_file()", "type": "expression", "loc": [113, 113], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:For_L112_C8", "vector": [8, 3, 0.5885, 0.0052, 3, 0.32, 0.0, 395, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "output_file", "arg_names": [], "import_names": [], "rhs_call_name": "output_file", "annotation": ""}, "snippet": " logger.output_file(name, path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L115_C4", "label": "close", "type": "function", "loc": [115, 119], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:ClassDef_L25_C0", "vector": [2, 1, 0.6094, 0.026, 1, 0.02, 0.6818, 77, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "close", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def close(self):\n for logger in self._loggers.all_loggers():\n logger.close()\n self._loggers = LoggerCollection()\n self._message_cache = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:For_L116_C8", "label": "for logger", "type": "for", "loc": [116, 117], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L115_C4", "vector": [6, 2, 0.6068, 0.0104, 2, 0.49, 0.0, 532, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "logger", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for logger in self._loggers.all_loggers():\n logger.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:Expr_L117_C12", "label": "close()", "type": "expression", "loc": [117, 117], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:For_L116_C8", "vector": [8, 3, 0.6094, 0.0052, 3, 0.71, 0.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " logger.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:Assign_L118_C8", "label": "self._loggers = LoggerCollection()", "type": "assigned_variable", "loc": [118, 118], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L115_C4", "vector": [14, 2, 0.6146, 0.0052, 2, 0.49, 0.5, 678, 3, 0, 0, 0, 287, 10, 1], "semantic": {"name": "self._loggers", "arg_names": [], "import_names": [], "rhs_call_name": "LoggerCollection", "annotation": ""}, "snippet": " self._loggers = LoggerCollection()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:Assign_L119_C8", "label": "self._message_cache =", "type": "assigned_variable", "loc": [119, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L115_C4", "vector": [14, 2, 0.6198, 0.0052, 2, 0.49, 1.0, 866, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self._message_cache", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._message_cache = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L121_C4", "label": "start_suite", "type": "function", "loc": [121, 123], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:ClassDef_L25_C0", "vector": [2, 1, 0.6354, 0.0156, 1, 0.02, 0.7273, 38, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "start_suite", "arg_names": ["self", "suite"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start_suite(self, suite):\n for logger in self._loggers.starting_loggers():\n logger.start_suite(suite)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:For_L122_C8", "label": "for logger", "type": "for", "loc": [122, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L121_C4", "vector": [6, 2, 0.638, 0.0104, 2, 0.96, 0.0, 532, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "logger", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for logger in self._loggers.starting_loggers():\n logger.start_suite(suite)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:Expr_L123_C12", "label": "start_suite()", "type": "expression", "loc": [123, 123], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:For_L122_C8", "vector": [8, 3, 0.6406, 0.0052, 3, 0.69, 0.0, 38, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "start_suite", "arg_names": [], "import_names": [], "rhs_call_name": "start_suite", "annotation": ""}, "snippet": " logger.start_suite(suite)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L125_C4", "label": "end_suite", "type": "function", "loc": [125, 127], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:ClassDef_L25_C0", "vector": [2, 1, 0.6562, 0.0156, 1, 0.02, 0.7727, 81, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "end_suite", "arg_names": ["self", "suite"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end_suite(self, suite):\n for logger in self._loggers.ending_loggers():\n logger.end_suite(suite)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:For_L126_C8", "label": "for logger", "type": "for", "loc": [126, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L125_C4", "vector": [6, 2, 0.6589, 0.0104, 2, 0.37, 0.0, 532, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "logger", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for logger in self._loggers.ending_loggers():\n logger.end_suite(suite)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:Expr_L127_C12", "label": "end_suite()", "type": "expression", "loc": [127, 127], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:For_L126_C8", "vector": [8, 3, 0.6615, 0.0052, 3, 0.94, 0.0, 81, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "end_suite", "arg_names": [], "import_names": [], "rhs_call_name": "end_suite", "annotation": ""}, "snippet": " logger.end_suite(suite)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L129_C4", "label": "start_test", "type": "function", "loc": [129, 131], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:ClassDef_L25_C0", "vector": [2, 1, 0.6771, 0.0156, 1, 0.02, 0.8182, 246, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "start_test", "arg_names": ["self", "test"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start_test(self, test):\n for logger in self._loggers.starting_loggers():\n logger.start_test(test)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:For_L130_C8", "label": "for logger", "type": "for", "loc": [130, 131], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L129_C4", "vector": [6, 2, 0.6797, 0.0104, 2, 0.52, 0.0, 532, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "logger", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for logger in self._loggers.starting_loggers():\n logger.start_test(test)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:Expr_L131_C12", "label": "start_test()", "type": "expression", "loc": [131, 131], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:For_L130_C8", "vector": [8, 3, 0.6823, 0.0052, 3, 0.1, 0.0, 246, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "start_test", "arg_names": [], "import_names": [], "rhs_call_name": "start_test", "annotation": ""}, "snippet": " logger.start_test(test)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L133_C4", "label": "end_test", "type": "function", "loc": [133, 135], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:ClassDef_L25_C0", "vector": [2, 1, 0.6979, 0.0156, 1, 0.02, 0.8636, 220, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "end_test", "arg_names": ["self", "test"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end_test(self, test):\n for logger in self._loggers.ending_loggers():\n logger.end_test(test)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:For_L134_C8", "label": "for logger", "type": "for", "loc": [134, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L133_C4", "vector": [6, 2, 0.7005, 0.0104, 2, 0.67, 0.0, 532, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "logger", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for logger in self._loggers.ending_loggers():\n logger.end_test(test)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:Expr_L135_C12", "label": "end_test()", "type": "expression", "loc": [135, 135], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:For_L134_C8", "vector": [8, 3, 0.7031, 0.0052, 3, 0.56, 0.0, 220, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "end_test", "arg_names": [], "import_names": [], "rhs_call_name": "end_test", "annotation": ""}, "snippet": " logger.end_test(test)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L137_C4", "label": "start_keyword", "type": "function", "loc": [137, 139], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:ClassDef_L25_C0", "vector": [2, 1, 0.7188, 0.0156, 1, 0.02, 0.9091, 776, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "start_keyword", "arg_names": ["self", "keyword"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start_keyword(self, keyword):\n for logger in self._loggers.starting_loggers():\n logger.start_keyword(keyword)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:For_L138_C8", "label": "for logger", "type": "for", "loc": [138, 139], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L137_C4", "vector": [6, 2, 0.7214, 0.0104, 2, 0.91, 0.0, 532, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "logger", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for logger in self._loggers.starting_loggers():\n logger.start_keyword(keyword)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:Expr_L139_C12", "label": "start_keyword()", "type": "expression", "loc": [139, 139], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:For_L138_C8", "vector": [8, 3, 0.724, 0.0052, 3, 0.71, 0.0, 776, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "start_keyword", "arg_names": [], "import_names": [], "rhs_call_name": "start_keyword", "annotation": ""}, "snippet": " logger.start_keyword(keyword)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L141_C4", "label": "end_keyword", "type": "function", "loc": [141, 143], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:ClassDef_L25_C0", "vector": [2, 1, 0.7396, 0.0156, 1, 0.02, 0.9545, 959, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "end_keyword", "arg_names": ["self", "keyword"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def end_keyword(self, keyword):\n for logger in self._loggers.ending_loggers():\n logger.end_keyword(keyword)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:For_L142_C8", "label": "for logger", "type": "for", "loc": [142, 143], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L141_C4", "vector": [6, 2, 0.7422, 0.0104, 2, 0.41, 0.0, 532, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "logger", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for logger in self._loggers.ending_loggers():\n logger.end_keyword(keyword)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:Expr_L143_C12", "label": "end_keyword()", "type": "expression", "loc": [143, 143], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:For_L142_C8", "vector": [8, 3, 0.7448, 0.0052, 3, 0.45, 0.0, 959, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "end_keyword", "arg_names": [], "import_names": [], "rhs_call_name": "end_keyword", "annotation": ""}, "snippet": " logger.end_keyword(keyword)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L145_C4", "label": "__iter__", "type": "function", "loc": [145, 146], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:ClassDef_L25_C0", "vector": [2, 1, 0.7578, 0.0104, 1, 0.02, 1.0, 891, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "__iter__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __iter__(self):\n return iter(self._loggers)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:Return_L146_C8", "label": "return", "type": "return", "loc": [146, 146], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L145_C4", "vector": [13, 2, 0.7604, 0.0052, 2, 0.02, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return iter(self._loggers)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:ClassDef_L149_C0", "label": "LoggerCollection", "type": "class", "loc": [149, 183], "level": 0, "parent": null, "vector": [3, 0, 0.8646, 0.1823, 0, 0.66, 0.75, 287, 0, 9, 0, 0, 186, 0, 8], "semantic": {"name": "LoggerCollection", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class LoggerCollection(object):\n\n def __init__(self):\n self._regular_loggers = []\n self._context_changing_loggers = []\n\n def register_regular_logger(self, logger):\n self._regular_loggers.append(_LoggerProxy(logger))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L151_C4", "label": "__init__", "type": "function", "loc": [151, 153], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:ClassDef_L149_C0", "vector": [2, 1, 0.7917, 0.0156, 1, 0.42, 0.0, 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._regular_loggers = []\n self._context_changing_loggers = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:Assign_L152_C8", "label": "self._regular_loggers =", "type": "assigned_variable", "loc": [152, 152], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L151_C4", "vector": [14, 2, 0.7917, 0.0052, 2, 0.55, 0.0, 949, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self._regular_loggers", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._regular_loggers = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:Assign_L153_C8", "label": "self._context_changing_loggers =", "type": "assigned_variable", "loc": [153, 153], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L151_C4", "vector": [14, 2, 0.7969, 0.0052, 2, 0.55, 1.0, 487, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self._context_changing_loggers", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._context_changing_loggers = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L155_C4", "label": "register_regular_logger", "type": "function", "loc": [155, 157], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:ClassDef_L149_C0", "vector": [2, 1, 0.8125, 0.0156, 1, 0.42, 0.125, 477, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "register_regular_logger", "arg_names": ["self", "logger"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def register_regular_logger(self, logger):\n self._regular_loggers.append(_LoggerProxy(logger))\n return self._regular_loggers[-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:Expr_L156_C8", "label": "append()", "type": "expression", "loc": [156, 156], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L155_C4", "vector": [8, 2, 0.8125, 0.0052, 2, 0.86, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self._regular_loggers.append(_LoggerProxy(logger))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:Return_L157_C8", "label": "return", "type": "return", "loc": [157, 157], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L155_C4", "vector": [13, 2, 0.8177, 0.0052, 2, 0.86, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._regular_loggers[-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L159_C4", "label": "register_context_changing_logger", "type": "function", "loc": [159, 161], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:ClassDef_L149_C0", "vector": [2, 1, 0.8333, 0.0156, 1, 0.42, 0.25, 263, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "register_context_changing_logger", "arg_names": ["self", "logger"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def register_context_changing_logger(self, logger):\n self._context_changing_loggers.append(_LoggerProxy(logger))\n return self._context_changing_loggers[-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:Expr_L160_C8", "label": "append()", "type": "expression", "loc": [160, 160], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L159_C4", "vector": [8, 2, 0.8333, 0.0052, 2, 0.56, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self._context_changing_loggers.append(_LoggerProxy(logger))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:Return_L161_C8", "label": "return", "type": "return", "loc": [161, 161], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L159_C4", "vector": [13, 2, 0.8385, 0.0052, 2, 0.56, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._context_changing_loggers[-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L163_C4", "label": "remove_first_regular_logger", "type": "function", "loc": [163, 164], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:ClassDef_L149_C0", "vector": [2, 1, 0.8516, 0.0104, 1, 0.42, 0.375, 394, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "remove_first_regular_logger", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def remove_first_regular_logger(self):\n return self._regular_loggers.pop(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:Return_L164_C8", "label": "return", "type": "return", "loc": [164, 164], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L163_C4", "vector": [13, 2, 0.8542, 0.0052, 2, 0.01, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._regular_loggers.pop(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L166_C4", "label": "unregister_logger", "type": "function", "loc": [166, 171], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:ClassDef_L149_C0", "vector": [2, 1, 0.8776, 0.0312, 1, 0.42, 0.5, 898, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "unregister_logger", "arg_names": ["self", "logger"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def unregister_logger(self, logger):\n self._regular_loggers = [proxy for proxy in self._regular_loggers\n if proxy.logger is not logger]\n self._context_changing_loggers = [proxy for proxy\n in self._context_changing_loggers\n if proxy.logger is not logger]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:Assign_L167_C8", "label": "self._regular_loggers =", "type": "assigned_variable", "loc": [167, 168], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L166_C4", "vector": [14, 2, 0.8724, 0.0104, 2, 0.2, 0.0, 949, 5, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._regular_loggers", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._regular_loggers = [proxy for proxy in self._regular_loggers\n if proxy.logger is not logger]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:Assign_L169_C8", "label": "self._context_changing_loggers =", "type": "assigned_variable", "loc": [169, 171], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L166_C4", "vector": [14, 2, 0.8854, 0.0156, 2, 0.2, 1.0, 487, 5, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._context_changing_loggers", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._context_changing_loggers = [proxy for proxy\n in self._context_changing_loggers\n if proxy.logger is not logger]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L173_C4", "label": "starting_loggers", "type": "function", "loc": [173, 174], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:ClassDef_L149_C0", "vector": [2, 1, 0.9036, 0.0104, 1, 0.42, 0.625, 3, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "starting_loggers", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def starting_loggers(self):\n return self.all_loggers()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:Return_L174_C8", "label": "return", "type": "return", "loc": [174, 174], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L173_C4", "vector": [13, 2, 0.9062, 0.0052, 2, 0.42, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.all_loggers()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L176_C4", "label": "ending_loggers", "type": "function", "loc": [176, 177], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:ClassDef_L149_C0", "vector": [2, 1, 0.9193, 0.0104, 1, 0.42, 0.75, 601, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "ending_loggers", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def ending_loggers(self):\n return self._regular_loggers + self._context_changing_loggers"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:Return_L177_C8", "label": "return", "type": "return", "loc": [177, 177], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L176_C4", "vector": [13, 2, 0.9219, 0.0052, 2, 0.11, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._regular_loggers + self._context_changing_loggers"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L179_C4", "label": "all_loggers", "type": "function", "loc": [179, 180], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:ClassDef_L149_C0", "vector": [2, 1, 0.9349, 0.0104, 1, 0.42, 0.875, 699, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "all_loggers", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def all_loggers(self):\n return self._context_changing_loggers + self._regular_loggers"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:Return_L180_C8", "label": "return", "type": "return", "loc": [180, 180], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L179_C4", "vector": [13, 2, 0.9375, 0.0052, 2, 0.1, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._context_changing_loggers + self._regular_loggers"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L182_C4", "label": "__iter__", "type": "function", "loc": [182, 183], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:ClassDef_L149_C0", "vector": [2, 1, 0.9505, 0.0104, 1, 0.42, 1.0, 891, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "__iter__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __iter__(self):\n return iter(self.all_loggers())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:Return_L183_C8", "label": "return", "type": "return", "loc": [183, 183], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L182_C4", "vector": [13, 2, 0.9531, 0.0052, 2, 0.29, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return iter(self.all_loggers())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:ClassDef_L186_C0", "label": "_LoggerProxy", "type": "class", "loc": [186, 189], "level": 0, "parent": null, "vector": [3, 0, 0.9766, 0.0208, 0, 0.66, 0.875, 923, 0, 0, 0, 0, 7, 0, 0], "semantic": {"name": "_LoggerProxy", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _LoggerProxy(AbstractLoggerProxy):\n _methods = ['message', 'log_message', 'output_file', 'close',\n 'start_suite', 'end_suite', 'start_test', 'end_test',\n 'start_keyword', 'end_keyword']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:Assign_L187_C4", "label": "_methods =", "type": "assigned_variable", "loc": [187, 189], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99905:ClassDef_L186_C0", "vector": [14, 1, 0.9792, 0.0156, 1, 0.51, 0.0, 904, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "_methods", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _methods = ['message', 'log_message', 'output_file', 'close',\n 'start_suite', 'end_suite', 'start_test', 'end_test',\n 'start_keyword', 'end_keyword']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99905:Assign_L192_C0", "label": "LOGGER = Logger()", "type": "assigned_variable", "loc": [192, 192], "level": 0, "parent": null, "vector": [14, 0, 1.0, 0.0052, 0, 0.66, 1.0, 22, 3, 0, 0, 0, 658, 10, 1], "semantic": {"name": "LOGGER", "arg_names": [], "import_names": [], "rhs_call_name": "Logger", "annotation": ""}, "snippet": "LOGGER = Logger()"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99905:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:Expr_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:Assign_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:Assign_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:Expr_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:Assign_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:Assign_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:If_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:If_L47_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:Assign_L48_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:If_L47_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:Return_L49_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L51_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:For_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:For_L52_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:Assign_L53_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:For_L52_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:Expr_L54_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:Assign_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:Expr_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:If_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:If_L61_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:For_L62_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:For_L62_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:Expr_L63_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L65_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:For_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:For_L66_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:Expr_L67_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:Expr_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:Expr_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L73_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:Assign_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L73_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:Expr_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L77_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L77_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:If_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:If_L78_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:Assign_L79_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:If_L78_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:Assign_L80_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L77_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:If_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:If_L81_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:Return_L82_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L77_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:Try_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:Try_L83_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:Assign_L84_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:Try_L83_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:Expr_L86_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:Try_L83_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:Expr_L89_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L91_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:Expr_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:For_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:For_L93_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:Expr_L94_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:If_L95_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:If_L95_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:Expr_L96_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L98_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L98_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:Expr_L99_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L98_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:For_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:For_L100_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:Expr_L101_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L98_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:If_L102_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:If_L102_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:Assign_L103_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:If_L102_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:Expr_L104_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L106_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L106_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:Assign_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L106_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:Expr_L108_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L110_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L110_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:Expr_L111_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L110_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:For_L112_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:For_L112_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:Expr_L113_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L115_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L115_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:For_L116_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:For_L116_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:Expr_L117_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L115_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:Assign_L118_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L115_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:Assign_L119_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L121_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:For_L122_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:For_L122_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:Expr_L123_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L125_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L125_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:For_L126_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:For_L126_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:Expr_L127_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L129_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:For_L130_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:For_L130_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:Expr_L131_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L133_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L133_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:For_L134_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:For_L134_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:Expr_L135_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L137_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L137_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:For_L138_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:For_L138_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:Expr_L139_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L141_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L141_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:For_L142_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:For_L142_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:Expr_L143_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:ClassDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L145_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L145_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:Return_L146_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:ClassDef_L149_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L151_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:Assign_L152_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:Assign_L153_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:ClassDef_L149_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L155_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L155_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:Expr_L156_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L155_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:Return_L157_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:ClassDef_L149_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L159_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L159_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:Expr_L160_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L159_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:Return_L161_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:ClassDef_L149_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L163_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L163_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:Return_L164_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:ClassDef_L149_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L166_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L166_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:Assign_L167_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L166_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:Assign_L169_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:ClassDef_L149_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L173_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:Return_L174_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:ClassDef_L149_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L176_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L176_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:Return_L177_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:ClassDef_L149_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L179_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L179_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:Return_L180_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:ClassDef_L149_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L182_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:FunctionDef_L182_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:Return_L183_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99905:ClassDef_L186_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99905:Assign_L187_C4"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Windows highlighting code adapted from color_console.py. It is copyright
# Andre Burgaud, licensed under the MIT License, and available here:
# http://www.burgaud.com/bring-colors-to-the-windows-console-with-python/
import os
import sys
try:
from ctypes import windll, Structure, c_short, c_ushort, byref
except ImportError: # Not on Windows or using Jython
windll = None
def Highlighter(stream):
if os.sep == '/':
return UnixHighlighter(stream)
return DosHighlighter(stream) if windll else NoHighlighting(stream)
class UnixHighlighter(object):
_ANSI_GREEN = '\033[32m'
_ANSI_RED = '\033[31m'
_ANSI_YELLOW = '\033[33m'
_ANSI_RESET = '\033[0m'
def __init__(self, stream):
self._stream = stream
def green(self):
self._set_color(self._ANSI_GREEN)
def red(self):
self._set_color(self._ANSI_RED)
def yellow(self):
self._set_color(self._ANSI_YELLOW)
def reset(self):
self._set_color(self._ANSI_RESET)
def _set_color(self, color):
self._stream.write(color)
class NoHighlighting(UnixHighlighter):
def _set_color(self, color):
pass
class DosHighlighter(object):
_FOREGROUND_GREEN = 0x2
_FOREGROUND_RED = 0x4
_FOREGROUND_YELLOW = 0x6
_FOREGROUND_GREY = 0x7
_FOREGROUND_INTENSITY = 0x8
_BACKGROUND_MASK = 0xF0
_STDOUT_HANDLE = -11
_STDERR_HANDLE = -12
def __init__(self, stream):
self._handle = self._get_std_handle(stream)
self._orig_colors = self._get_colors()
self._background = self._orig_colors & self._BACKGROUND_MASK
def green(self):
self._set_foreground_colors(self._FOREGROUND_GREEN)
def red(self):
self._set_foreground_colors(self._FOREGROUND_RED)
def yellow(self):
self._set_foreground_colors(self._FOREGROUND_YELLOW)
def reset(self):
self._set_colors(self._orig_colors)
def _get_std_handle(self, stream):
handle = self._STDOUT_HANDLE \
if stream is sys.__stdout__ else self._STDERR_HANDLE
return windll.kernel32.GetStdHandle(handle)
def _get_colors(self):
csbi = _CONSOLE_SCREEN_BUFFER_INFO()
ok = windll.kernel32.GetConsoleScreenBufferInfo(self._handle, byref(csbi))
if not ok: # Call failed, return default console colors (gray on black)
return self._FOREGROUND_GREY
return csbi.wAttributes
def _set_foreground_colors(self, colors):
self._set_colors(colors | self._FOREGROUND_INTENSITY | self._background)
def _set_colors(self, colors):
windll.kernel32.SetConsoleTextAttribute(self._handle, colors)
if windll:
class _COORD(Structure):
_fields_ = [("X", c_short),
("Y", c_short)]
class _SMALL_RECT(Structure):
_fields_ = [("Left", c_short),
("Top", c_short),
("Right", c_short),
("Bottom", c_short)]
class _CONSOLE_SCREEN_BUFFER_INFO(Structure):
_fields_ = [("dwSize", _COORD),
("dwCursorPosition", _COORD),
("wAttributes", c_ushort),
("srWindow", _SMALL_RECT),
("dwMaximumWindowSize", _COORD)]
| ajibawa-2023/Python-Code-Large/train/row_99906 | 69 | 127 | 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_99906:Import_L19_C0", "label": "os import os", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.1496, 0.0079, 0, 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_99906:Import_L20_C0", "label": "sys import sys", "type": "import", "loc": [20, 20], "level": 0, "parent": null, "vector": [1, 0, 0.1575, 0.0079, 0, 0.66, 0.1429, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99906:Try_L21_C0", "label": "try", "type": "try", "loc": [21, 24], "level": 0, "parent": null, "vector": [7, 0, 0.1772, 0.0315, 0, 0.66, 0.2857, 0, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "try:\n from ctypes import windll, Structure, c_short, c_ushort, byref\nexcept ImportError: # Not on Windows or using Jython\n windll = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99906:ImportFrom_L22_C4", "label": "from ctypes import windll, Structure, c_short\u2026", "type": "import", "loc": [22, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99906:Try_L21_C0", "vector": [1, 1, 0.1732, 0.0079, 1, 0.18, 0.0, 182, 0, 5, 0, 0, 182, 0, 0], "semantic": {"name": "ctypes", "arg_names": [], "import_names": ["windll", "Structure", "c_short", "c_ushort", "byref"], "rhs_call_name": "", "annotation": ""}, "snippet": " from ctypes import windll, Structure, c_short, c_ushort, byref"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99906:Assign_L24_C4", "label": "windll =", "type": "assigned_variable", "loc": [24, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99906:Try_L21_C0", "vector": [14, 1, 0.189, 0.0079, 1, 0.18, 0.0, 638, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "windll", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " windll = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L27_C0", "label": "Highlighter", "type": "function", "loc": [27, 30], "level": 0, "parent": null, "vector": [2, 0, 0.2244, 0.0315, 0, 0.66, 0.4286, 718, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "Highlighter", "arg_names": ["stream"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def Highlighter(stream):\n if os.sep == '/':\n return UnixHighlighter(stream)\n return DosHighlighter(stream) if windll else NoHighlighting(stream)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99906:If_L28_C4", "label": "if", "type": "if", "loc": [28, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L27_C0", "vector": [4, 1, 0.2244, 0.0157, 1, 0.45, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if os.sep == '/':\n return UnixHighlighter(stream)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99906:Return_L29_C8", "label": "return", "type": "return", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99906:If_L28_C4", "vector": [13, 2, 0.2283, 0.0079, 2, 0.67, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return UnixHighlighter(stream)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99906:Return_L30_C4", "label": "return", "type": "return", "loc": [30, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L27_C0", "vector": [13, 1, 0.2362, 0.0079, 1, 0.45, 1.0, 0, 8, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return DosHighlighter(stream) if windll else NoHighlighting(stream)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99906:ClassDef_L33_C0", "label": "UnixHighlighter", "type": "class", "loc": [33, 55], "level": 0, "parent": null, "vector": [3, 0, 0.3465, 0.1811, 0, 0.66, 0.5714, 277, 0, 6, 0, 0, 186, 0, 5], "semantic": {"name": "UnixHighlighter", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class UnixHighlighter(object):\n _ANSI_GREEN = '\\033[32m'\n _ANSI_RED = '\\033[31m'\n _ANSI_YELLOW = '\\033[33m'\n _ANSI_RESET = '\\033[0m'\n\n def __init__(self, stream):\n self._stream = stream"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99906:Assign_L34_C4", "label": "_ANSI_GREEN =", "type": "assigned_variable", "loc": [34, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99906:ClassDef_L33_C0", "vector": [14, 1, 0.2677, 0.0079, 1, 0.5, 0.0, 851, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "_ANSI_GREEN", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _ANSI_GREEN = '\\033[32m'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99906:Assign_L35_C4", "label": "_ANSI_RED =", "type": "assigned_variable", "loc": [35, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99906:ClassDef_L33_C0", "vector": [14, 1, 0.2756, 0.0079, 1, 0.5, 0.1111, 129, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "_ANSI_RED", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _ANSI_RED = '\\033[31m'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99906:Assign_L36_C4", "label": "_ANSI_YELLOW =", "type": "assigned_variable", "loc": [36, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99906:ClassDef_L33_C0", "vector": [14, 1, 0.2835, 0.0079, 1, 0.5, 0.2222, 126, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "_ANSI_YELLOW", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _ANSI_YELLOW = '\\033[33m'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99906:Assign_L37_C4", "label": "_ANSI_RESET =", "type": "assigned_variable", "loc": [37, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99906:ClassDef_L33_C0", "vector": [14, 1, 0.2913, 0.0079, 1, 0.5, 0.3333, 630, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "_ANSI_RESET", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _ANSI_RESET = '\\033[0m'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L39_C4", "label": "__init__", "type": "function", "loc": [39, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99906:ClassDef_L33_C0", "vector": [2, 1, 0.311, 0.0157, 1, 0.5, 0.4444, 555, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "stream"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, stream):\n self._stream = stream"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99906:Assign_L40_C8", "label": "self._stream =", "type": "assigned_variable", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L39_C4", "vector": [14, 2, 0.315, 0.0079, 2, 0.5, 0.0, 214, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._stream", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._stream = stream"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L42_C4", "label": "green", "type": "function", "loc": [42, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99906:ClassDef_L33_C0", "vector": [2, 1, 0.3346, 0.0157, 1, 0.5, 0.5556, 128, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "green", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def green(self):\n self._set_color(self._ANSI_GREEN)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99906:Expr_L43_C8", "label": "_set_color()", "type": "expression", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L42_C4", "vector": [8, 2, 0.3386, 0.0079, 2, 0.94, 0.0, 530, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_set_color", "arg_names": [], "import_names": [], "rhs_call_name": "_set_color", "annotation": ""}, "snippet": " self._set_color(self._ANSI_GREEN)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L45_C4", "label": "red", "type": "function", "loc": [45, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99906:ClassDef_L33_C0", "vector": [2, 1, 0.3583, 0.0157, 1, 0.5, 0.6667, 903, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "red", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def red(self):\n self._set_color(self._ANSI_RED)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99906:Expr_L46_C8", "label": "_set_color()", "type": "expression", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L45_C4", "vector": [8, 2, 0.3622, 0.0079, 2, 0.15, 0.0, 530, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_set_color", "arg_names": [], "import_names": [], "rhs_call_name": "_set_color", "annotation": ""}, "snippet": " self._set_color(self._ANSI_RED)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L48_C4", "label": "yellow", "type": "function", "loc": [48, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99906:ClassDef_L33_C0", "vector": [2, 1, 0.3819, 0.0157, 1, 0.5, 0.7778, 825, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "yellow", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def yellow(self):\n self._set_color(self._ANSI_YELLOW)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99906:Expr_L49_C8", "label": "_set_color()", "type": "expression", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L48_C4", "vector": [8, 2, 0.3858, 0.0079, 2, 0.37, 0.0, 530, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_set_color", "arg_names": [], "import_names": [], "rhs_call_name": "_set_color", "annotation": ""}, "snippet": " self._set_color(self._ANSI_YELLOW)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L51_C4", "label": "reset", "type": "function", "loc": [51, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99906:ClassDef_L33_C0", "vector": [2, 1, 0.4055, 0.0157, 1, 0.5, 0.8889, 944, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "reset", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def reset(self):\n self._set_color(self._ANSI_RESET)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99906:Expr_L52_C8", "label": "_set_color()", "type": "expression", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L51_C4", "vector": [8, 2, 0.4094, 0.0079, 2, 0.99, 0.0, 530, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_set_color", "arg_names": [], "import_names": [], "rhs_call_name": "_set_color", "annotation": ""}, "snippet": " self._set_color(self._ANSI_RESET)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L54_C4", "label": "_set_color", "type": "function", "loc": [54, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99906:ClassDef_L33_C0", "vector": [2, 1, 0.4291, 0.0157, 1, 0.5, 1.0, 530, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_set_color", "arg_names": ["self", "color"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _set_color(self, color):\n self._stream.write(color)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99906:Expr_L55_C8", "label": "write()", "type": "expression", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L54_C4", "vector": [8, 2, 0.4331, 0.0079, 2, 0.88, 0.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " self._stream.write(color)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99906:ClassDef_L58_C0", "label": "NoHighlighting", "type": "class", "loc": [58, 61], "level": 0, "parent": null, "vector": [3, 0, 0.4685, 0.0315, 0, 0.66, 0.7143, 914, 0, 1, 0, 0, 277, 0, 0], "semantic": {"name": "NoHighlighting", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class NoHighlighting(UnixHighlighter):\n\n def _set_color(self, color):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L60_C4", "label": "_set_color", "type": "function", "loc": [60, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99906:ClassDef_L58_C0", "vector": [2, 1, 0.4764, 0.0157, 1, 0.35, 0.0, 530, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "_set_color", "arg_names": ["self", "color"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _set_color(self, color):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99906:ClassDef_L64_C0", "label": "DosHighlighter", "type": "class", "loc": [64, 107], "level": 0, "parent": null, "vector": [3, 0, 0.6732, 0.3465, 0, 0.66, 0.8571, 326, 0, 9, 0, 0, 186, 0, 12], "semantic": {"name": "DosHighlighter", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class DosHighlighter(object):\n _FOREGROUND_GREEN = 0x2\n _FOREGROUND_RED = 0x4\n _FOREGROUND_YELLOW = 0x6\n _FOREGROUND_GREY = 0x7\n _FOREGROUND_INTENSITY = 0x8\n _BACKGROUND_MASK = 0xF0\n _STDOUT_HANDLE = -11"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99906:Assign_L65_C4", "label": "_FOREGROUND_GREEN =", "type": "assigned_variable", "loc": [65, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99906:ClassDef_L64_C0", "vector": [14, 1, 0.5118, 0.0079, 1, 0.25, 0.0, 922, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "_FOREGROUND_GREEN", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _FOREGROUND_GREEN = 0x2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99906:Assign_L66_C4", "label": "_FOREGROUND_RED =", "type": "assigned_variable", "loc": [66, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99906:ClassDef_L64_C0", "vector": [14, 1, 0.5197, 0.0079, 1, 0.25, 0.0625, 507, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "_FOREGROUND_RED", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _FOREGROUND_RED = 0x4"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99906:Assign_L67_C4", "label": "_FOREGROUND_YELLOW =", "type": "assigned_variable", "loc": [67, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99906:ClassDef_L64_C0", "vector": [14, 1, 0.5276, 0.0079, 1, 0.25, 0.125, 275, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "_FOREGROUND_YELLOW", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _FOREGROUND_YELLOW = 0x6"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99906:Assign_L68_C4", "label": "_FOREGROUND_GREY =", "type": "assigned_variable", "loc": [68, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99906:ClassDef_L64_C0", "vector": [14, 1, 0.5354, 0.0079, 1, 0.25, 0.1875, 486, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "_FOREGROUND_GREY", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _FOREGROUND_GREY = 0x7"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99906:Assign_L69_C4", "label": "_FOREGROUND_INTENSITY =", "type": "assigned_variable", "loc": [69, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99906:ClassDef_L64_C0", "vector": [14, 1, 0.5433, 0.0079, 1, 0.25, 0.25, 959, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "_FOREGROUND_INTENSITY", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _FOREGROUND_INTENSITY = 0x8"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99906:Assign_L70_C4", "label": "_BACKGROUND_MASK =", "type": "assigned_variable", "loc": [70, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99906:ClassDef_L64_C0", "vector": [14, 1, 0.5512, 0.0079, 1, 0.25, 0.3125, 879, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "_BACKGROUND_MASK", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _BACKGROUND_MASK = 0xF0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99906:Assign_L71_C4", "label": "_STDOUT_HANDLE =", "type": "assigned_variable", "loc": [71, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99906:ClassDef_L64_C0", "vector": [14, 1, 0.5591, 0.0079, 1, 0.25, 0.375, 878, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "_STDOUT_HANDLE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _STDOUT_HANDLE = -11"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99906:Assign_L72_C4", "label": "_STDERR_HANDLE =", "type": "assigned_variable", "loc": [72, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99906:ClassDef_L64_C0", "vector": [14, 1, 0.5669, 0.0079, 1, 0.25, 0.4375, 795, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "_STDERR_HANDLE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _STDERR_HANDLE = -12"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L74_C4", "label": "__init__", "type": "function", "loc": [74, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99906:ClassDef_L64_C0", "vector": [2, 1, 0.5945, 0.0315, 1, 0.25, 0.5, 555, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "stream"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, stream):\n self._handle = self._get_std_handle(stream)\n self._orig_colors = self._get_colors()\n self._background = self._orig_colors & self._BACKGROUND_MASK"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99906:Assign_L75_C8", "label": "self._handle = _get_std_handle()", "type": "assigned_variable", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L74_C4", "vector": [14, 2, 0.5906, 0.0079, 2, 0.14, 0.0, 828, 3, 1, 0, 0, 506, 10, 1], "semantic": {"name": "self._handle", "arg_names": [], "import_names": [], "rhs_call_name": "_get_std_handle", "annotation": ""}, "snippet": " self._handle = self._get_std_handle(stream)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99906:Assign_L76_C8", "label": "self._orig_colors = _get_colors()", "type": "assigned_variable", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L74_C4", "vector": [14, 2, 0.5984, 0.0079, 2, 0.14, 0.5, 75, 3, 0, 0, 0, 880, 10, 1], "semantic": {"name": "self._orig_colors", "arg_names": [], "import_names": [], "rhs_call_name": "_get_colors", "annotation": ""}, "snippet": " self._orig_colors = self._get_colors()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99906:Assign_L77_C8", "label": "self._background =", "type": "assigned_variable", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L74_C4", "vector": [14, 2, 0.6063, 0.0079, 2, 0.14, 1.0, 816, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._background", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._background = self._orig_colors & self._BACKGROUND_MASK"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L79_C4", "label": "green", "type": "function", "loc": [79, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99906:ClassDef_L64_C0", "vector": [2, 1, 0.626, 0.0157, 1, 0.25, 0.5625, 128, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "green", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def green(self):\n self._set_foreground_colors(self._FOREGROUND_GREEN)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99906:Expr_L80_C8", "label": "_set_foreground_colors()", "type": "expression", "loc": [80, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L79_C4", "vector": [8, 2, 0.6299, 0.0079, 2, 0.04, 0.0, 595, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_set_foreground_colors", "arg_names": [], "import_names": [], "rhs_call_name": "_set_foreground_colors", "annotation": ""}, "snippet": " self._set_foreground_colors(self._FOREGROUND_GREEN)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L82_C4", "label": "red", "type": "function", "loc": [82, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99906:ClassDef_L64_C0", "vector": [2, 1, 0.6496, 0.0157, 1, 0.25, 0.625, 903, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "red", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def red(self):\n self._set_foreground_colors(self._FOREGROUND_RED)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99906:Expr_L83_C8", "label": "_set_foreground_colors()", "type": "expression", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L82_C4", "vector": [8, 2, 0.6535, 0.0079, 2, 0.94, 0.0, 595, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_set_foreground_colors", "arg_names": [], "import_names": [], "rhs_call_name": "_set_foreground_colors", "annotation": ""}, "snippet": " self._set_foreground_colors(self._FOREGROUND_RED)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L85_C4", "label": "yellow", "type": "function", "loc": [85, 86], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99906:ClassDef_L64_C0", "vector": [2, 1, 0.6732, 0.0157, 1, 0.25, 0.6875, 825, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "yellow", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def yellow(self):\n self._set_foreground_colors(self._FOREGROUND_YELLOW)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99906:Expr_L86_C8", "label": "_set_foreground_colors()", "type": "expression", "loc": [86, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L85_C4", "vector": [8, 2, 0.6772, 0.0079, 2, 0.01, 0.0, 595, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_set_foreground_colors", "arg_names": [], "import_names": [], "rhs_call_name": "_set_foreground_colors", "annotation": ""}, "snippet": " self._set_foreground_colors(self._FOREGROUND_YELLOW)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L88_C4", "label": "reset", "type": "function", "loc": [88, 89], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99906:ClassDef_L64_C0", "vector": [2, 1, 0.6969, 0.0157, 1, 0.25, 0.75, 944, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "reset", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def reset(self):\n self._set_colors(self._orig_colors)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99906:Expr_L89_C8", "label": "_set_colors()", "type": "expression", "loc": [89, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L88_C4", "vector": [8, 2, 0.7008, 0.0079, 2, 0.07, 0.0, 614, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_set_colors", "arg_names": [], "import_names": [], "rhs_call_name": "_set_colors", "annotation": ""}, "snippet": " self._set_colors(self._orig_colors)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L91_C4", "label": "_get_std_handle", "type": "function", "loc": [91, 94], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99906:ClassDef_L64_C0", "vector": [2, 1, 0.7283, 0.0315, 1, 0.25, 0.8125, 506, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "_get_std_handle", "arg_names": ["self", "stream"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_std_handle(self, stream):\n handle = self._STDOUT_HANDLE \\\n if stream is sys.__stdout__ else self._STDERR_HANDLE\n return windll.kernel32.GetStdHandle(handle)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99906:Assign_L92_C8", "label": "handle =", "type": "assigned_variable", "loc": [92, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L91_C4", "vector": [14, 2, 0.7283, 0.0157, 2, 0.89, 0.0, 346, 8, 0, 0, 0, 0, 0, 0], "semantic": {"name": "handle", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " handle = self._STDOUT_HANDLE \\\n if stream is sys.__stdout__ else self._STDERR_HANDLE"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99906:Return_L94_C8", "label": "return", "type": "return", "loc": [94, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L91_C4", "vector": [13, 2, 0.7402, 0.0079, 2, 0.89, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return windll.kernel32.GetStdHandle(handle)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L96_C4", "label": "_get_colors", "type": "function", "loc": [96, 101], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99906:ClassDef_L64_C0", "vector": [2, 1, 0.7756, 0.0472, 1, 0.25, 0.875, 880, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "_get_colors", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_colors(self):\n csbi = _CONSOLE_SCREEN_BUFFER_INFO()\n ok = windll.kernel32.GetConsoleScreenBufferInfo(self._handle, byref(csbi))\n if not ok: # Call failed, return default console colors (gray on black)\n return self._FOREGROUND_GREY\n return csbi.wAttributes"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99906:Assign_L97_C8", "label": "csbi = _CONSOLE_SCREEN_BUFFER_INFO()", "type": "assigned_variable", "loc": [97, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L96_C4", "vector": [14, 2, 0.7638, 0.0079, 2, 0.74, 0.0, 840, 3, 0, 0, 0, 433, 10, 1], "semantic": {"name": "csbi", "arg_names": [], "import_names": [], "rhs_call_name": "_CONSOLE_SCREEN_BUFFER_INFO", "annotation": ""}, "snippet": " csbi = _CONSOLE_SCREEN_BUFFER_INFO()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99906:Assign_L98_C8", "label": "ok = GetConsoleScreenBufferInfo()", "type": "assigned_variable", "loc": [98, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L96_C4", "vector": [14, 2, 0.7717, 0.0079, 2, 0.74, 0.3333, 208, 3, 2, 0, 0, 422, 10, 2], "semantic": {"name": "ok", "arg_names": [], "import_names": [], "rhs_call_name": "GetConsoleScreenBufferInfo", "annotation": ""}, "snippet": " ok = windll.kernel32.GetConsoleScreenBufferInfo(self._handle, byref(csbi))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99906:If_L99_C8", "label": "if", "type": "if", "loc": [99, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L96_C4", "vector": [4, 2, 0.7835, 0.0157, 2, 0.74, 0.6667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not ok: # Call failed, return default console colors (gray on black)\n return self._FOREGROUND_GREY"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99906:Return_L100_C12", "label": "return", "type": "return", "loc": [100, 100], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99906:If_L99_C8", "vector": [13, 3, 0.7874, 0.0079, 3, 0.28, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._FOREGROUND_GREY"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99906:Return_L101_C8", "label": "return", "type": "return", "loc": [101, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L96_C4", "vector": [13, 2, 0.7953, 0.0079, 2, 0.74, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return csbi.wAttributes"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L103_C4", "label": "_set_foreground_colors", "type": "function", "loc": [103, 104], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99906:ClassDef_L64_C0", "vector": [2, 1, 0.815, 0.0157, 1, 0.25, 0.9375, 595, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_set_foreground_colors", "arg_names": ["self", "colors"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _set_foreground_colors(self, colors):\n self._set_colors(colors | self._FOREGROUND_INTENSITY | self._background)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99906:Expr_L104_C8", "label": "_set_colors()", "type": "expression", "loc": [104, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L103_C4", "vector": [8, 2, 0.8189, 0.0079, 2, 0.46, 0.0, 614, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_set_colors", "arg_names": [], "import_names": [], "rhs_call_name": "_set_colors", "annotation": ""}, "snippet": " self._set_colors(colors | self._FOREGROUND_INTENSITY | self._background)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L106_C4", "label": "_set_colors", "type": "function", "loc": [106, 107], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99906:ClassDef_L64_C0", "vector": [2, 1, 0.8386, 0.0157, 1, 0.25, 1.0, 614, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_set_colors", "arg_names": ["self", "colors"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _set_colors(self, colors):\n windll.kernel32.SetConsoleTextAttribute(self._handle, colors)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99906:Expr_L107_C8", "label": "SetConsoleTextAttribute()", "type": "expression", "loc": [107, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L106_C4", "vector": [8, 2, 0.8425, 0.0079, 2, 0.38, 0.0, 653, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "SetConsoleTextAttribute", "arg_names": [], "import_names": [], "rhs_call_name": "SetConsoleTextAttribute", "annotation": ""}, "snippet": " windll.kernel32.SetConsoleTextAttribute(self._handle, colors)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99906:If_L110_C0", "label": "if", "type": "if", "loc": [110, 127], "level": 0, "parent": null, "vector": [4, 0, 0.9331, 0.1417, 0, 0.66, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if windll:\n\n class _COORD(Structure):\n _fields_ = [(\"X\", c_short),\n (\"Y\", c_short)]\n \n class _SMALL_RECT(Structure):\n _fields_ = [(\"Left\", c_short),"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99906:ClassDef_L112_C4", "label": "_COORD", "type": "class", "loc": [112, 114], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99906:If_L110_C0", "vector": [3, 1, 0.8898, 0.0236, 1, 0.19, 0.0, 948, 0, 0, 0, 0, 183, 0, 0], "semantic": {"name": "_COORD", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " class _COORD(Structure):\n _fields_ = [(\"X\", c_short),\n (\"Y\", c_short)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99906:Assign_L113_C8", "label": "_fields_ =", "type": "assigned_variable", "loc": [113, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99906:ClassDef_L112_C4", "vector": [14, 2, 0.8937, 0.0157, 2, 0.94, 0.0, 283, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "_fields_", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _fields_ = [(\"X\", c_short),\n (\"Y\", c_short)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99906:ClassDef_L116_C4", "label": "_SMALL_RECT", "type": "class", "loc": [116, 120], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99906:If_L110_C0", "vector": [3, 1, 0.9291, 0.0394, 1, 0.19, 0.5, 349, 0, 0, 0, 0, 183, 0, 0], "semantic": {"name": "_SMALL_RECT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " class _SMALL_RECT(Structure):\n _fields_ = [(\"Left\", c_short),\n (\"Top\", c_short),\n (\"Right\", c_short),\n (\"Bottom\", c_short)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99906:Assign_L117_C8", "label": "_fields_ =", "type": "assigned_variable", "loc": [117, 120], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99906:ClassDef_L116_C4", "vector": [14, 2, 0.9331, 0.0315, 2, 0.66, 0.0, 283, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "_fields_", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _fields_ = [(\"Left\", c_short),\n (\"Top\", c_short),\n (\"Right\", c_short),\n (\"Bottom\", c_short)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99906:ClassDef_L122_C4", "label": "_CONSOLE_SCREEN_BUFFER_INFO", "type": "class", "loc": [122, 127], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99906:If_L110_C0", "vector": [3, 1, 0.9803, 0.0472, 1, 0.19, 1.0, 433, 0, 0, 0, 0, 183, 0, 0], "semantic": {"name": "_CONSOLE_SCREEN_BUFFER_INFO", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " class _CONSOLE_SCREEN_BUFFER_INFO(Structure):\n _fields_ = [(\"dwSize\", _COORD),\n (\"dwCursorPosition\", _COORD),\n (\"wAttributes\", c_ushort),\n (\"srWindow\", _SMALL_RECT),\n (\"dwMaximumWindowSize\", _COORD)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99906:Assign_L123_C8", "label": "_fields_ =", "type": "assigned_variable", "loc": [123, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99906:ClassDef_L122_C4", "vector": [14, 2, 0.9843, 0.0394, 2, 0.28, 0.0, 283, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "_fields_", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _fields_ = [(\"dwSize\", _COORD),\n (\"dwCursorPosition\", _COORD),\n (\"wAttributes\", c_ushort),\n (\"srWindow\", _SMALL_RECT),\n (\"dwMaximumWindowSize\", _COORD)]"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99906:Try_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99906:ImportFrom_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99906:Try_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99906:Assign_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99906:If_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99906:If_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99906:Return_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L27_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99906:Return_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99906:ClassDef_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99906:Assign_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99906:ClassDef_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99906:Assign_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99906:ClassDef_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99906:Assign_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99906:ClassDef_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99906:Assign_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99906:ClassDef_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L39_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99906:Assign_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99906:ClassDef_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99906:Expr_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99906:ClassDef_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99906:Expr_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99906:ClassDef_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99906:Expr_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99906:ClassDef_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L51_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99906:Expr_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99906:ClassDef_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99906:Expr_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99906:ClassDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99906:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99906:Assign_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99906:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99906:Assign_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99906:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99906:Assign_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99906:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99906:Assign_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99906:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99906:Assign_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99906:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99906:Assign_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99906:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99906:Assign_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99906:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99906:Assign_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99906:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99906:Assign_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99906:Assign_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99906:Assign_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99906:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L79_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L79_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99906:Expr_L80_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99906:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L82_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99906:Expr_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99906:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L85_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99906:Expr_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99906:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L88_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L88_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99906:Expr_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99906:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L91_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99906:Assign_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99906:Return_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99906:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L96_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99906:Assign_L97_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99906:Assign_L98_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99906:If_L99_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99906:If_L99_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99906:Return_L100_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L96_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99906:Return_L101_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99906:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L103_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99906:Expr_L104_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99906:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L106_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99906:FunctionDef_L106_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99906:Expr_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99906:If_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99906:ClassDef_L112_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99906:ClassDef_L112_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99906:Assign_L113_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99906:If_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99906:ClassDef_L116_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99906:ClassDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99906:Assign_L117_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99906:If_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99906:ClassDef_L122_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99906:ClassDef_L122_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99906:Assign_L123_C8"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import re
from robot.output.loggerhelper import Message, LEVELS
from robot import utils
class StdoutLogSplitter(object):
"""Splits messages logged through stdout (or stderr) into Message objects"""
_split_from_levels = re.compile('^(?:\*'
'(%s|HTML)' # Level
'(:\d+(?:\.\d+)?)?' # Optional timestamp
'\*)' % '|'.join(LEVELS), re.MULTILINE)
def __init__(self, output):
self._messages = list(self._get_messages(output.strip()))
def _get_messages(self, output):
for level, timestamp, msg in self._split_output(output):
if timestamp:
timestamp = self._format_timestamp(timestamp[1:])
yield Message(msg.strip(), level, timestamp=timestamp)
def _split_output(self, output):
tokens = self._split_from_levels.split(output)
tokens = self._add_initial_level_and_time_if_needed(tokens)
for i in xrange(0, len(tokens), 3):
yield tokens[i:i+3]
def _add_initial_level_and_time_if_needed(self, tokens):
if self._output_started_with_level(tokens):
return tokens[1:]
return ['INFO', None] + tokens
def _output_started_with_level(self, tokens):
return tokens[0] == ''
def _format_timestamp(self, millis):
return utils.format_time(float(millis)/1000, millissep='.')
def __iter__(self):
return iter(self._messages)
| ajibawa-2023/Python-Code-Large/train/row_99907 | 28 | 56 | 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_99907:Import_L15_C0", "label": "re import re", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.2679, 0.0179, 0, 0.66, 0.0, 540, 0, 1, 0, 0, 540, 0, 0], "semantic": {"name": "re", "arg_names": [], "import_names": ["re"], "rhs_call_name": "", "annotation": ""}, "snippet": "import re"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99907:ImportFrom_L17_C0", "label": "from robot.output.loggerhelper import Message, LEVELS", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.3036, 0.0179, 0, 0.66, 0.3333, 19, 0, 2, 0, 0, 19, 0, 0], "semantic": {"name": "robot.output.loggerhelper", "arg_names": [], "import_names": ["Message", "LEVELS"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot.output.loggerhelper import Message, LEVELS"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99907:ImportFrom_L18_C0", "label": "from robot import utils", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.3214, 0.0179, 0, 0.66, 0.6667, 735, 0, 1, 0, 0, 735, 0, 0], "semantic": {"name": "robot", "arg_names": [], "import_names": ["utils"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot import utils"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99907:ClassDef_L21_C0", "label": "StdoutLogSplitter", "type": "class", "loc": [21, 56], "level": 0, "parent": null, "vector": [3, 0, 0.6875, 0.6429, 0, 0.66, 1.0, 467, 0, 7, 0, 0, 186, 0, 17], "semantic": {"name": "StdoutLogSplitter", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class StdoutLogSplitter(object):\n \"\"\"Splits messages logged through stdout (or stderr) into Message objects\"\"\"\n\n _split_from_levels = re.compile('^(?:\\*'\n '(%s|HTML)' # Level\n '(:\\d+(?:\\.\\d+)?)?' # Optional timestamp\n '\\*)' % '|'.join(LEVELS), re.MULTILINE)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99907:Expr_L22_C4", "label": "expression", "type": "expression", "loc": [22, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99907:ClassDef_L21_C0", "vector": [8, 1, 0.3929, 0.0179, 1, 0.46, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Splits messages logged through stdout (or stderr) into Message objects\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99907:Assign_L24_C4", "label": "_split_from_levels = compile()", "type": "assigned_variable", "loc": [24, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99907:ClassDef_L21_C0", "vector": [14, 1, 0.4554, 0.0714, 1, 0.46, 0.125, 345, 3, 2, 0, 0, 821, 10, 2], "semantic": {"name": "_split_from_levels", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": " _split_from_levels = re.compile('^(?:\\*'\n '(%s|HTML)' # Level\n '(:\\d+(?:\\.\\d+)?)?' # Optional timestamp\n '\\*)' % '|'.join(LEVELS), re.MULTILINE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99907:FunctionDef_L29_C4", "label": "__init__", "type": "function", "loc": [29, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99907:ClassDef_L21_C0", "vector": [2, 1, 0.5268, 0.0357, 1, 0.46, 0.25, 555, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "__init__", "arg_names": ["self", "output"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, output):\n self._messages = list(self._get_messages(output.strip()))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99907:Assign_L30_C8", "label": "self._messages = list()", "type": "assigned_variable", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99907:FunctionDef_L29_C4", "vector": [14, 2, 0.5357, 0.0179, 2, 0.72, 0.0, 812, 3, 1, 0, 0, 430, 10, 3], "semantic": {"name": "self._messages", "arg_names": [], "import_names": [], "rhs_call_name": "list", "annotation": ""}, "snippet": " self._messages = list(self._get_messages(output.strip()))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99907:FunctionDef_L32_C4", "label": "_get_messages", "type": "function", "loc": [32, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99907:ClassDef_L21_C0", "vector": [2, 1, 0.6071, 0.0893, 1, 0.46, 0.375, 988, 0, 2, 0, 0, 0, 0, 4], "semantic": {"name": "_get_messages", "arg_names": ["self", "output"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_messages(self, output):\n for level, timestamp, msg in self._split_output(output):\n if timestamp:\n timestamp = self._format_timestamp(timestamp[1:])\n yield Message(msg.strip(), level, timestamp=timestamp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99907:For_L33_C8", "label": "for level, timestamp, msg", "type": "for", "loc": [33, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99907:FunctionDef_L32_C4", "vector": [6, 2, 0.6161, 0.0714, 2, 0.35, 0.0, 847, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "level, timestamp, msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for level, timestamp, msg in self._split_output(output):\n if timestamp:\n timestamp = self._format_timestamp(timestamp[1:])\n yield Message(msg.strip(), level, timestamp=timestamp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99907:If_L34_C12", "label": "if", "type": "if", "loc": [34, 35], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99907:For_L33_C8", "vector": [4, 3, 0.6161, 0.0357, 3, 0.42, 0.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if timestamp:\n timestamp = self._format_timestamp(timestamp[1:])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99907:Assign_L35_C16", "label": "timestamp = _format_timestamp()", "type": "assigned_variable", "loc": [35, 35], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99907:If_L34_C12", "vector": [14, 4, 0.625, 0.0179, 4, 0.91, 0.0, 834, 3, 1, 0, 0, 467, 10, 1], "semantic": {"name": "timestamp", "arg_names": [], "import_names": [], "rhs_call_name": "_format_timestamp", "annotation": ""}, "snippet": " timestamp = self._format_timestamp(timestamp[1:])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99907:Expr_L36_C12", "label": "expression", "type": "expression", "loc": [36, 36], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99907:For_L33_C8", "vector": [8, 3, 0.6429, 0.0179, 3, 0.42, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " yield Message(msg.strip(), level, timestamp=timestamp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99907:FunctionDef_L38_C4", "label": "_split_output", "type": "function", "loc": [38, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99907:ClassDef_L21_C0", "vector": [2, 1, 0.7143, 0.0893, 1, 0.46, 0.5, 293, 0, 2, 0, 0, 0, 0, 4], "semantic": {"name": "_split_output", "arg_names": ["self", "output"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _split_output(self, output):\n tokens = self._split_from_levels.split(output)\n tokens = self._add_initial_level_and_time_if_needed(tokens)\n for i in xrange(0, len(tokens), 3):\n yield tokens[i:i+3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99907:Assign_L39_C8", "label": "tokens = split()", "type": "assigned_variable", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99907:FunctionDef_L38_C4", "vector": [14, 2, 0.6964, 0.0179, 2, 0.08, 0.0, 700, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "tokens", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " tokens = self._split_from_levels.split(output)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99907:Assign_L40_C8", "label": "tokens = _add_initial_level_and_time_if_needed()", "type": "assigned_variable", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99907:FunctionDef_L38_C4", "vector": [14, 2, 0.7143, 0.0179, 2, 0.08, 0.5, 700, 3, 1, 0, 0, 973, 10, 1], "semantic": {"name": "tokens", "arg_names": [], "import_names": [], "rhs_call_name": "_add_initial_level_and_time_if_needed", "annotation": ""}, "snippet": " tokens = self._add_initial_level_and_time_if_needed(tokens)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99907:For_L41_C8", "label": "for i", "type": "for", "loc": [41, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99907:FunctionDef_L38_C4", "vector": [6, 2, 0.7411, 0.0357, 2, 0.08, 1.0, 826, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for i in xrange(0, len(tokens), 3):\n yield tokens[i:i+3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99907:Expr_L42_C12", "label": "expression", "type": "expression", "loc": [42, 42], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99907:For_L41_C8", "vector": [8, 3, 0.75, 0.0179, 3, 0.35, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " yield tokens[i:i+3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99907:FunctionDef_L44_C4", "label": "_add_initial_level_and_time_if_needed", "type": "function", "loc": [44, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99907:ClassDef_L21_C0", "vector": [2, 1, 0.8125, 0.0714, 1, 0.46, 0.625, 973, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "_add_initial_level_and_time_if_needed", "arg_names": ["self", "tokens"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _add_initial_level_and_time_if_needed(self, tokens):\n if self._output_started_with_level(tokens):\n return tokens[1:]\n return ['INFO', None] + tokens"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99907:If_L45_C8", "label": "if", "type": "if", "loc": [45, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99907:FunctionDef_L44_C4", "vector": [4, 2, 0.8125, 0.0357, 2, 0.21, 0.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._output_started_with_level(tokens):\n return tokens[1:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99907:Return_L46_C12", "label": "return", "type": "return", "loc": [46, 46], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99907:If_L45_C8", "vector": [13, 3, 0.8214, 0.0179, 3, 0.93, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return tokens[1:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99907:Return_L47_C8", "label": "return", "type": "return", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99907:FunctionDef_L44_C4", "vector": [13, 2, 0.8393, 0.0179, 2, 0.21, 1.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ['INFO', None] + tokens"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99907:FunctionDef_L49_C4", "label": "_output_started_with_level", "type": "function", "loc": [49, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99907:ClassDef_L21_C0", "vector": [2, 1, 0.8839, 0.0357, 1, 0.46, 0.75, 114, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "_output_started_with_level", "arg_names": ["self", "tokens"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _output_started_with_level(self, tokens):\n return tokens[0] == ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99907:Return_L50_C8", "label": "return", "type": "return", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99907:FunctionDef_L49_C4", "vector": [13, 2, 0.8929, 0.0179, 2, 0.54, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return tokens[0] == ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99907:FunctionDef_L52_C4", "label": "_format_timestamp", "type": "function", "loc": [52, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99907:ClassDef_L21_C0", "vector": [2, 1, 0.9375, 0.0357, 1, 0.46, 0.875, 467, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "_format_timestamp", "arg_names": ["self", "millis"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _format_timestamp(self, millis):\n return utils.format_time(float(millis)/1000, millissep='.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99907:Return_L53_C8", "label": "return", "type": "return", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99907:FunctionDef_L52_C4", "vector": [13, 2, 0.9464, 0.0179, 2, 0.8, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return utils.format_time(float(millis)/1000, millissep='.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99907:FunctionDef_L55_C4", "label": "__iter__", "type": "function", "loc": [55, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99907:ClassDef_L21_C0", "vector": [2, 1, 0.9911, 0.0357, 1, 0.46, 1.0, 891, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "__iter__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __iter__(self):\n return iter(self._messages)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99907:Return_L56_C8", "label": "return", "type": "return", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99907:FunctionDef_L55_C4", "vector": [13, 2, 1.0, 0.0179, 2, 0.24, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return iter(self._messages)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99907:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99907:Expr_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99907:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99907:Assign_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99907:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99907:FunctionDef_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99907:FunctionDef_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99907:Assign_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99907:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99907:FunctionDef_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99907:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99907:For_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99907:For_L33_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99907:If_L34_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99907:If_L34_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99907:Assign_L35_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99907:For_L33_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99907:Expr_L36_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99907:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99907:FunctionDef_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99907:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99907:Assign_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99907:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99907:Assign_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99907:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99907:For_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99907:For_L41_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99907:Expr_L42_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99907:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99907:FunctionDef_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99907:FunctionDef_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99907:If_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99907:If_L45_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99907:Return_L46_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99907:FunctionDef_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99907:Return_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99907:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99907:FunctionDef_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99907:FunctionDef_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99907:Return_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99907:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99907:FunctionDef_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99907:FunctionDef_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99907:Return_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99907:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99907:FunctionDef_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99907:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99907:Return_L56_C8"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from output import Output
from logger import LOGGER
from monitor import CommandLineMonitor
from xmllogger import XmlLogger
from loggerhelper import LEVELS, Message
from readers import process_output, process_outputs
# Hooks to output. Set by Output.
# Use only if no other way available (e.g. from BuiltIn library)
OUTPUT = None
def TestSuite(outpath):
"""Factory method for getting test suite from an xml output file.
If you want statistics get suite first and say Statistics(suite).
"""
suite, errors = process_output(outpath)
def write_to_file(path=None):
"""Write processed suite (incl. statistics and errors) back to xml.
If path is not given the suite is written into the same file as it
originally was read from.
"""
from robot.result import RobotTestOutput
if path is None:
path = outpath
suite.set_status()
testoutput = RobotTestOutput(suite, errors)
testoutput.serialize_output(path, suite)
suite.write_to_file = write_to_file
return suite
| ajibawa-2023/Python-Code-Large/train/row_99908 | 20 | 51 | 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_99908:ImportFrom_L16_C0", "label": "from output import Output", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.3137, 0.0196, 0, 0.66, 0.0, 886, 0, 1, 0, 0, 886, 0, 0], "semantic": {"name": "output", "arg_names": [], "import_names": ["Output"], "rhs_call_name": "", "annotation": ""}, "snippet": "from output import Output"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99908:ImportFrom_L17_C0", "label": "from logger import LOGGER", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.3333, 0.0196, 0, 0.66, 0.1429, 532, 0, 1, 0, 0, 532, 0, 0], "semantic": {"name": "logger", "arg_names": [], "import_names": ["LOGGER"], "rhs_call_name": "", "annotation": ""}, "snippet": "from logger import LOGGER"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99908:ImportFrom_L18_C0", "label": "from monitor import CommandLineMonitor", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.3529, 0.0196, 0, 0.66, 0.2857, 68, 0, 1, 0, 0, 68, 0, 0], "semantic": {"name": "monitor", "arg_names": [], "import_names": ["CommandLineMonitor"], "rhs_call_name": "", "annotation": ""}, "snippet": "from monitor import CommandLineMonitor"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99908:ImportFrom_L19_C0", "label": "from xmllogger import XmlLogger", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.3725, 0.0196, 0, 0.66, 0.4286, 950, 0, 1, 0, 0, 950, 0, 0], "semantic": {"name": "xmllogger", "arg_names": [], "import_names": ["XmlLogger"], "rhs_call_name": "", "annotation": ""}, "snippet": "from xmllogger import XmlLogger"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99908:ImportFrom_L20_C0", "label": "from loggerhelper import LEVELS, Message", "type": "import", "loc": [20, 20], "level": 0, "parent": null, "vector": [1, 0, 0.3922, 0.0196, 0, 0.66, 0.5714, 426, 0, 2, 0, 0, 426, 0, 0], "semantic": {"name": "loggerhelper", "arg_names": [], "import_names": ["LEVELS", "Message"], "rhs_call_name": "", "annotation": ""}, "snippet": "from loggerhelper import LEVELS, Message"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99908:ImportFrom_L21_C0", "label": "from readers import process_output, process_outputs", "type": "import", "loc": [21, 21], "level": 0, "parent": null, "vector": [1, 0, 0.4118, 0.0196, 0, 0.66, 0.7143, 495, 0, 2, 0, 0, 495, 0, 0], "semantic": {"name": "readers", "arg_names": [], "import_names": ["process_output", "process_outputs"], "rhs_call_name": "", "annotation": ""}, "snippet": "from readers import process_output, process_outputs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99908:Assign_L26_C0", "label": "OUTPUT =", "type": "assigned_variable", "loc": [26, 26], "level": 0, "parent": null, "vector": [14, 0, 0.5098, 0.0196, 0, 0.66, 0.8571, 592, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "OUTPUT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "OUTPUT = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99908:FunctionDef_L29_C0", "label": "TestSuite", "type": "function", "loc": [29, 50], "level": 0, "parent": null, "vector": [2, 0, 0.7745, 0.4314, 0, 0.66, 1.0, 75, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "TestSuite", "arg_names": ["outpath"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def TestSuite(outpath):\n \"\"\"Factory method for getting test suite from an xml output file.\n\n If you want statistics get suite first and say Statistics(suite).\n \"\"\"\n suite, errors = process_output(outpath)\n\n def write_to_file(path=None):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99908:Expr_L30_C4", "label": "expression", "type": "expression", "loc": [30, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99908:FunctionDef_L29_C0", "vector": [8, 1, 0.6176, 0.0784, 1, 0.39, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Factory method for getting test suite from an xml output file.\n\n If you want statistics get suite first and say Statistics(suite).\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99908:Assign_L34_C4", "label": "suite, errors = process_output()", "type": "assigned_variable", "loc": [34, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99908:FunctionDef_L29_C0", "vector": [14, 1, 0.6667, 0.0196, 1, 0.39, 0.25, 667, 3, 1, 0, 0, 918, 10, 1], "semantic": {"name": "suite, errors", "arg_names": [], "import_names": [], "rhs_call_name": "process_output", "annotation": ""}, "snippet": " suite, errors = process_output(outpath)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99908:FunctionDef_L36_C4", "label": "write_to_file", "type": "function", "loc": [36, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99908:FunctionDef_L29_C0", "vector": [2, 1, 0.8137, 0.2353, 1, 0.39, 0.5, 283, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "write_to_file", "arg_names": ["path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def write_to_file(path=None):\n \"\"\"Write processed suite (incl. statistics and errors) back to xml.\n\n If path is not given the suite is written into the same file as it\n originally was read from.\n \"\"\"\n from robot.result import RobotTestOutput\n if path is None:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99908:Expr_L37_C8", "label": "expression", "type": "expression", "loc": [37, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99908:FunctionDef_L36_C4", "vector": [8, 2, 0.7647, 0.098, 2, 0.5, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Write processed suite (incl. statistics and errors) back to xml.\n\n If path is not given the suite is written into the same file as it\n originally was read from.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99908:ImportFrom_L42_C8", "label": "from robot.result import RobotTestOutput", "type": "import", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99908:FunctionDef_L36_C4", "vector": [1, 2, 0.8235, 0.0196, 2, 0.5, 0.2, 652, 0, 1, 0, 0, 652, 0, 0], "semantic": {"name": "robot.result", "arg_names": [], "import_names": ["RobotTestOutput"], "rhs_call_name": "", "annotation": ""}, "snippet": " from robot.result import RobotTestOutput"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99908:If_L43_C8", "label": "if", "type": "if", "loc": [43, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99908:FunctionDef_L36_C4", "vector": [4, 2, 0.8529, 0.0392, 2, 0.5, 0.4, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if path is None:\n path = outpath"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99908:Assign_L44_C12", "label": "path =", "type": "assigned_variable", "loc": [44, 44], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99908:If_L43_C8", "vector": [14, 3, 0.8627, 0.0196, 3, 0.44, 0.0, 358, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "path", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " path = outpath"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99908:Expr_L45_C8", "label": "set_status()", "type": "expression", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99908:FunctionDef_L36_C4", "vector": [8, 2, 0.8824, 0.0196, 2, 0.5, 0.6, 636, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "set_status", "arg_names": [], "import_names": [], "rhs_call_name": "set_status", "annotation": ""}, "snippet": " suite.set_status()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99908:Assign_L46_C8", "label": "testoutput = RobotTestOutput()", "type": "assigned_variable", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99908:FunctionDef_L36_C4", "vector": [14, 2, 0.902, 0.0196, 2, 0.5, 0.8, 975, 3, 2, 0, 0, 793, 10, 1], "semantic": {"name": "testoutput", "arg_names": [], "import_names": [], "rhs_call_name": "RobotTestOutput", "annotation": ""}, "snippet": " testoutput = RobotTestOutput(suite, errors)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99908:Expr_L47_C8", "label": "serialize_output()", "type": "expression", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99908:FunctionDef_L36_C4", "vector": [8, 2, 0.9216, 0.0196, 2, 0.5, 1.0, 936, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "serialize_output", "arg_names": [], "import_names": [], "rhs_call_name": "serialize_output", "annotation": ""}, "snippet": " testoutput.serialize_output(path, suite)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99908:Assign_L49_C4", "label": "suite.write_to_file =", "type": "assigned_variable", "loc": [49, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99908:FunctionDef_L29_C0", "vector": [14, 1, 0.9608, 0.0196, 1, 0.39, 0.75, 339, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "suite.write_to_file", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " suite.write_to_file = write_to_file"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99908:Return_L50_C4", "label": "return", "type": "return", "loc": [50, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99908:FunctionDef_L29_C0", "vector": [13, 1, 0.9804, 0.0196, 1, 0.39, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return suite"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99908:FunctionDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99908:Expr_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99908:FunctionDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99908:Assign_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99908:FunctionDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99908:FunctionDef_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99908:FunctionDef_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99908:Expr_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99908:FunctionDef_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99908:ImportFrom_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99908:FunctionDef_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99908:If_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99908:If_L43_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99908:Assign_L44_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99908:FunctionDef_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99908:Expr_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99908:FunctionDef_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99908:Assign_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99908:FunctionDef_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99908:Expr_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99908:FunctionDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99908:Assign_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99908:FunctionDef_L29_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99908:Return_L50_C4"}] |
#!/usr/bin/env python
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Rebot -- Robot Framework Report and Log Generator
Version: <VERSION>
Usage: rebot [options] robot_outputs
or: interpreter /path/robot/rebot.py [options] robot_outputs
or python -m robot.rebot [options] robot_outputs
Inputs to Rebot are XML output files generated by Robot Framework test runs or
earlier Rebot executions. Rebot can be used to generate logs and reports in
HTML format. It can also produce new XML output files which can be further
processed with Rebot or other tools.
When more than one input file is given, a new combined test suite containing
information from given files is created. This allows combining multiple outputs
together to create higher level reports.
For more information about Robot Framework run 'pybot --help' or go to
http://robotframework.org.
Options:
-N --name name Set the name of the top level test suite. Underscores
in the name are converted to spaces. Default name is
created from the name of the executed data source.
-D --doc documentation Set the documentation of the top level test suite.
Underscores in the documentation are converted to
spaces and it may also contain simple HTML formatting
(e.g. *bold* and http://url/).
-M --metadata name:value * Set metadata of the top level test suite.
Underscores in the name and value are converted to
spaces. Value can contain same HTML formatting as
--doc. Example: '--metadata version:1.2'
-G --settag tag * Sets given tag(s) to all executed test cases.
-t --test name * Select test cases to run by name or long name. Name
is case and space insensitive and it can also be a
simple pattern where '*' matches anything and '?'
matches any char. If using '*' and '?' in the console
is problematic see --escape and --argumentfile.
-s --suite name * Select test suites by name. When this option is used
with --test, --include or --exclude, only test cases
in matching suites and also matching other filtering
criteria are selected. Given name can be a simple
pattern similarly as with --test.
-i --include tag * Select test cases to run by tag. Similarly as name in
--test, tag is case and space insensitive. There are
three ways to include test based on tags:
1) One tag as a simple pattern. Tests having a tag
matching the pattern are included. Example: 'it-*'
2) Two or more tags (or patterns) separated by '&' or
'AND'. Only tests having all these tags are included.
Examples: 'tag1&tag2', 'smokeANDowner-*ANDit-10'
3) Two or more tags (or patterns) separated by 'NOT'.
Tests having the first tag but not any of the latter
ones are included. Example: 'it-10NOTsmoke'
-e --exclude tag * Select test cases not to run by tag. These tests are
not run even if they are included with --include.
Tags are excluded using the rules explained in
--include.
-c --critical tag * Tests having given tag are considered critical. If no
critical tags are set, all tags are critical. Tags
can be given as a pattern like e.g. with --test.
Resets possible critical tags set earlier.
-n --noncritical tag * Tests with given tag are not critical even if they
have a tag set with --critical. Tag can be a pattern.
Resets possible non critical tags set earlier.
-d --outputdir dir Where to create output files. The default is the
directory where Rebot is run from and the given path
is considered relative to that unless it is absolute.
-o --output file XML output file. Not created unless this option is
specified. Given path, similarly as paths given to
--log and --report, is relative to --outputdir unless
given as an absolute path. Default: output.xml
-l --log file HTML log file. Can be disabled by giving a special
name 'NONE'. Examples: '--log mylog.html', '-l none'
-r --report file HTML report file. Can be disabled with 'NONE'
similarly as --log. Default is 'report.html'.
-S --summary file Not supported in Robot Framework 2.6 or newer.
-x --xunitfile file xUnit compatible result file. Not created unless this
option is specified.
-T --timestampoutputs When this option is used, timestamp in a format
'YYYYMMDD-hhmmss' is added to all generated output
files between their basename and extension. For
example '-T -o output.xml -r report.html -l none'
creates files like 'output-20070503-154410.xml' and
'report-20070503-154410.html'.
--splitlog TODO: doc
--splitoutputs level Not supported in Robot Framework 2.6 or newer.
--logtitle title Title for the generated test log. The default title
is '<Name Of The Suite> Test Log'. Underscores in
the title are converted into spaces in all titles.
--reporttitle title Title for the generated test report. The default
title is '<Name Of The Suite> Test Report'.
--summarytitle title Not supported in Robot Framework 2.6 or newer.
--reportbackground colors Background colors to use in the report file.
Either 'all_passed:critical_passed:failed' or
'passed:failed'. Both color names and codes work.
Examples: --reportbackground green:yellow:red
--reportbackground #00E:#E00
-L --loglevel level Threshold for selecting messages. Available levels:
TRACE (default), DEBUG, INFO, WARN, NONE (no msgs)
--suitestatlevel level How many levels to show in 'Statistics by Suite'
in log and report. By default all suite levels are
shown. Example: --suitestatlevel 3
--tagstatinclude tag * Include only matching tags in 'Statistics by Tag'
and 'Test Details' in log and report. By default all
tags set in test cases are shown. Given 'tag' can
also be a simple pattern (see e.g. --test).
--tagstatexclude tag * Exclude matching tags from 'Statistics by Tag' and
'Test Details'. This option can be used with
--tagstatinclude similarly as --exclude is used with
--include.
--tagstatcombine tags:name * Create combined statistics based on tags.
These statistics are added into 'Statistics by Tag'
and matching tests into 'Test Details'. If optional
'name' is not given, name of the combined tag is got
from the specified tags. Tags are combined using the
rules explained in --include.
Examples: --tagstatcombine tag1ANDtag2:My_name
--tagstatcombine requirement-*
--tagdoc pattern:doc * Add documentation to tags matching given pattern.
Documentation is shown in 'Test Details' and also as
a tooltip in 'Statistics by Tag'. Pattern can contain
characters '*' (matches anything) and '?' (matches
any char). Documentation can contain formatting
similarly as with --doc option.
Examples: --tagdoc mytag:My_documentation
--tagdoc regression:*See*_http://info.html
--tagdoc owner-*:Original_author
--tagstatlink pattern:link:title * Add external links into 'Statistics by
Tag'. Pattern can contain characters '*' (matches
anything) and '?' (matches any char). Characters
matching to wildcard expressions can be used in link
and title with syntax %N, where N is index of the
match (starting from 1). In title underscores are
automatically converted to spaces.
Examples: --tagstatlink mytag:http://my.domain:Link
--tagstatlink bug-*:http://tracker/id=%1:Bug_Tracker
--removekeywords all|passed Remove keyword data from generated outputs.
Keyword data is not needed when creating reports and
removing it can make the size of an output file
considerably smaller.
'all' - remove data from all keywords
'passed' - remove data only from keywords in passed
test cases and suites
--starttime timestamp Set starting time of test execution when creating
reports. Timestamp must be given in format
'2007-10-01 15:12:42.268' where all separators are
optional (e.g. '20071001151242268' is ok too) and
parts from milliseconds to hours can be omitted if
they are zero (e.g. '2007-10-01'). This can be used
to override starttime of the suite when reports are
created from a single suite or to set starttime for
combined suite, which is otherwise set to 'N/A'.
--endtime timestamp Same as --starttime but for ending time. If both
options are used, elapsed time of the suite is
calculated based on them. For combined suites,
it is otherwise calculated by adding elapsed times
of combined test suites together.
--nostatusrc Sets the return code to zero regardless of failures
in test cases. Error codes are returned normally.
-C --monitorcolors on|off|force Using ANSI colors in console. Normally colors
work in unixes but not in Windows. Default is 'on'.
'on' - use colors in unixes but not in Windows
'off' - never use colors
'force' - always use colors (also in Windows)
-E --escape what:with * Escape characters which are problematic in console.
'what' is the name of the character to escape and
'with' is the string to escape it with. Note that
all given arguments, incl. data sources, are escaped
so escape characters ought to be selected carefully.
<---------------------ESCAPES----------------------->
Examples:
--escape space:_ --metadata X:Value_with_spaces
-E space:SP -E quot:Q -v var:QhelloSPworldQ
-A --argumentfile path * Text file to read more arguments from. File can have
both options and data sources one per line. Contents
don't need to be escaped but spaces in the beginning
and end of lines are removed. Empty lines and lines
starting with a hash character (#) are ignored.
Example file:
| --include regression
| --name Regression Tests
| # This is a comment line
| my_tests.html
| path/to/test/directory/
-h -? --help Print usage instructions.
--version Print version information.
Options that are marked with an asterisk (*) can be specified multiple times.
For example '--test first --test third' selects test cases with name 'first'
and 'third'. If other options are given multiple times, the last value is used.
Long option format is case-insensitive. For example --SuiteStatLevel is
equivalent to, but easier to read than, --suitestatlevel. Long options can
also be shortened as long as they are unique. For example '--logti Title' works
while '--lo log.html' does not because the former matches only --logtitle but
latter matches both --log and --logtitle.
Environment Variables:
ROBOT_SYSLOG_FILE Path to the syslog file. If not specified, or set to
special value 'NONE', writing to syslog file is
disabled. Path must be absolute.
ROBOT_SYSLOG_LEVEL Log level to use when writing to the syslog file.
Available levels are the same as for --loglevel
option to Robot and the default is INFO.
Examples:
# Simple Rebot run that creates log and report with default names.
$ rebot output.xml
# Using options. Note that this is one long command split into multiple lines.
$ rebot --log none --report smoke.html --reporttitle Smoke_Tests
--reportbackground green:yellow:red --include smoke
--TagStatCombine tag1ANDtag2 path/to/myoutput.xml
# Running 'robot/rebot.py' directly and creating combined outputs.
$ python /path/robot/rebot.py -N Project_X -l x.html -r x.html outputs/*.xml
"""
import sys
try:
import pythonpathsetter
except ImportError:
# Get here when run as 'python -m robot.rebot' and then importing robot
# works without this and pythonpathsetter is imported again later.
pass
import robot
if __name__ == '__main__':
rc = robot.rebot_from_cli(sys.argv[1:], __doc__)
sys.exit(rc)
| ajibawa-2023/Python-Code-Large/train/row_99911 | 8 | 253 | 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_99911:Expr_L17_C0", "label": "expression", "type": "expression", "loc": [17, 237], "level": 0, "parent": null, "vector": [8, 0, 0.502, 0.8735, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"Rebot -- Robot Framework Report and Log Generator\n\nVersion: <VERSION>\n\nUsage: rebot [options] robot_outputs\n or: interpreter /path/robot/rebot.py [options] robot_outputs\n or python -m robot.rebot [options] robot_outputs\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99911:Import_L239_C0", "label": "sys import sys", "type": "import", "loc": [239, 239], "level": 0, "parent": null, "vector": [1, 0, 0.9447, 0.004, 0, 0.66, 0.25, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99911:Try_L241_C0", "label": "try", "type": "try", "loc": [241, 246], "level": 0, "parent": null, "vector": [7, 0, 0.9625, 0.0237, 0, 0.66, 0.5, 0, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "try:\n import pythonpathsetter\nexcept ImportError:\n # Get here when run as 'python -m robot.rebot' and then importing robot\n # works without this and pythonpathsetter is imported again later.\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99911:Import_L242_C4", "label": "pythonpathsetter import pythonpathsetter", "type": "import", "loc": [242, 242], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99911:Try_L241_C0", "vector": [1, 1, 0.9565, 0.004, 1, 0.4, 0.0, 49, 0, 1, 0, 0, 49, 0, 0], "semantic": {"name": "pythonpathsetter", "arg_names": [], "import_names": ["pythonpathsetter"], "rhs_call_name": "", "annotation": ""}, "snippet": " import pythonpathsetter"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99911:Import_L248_C0", "label": "robot import robot", "type": "import", "loc": [248, 248], "level": 0, "parent": null, "vector": [1, 0, 0.9802, 0.004, 0, 0.66, 0.75, 735, 0, 1, 0, 0, 735, 0, 0], "semantic": {"name": "robot", "arg_names": [], "import_names": ["robot"], "rhs_call_name": "", "annotation": ""}, "snippet": "import robot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99911:If_L251_C0", "label": "if", "type": "if", "loc": [251, 253], "level": 0, "parent": null, "vector": [4, 0, 0.996, 0.0119, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n rc = robot.rebot_from_cli(sys.argv[1:], __doc__)\n sys.exit(rc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99911:Assign_L252_C4", "label": "rc = rebot_from_cli()", "type": "assigned_variable", "loc": [252, 252], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99911:If_L251_C0", "vector": [14, 1, 0.996, 0.004, 1, 0.26, 0.0, 401, 3, 2, 0, 0, 595, 10, 1], "semantic": {"name": "rc", "arg_names": [], "import_names": [], "rhs_call_name": "rebot_from_cli", "annotation": ""}, "snippet": " rc = robot.rebot_from_cli(sys.argv[1:], __doc__)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99911:Expr_L253_C4", "label": "exit()", "type": "expression", "loc": [253, 253], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99911:If_L251_C0", "vector": [8, 1, 1.0, 0.004, 1, 0.26, 1.0, 436, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "exit", "arg_names": [], "import_names": [], "rhs_call_name": "exit", "annotation": ""}, "snippet": " sys.exit(rc)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99911:Try_L241_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99911:Import_L242_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99911:If_L251_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99911:Assign_L252_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99911:If_L251_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99911:Expr_L253_C4"}] |
#!/usr/bin/env python
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Robot Framework -- A keyword-driven test automation framework
Version: <VERSION>
Usage: pybot [options] data_sources
or: jybot [options] data_sources
or: interpreter /path/robot/runner.py [options] data_sources
or: python -m robot.runner [options] data_sources
Robot Framework is a Python-based keyword-driven test automation framework for
acceptance level testing and acceptance test-driven development (ATDD). It has
an easy-to-use tabular syntax for creating test cases and its testing
capabilities can be extended by test libraries implemented either with Python
or Java. Users can also create new keywords from existing ones using the same
simple syntax that is used for creating test cases.
Robot Framework has two start-up scripts, 'pybot' and 'jybot', which run it on
Python and Jython interpreters, respectively. Alternatively it is possible to
directly call 'robot/runner.py' script using a selected interpreter.
Data sources given to Robot Framework are either test case files or directories
containing them and/or other directories. Single test case file creates a test
suite containing all the test cases in it and a directory containing test case
files creates a higher level test suite with test case files or other
directories as sub test suites. If multiple data sources are given, a virtual
test suite containing suites generated from given data sources is created.
By default Robot Framework creates an XML output file and a log and a report in
HTML format, but this can be configured using various options listed below.
Outputs in HTML format are for human consumption and XML output for integration
with other systems. XML outputs can also be combined and otherwise further
processed with Rebot tool. Run 'rebot --help' for more information.
Robot Framework is open source software released under Apache License 2.0.
Its copyrights are owned and development supported by Nokia Siemens Networks.
For more information about the framework see http://robotframework.org.
Options:
-N --name name Set the name of the top level test suite. Underscores
in the name are converted to spaces. Default name is
created from the name of the executed data source.
-D --doc documentation Set the documentation of the top level test suite.
Underscores in the documentation are converted to
spaces and it may also contain simple HTML formatting
(e.g. *bold* and http://url/).
-M --metadata name:value * Set metadata of the top level test suite.
Underscores in the name and value are converted to
spaces. Value can contain same HTML formatting as
--doc. Example: '--metadata version:1.2'
-G --settag tag * Sets given tag(s) to all executed test cases.
-t --test name * Select test cases to run by name or long name. Name
is case and space insensitive and it can also be a
simple pattern where '*' matches anything and '?'
matches any char. If using '*' and '?' in the console
is problematic see --escape and --argumentfile.
-s --suite name * Select test suites to run by name. When this option
is used with --test, --include or --exclude, only
test cases in matching suites and also matching other
filtering criteria are selected. Name can be a simple
pattern similarly as with --test and it can contain
parent name separated with a dot. For example
'-s X.Y' selects suite 'Y' only if its parent is 'X'.
-i --include tag * Select test cases to run by tag. Similarly as name in
--test, tag is case and space insensitive. There are
three ways to include test based on tags:
1) One tag as a simple pattern. Tests having a tag
matching the pattern are included. Example: 'it-*'
2) Two or more tags (or patterns) separated by '&' or
'AND'. Only tests having all these tags are included.
Examples: 'tag1&tag2', 'smokeANDowner-*ANDit-10'
3) Two or more tags (or patterns) separated by 'NOT'.
Tests having the first tag but not any of the latter
ones are included. Example: 'it-10NOTsmoke'
-e --exclude tag * Select test cases not to run by tag. These tests are
not run even if they are included with --include.
Tags are excluded using the rules explained in
--include.
-c --critical tag * Tests having given tag are considered critical. If no
critical tags are set, all tags are critical. Tags
can be given as a pattern like e.g. with --test.
-n --noncritical tag * Tests with given tag are not critical even if they
have a tag set with --critical. Tag can be a pattern.
-v --variable name:value * Set variables in the test data. Only scalar
variables are supported and name is given without
'${}'. See --escape for how to use special characters
and --variablefile for a more powerful variable
setting mechanism that allows also list variables.
Examples:
--variable str:Hello => ${str} = 'Hello'
-v str:Hi_World -E space:_ => ${str} = 'Hi World'
-v x: -v y:42 => ${x} = '', ${y} = '42'
-V --variablefile path * File to read variables from (e.g. 'path/vars.py').
Example file:
| import random
| __all__ = ['scalar','LIST__var','integer']
| scalar = 'Hello world!'
| LIST__var = ['Hello','list','world']
| integer = random.randint(1,10)
=>
${scalar} = 'Hello world!'
@{var} = ['Hello','list','world']
${integer} = <random integer from 1 to 10>
-d --outputdir dir Where to create output files. The default is the
directory where tests are run from and the given path
is considered relative to that unless it is absolute.
-o --output file XML output file. Given path, similarly as paths given
to --log, --report, --debugfile and --xunitfile, is
relative to --outputdir unless given as an absolute
path. Other output files are created based on XML
output files after the test execution and XML outputs
can also be further processed with Rebot tool. Can be
disabled by giving a special value 'NONE'. In this
case, also log and report are automatically disabled.
Default: output.xml
-l --log file HTML log file. Can be disabled by giving a special
value 'NONE'. Default: log.html
Examples: '--log mylog.html', '-l NONE'
-r --report file HTML report file. Can be disabled with 'NONE'
similarly as --log. Default: report.html
-S --summary file Not supported in Robot Framework 2.6 or newer.
-x --xunitfile file xUnit compatible result file. Not created unless this
option is specified.
-b --debugfile file Debug file written during execution. Not created
unless this option is specified.
-T --timestampoutputs When this option is used, timestamp in a format
'YYYYMMDD-hhmmss' is added to all generated output
files between their basename and extension. For
example '-T -o output.xml -r report.html -l none'
creates files like 'output-20070503-154410.xml' and
'report-20070503-154410.html'.
--splitlog TODO: doc
--splitoutputs level Not supported in Robot Framework 2.6 or newer.
--logtitle title Title for the generated test log. The default title
is '<Name Of The Suite> Test Log'. Underscores in
the title are converted into spaces in all titles.
--reporttitle title Title for the generated test report. The default
title is '<Name Of The Suite> Test Report'.
--summarytitle title Not supported in Robot Framework 2.6 or newer.
--reportbackground colors Background colors to use in the report file.
Either 'all_passed:critical_passed:failed' or
'passed:failed'. Both color names and codes work.
Examples: --reportbackground green:yellow:red
--reportbackground #00E:#E00
-L --loglevel level Threshold level for logging. Available levels:
TRACE, DEBUG, INFO (default), WARN, NONE (no logging)
--suitestatlevel level How many levels to show in 'Statistics by Suite'
in log and report. By default all suite levels are
shown. Example: --suitestatlevel 3
--tagstatinclude tag * Include only matching tags in 'Statistics by Tag'
and 'Test Details' in log and report. By default all
tags set in test cases are shown. Given 'tag' can
also be a simple pattern (see e.g. --test).
--tagstatexclude tag * Exclude matching tags from 'Statistics by Tag' and
'Test Details'. This option can be used with
--tagstatinclude similarly as --exclude is used with
--include.
--tagstatcombine tags:name * Create combined statistics based on tags.
These statistics are added into 'Statistics by Tag'
and matching tests into 'Test Details'. If optional
'name' is not given, name of the combined tag is got
from the specified tags. Tags are combined using the
rules explained in --include.
Examples: --tagstatcombine tag1ANDtag2:My_name
--tagstatcombine requirement-*
--tagdoc pattern:doc * Add documentation to tags matching given pattern.
Documentation is shown in 'Test Details' and also as
a tooltip in 'Statistics by Tag'. Pattern can contain
characters '*' (matches anything) and '?' (matches
any char). Documentation can contain formatting
similarly as with --doc option.
Examples: --tagdoc mytag:My_documentation
--tagdoc regression:*See*_http://info.html
--tagdoc owner-*:Original_author
--tagstatlink pattern:link:title * Add external links into 'Statistics by
Tag'. Pattern can contain characters '*' (matches
anything) and '?' (matches any char). Characters
matching to wildcard expressions can be used in link
and title with syntax %N, where N is index of the
match (starting from 1). In title underscores are
automatically converted to spaces.
Examples: --tagstatlink mytag:http://my.domain:Link
--tagstatlink bug-*:http://tracker/id=%1:Bug_Tracker
--listener class * A class for monitoring test execution. Gets
notifications e.g. when a test case starts and ends.
Arguments to listener class can be given after class
name, using colon as separator. For example:
--listener MyListenerClass:arg1:arg2
--warnonskippedfiles If this option is used, skipped files will cause a
warning that is visible to console output and log
files. By default skipped files only cause an info
level syslog message.
--nostatusrc Sets the return code to zero regardless of failures
in test cases. Error codes are returned normally.
--runemptysuite Executes tests also if the top level test suite is
empty. Useful e.g. with --include/--exclude when it
is not an error that no test matches the condition.
--runmode mode * Possible values are 'Random:Test', 'Random:Suite',
'Random:All', 'ExitOnFailure', 'SkipTeardownOnExit',
and 'DryRun' (case-insensitive). First three change
the execution order of tests, suites, or both.
'ExitOnFailure' stops test execution if a critical
test fails. 'SkipTeardownOnExit' causes teardowns to
be skipped if test execution is stopped prematurely.
In the 'DryRun' test data is verified and tests run
so that library keywords are not executed.
-W --monitorwidth chars Width of the monitor output. Default is 78.
-C --monitorcolors auto|on|off Use colors on console output or not.
auto: use colors when output not redirected (default)
on: always use colors
off: never use colors
Note that colors do not work with Jython on Windows.
-P --pythonpath path * Additional locations (directories, ZIPs, JARs) where
to search test libraries from when they are imported.
Multiple paths can be given by separating them with a
colon (':') or using this option several times. Given
path can also be a glob pattern matching multiple
paths but then it normally must be escaped or quoted.
Examples:
--pythonpath libs/
--pythonpath /opt/testlibs:mylibs.zip:yourlibs
-E star:STAR -P lib/STAR.jar -P mylib.jar
-E --escape what:with * Escape characters which are problematic in console.
'what' is the name of the character to escape and
'with' is the string to escape it with. Note that
all given arguments, incl. data sources, are escaped
so escape characters ought to be selected carefully.
<--------------------ESCAPES------------------------>
Examples:
--escape space:_ --metadata X:Value_with_spaces
-E space:SP -E quot:Q -v var:QhelloSPworldQ
-A --argumentfile path * Text file to read more arguments from. Use special
path 'STDIN' to read contents from the standard input
stream. File can have both options and data sources
one per line. Contents do not need to be escaped but
spaces in the beginning and end of lines are removed.
Empty lines and lines starting with a hash character
(#) are ignored.
Example file:
| --include regression
| --name Regression Tests
| # This is a comment line
| my_tests.html
| path/to/test/directory/
Examples:
--argumentfile argfile.txt --argumentfile STDIN
-h -? --help Print usage instructions.
--version Print version information.
Options that are marked with an asterisk (*) can be specified multiple times.
For example '--test first --test third' selects test cases with name 'first'
and 'third'. If other options are given multiple times, the last value is used.
Long option format is case-insensitive. For example --SuiteStatLevel is
equivalent to, but easier to read than, --suitestatlevel. Long options can
also be shortened as long as they are unique. For example '--logle DEBUG' works
while '--lo log.html' does not because the former matches only --loglevel but
latter matches --log, --logtitle and --loglevel.
Environment Variables:
ROBOT_SYSLOG_FILE Path to the syslog file. If not specified, or set to
special value 'NONE', writing to syslog file is
disabled. Path must be absolute.
ROBOT_SYSLOG_LEVEL Log level to use when writing to the syslog file.
Available levels are the same as for --loglevel
option and the default is INFO.
Examples:
# Simple test run with 'pybot' without options.
$ pybot tests.html
# Using options and running with 'jybot'.
$ jybot --include smoke --name Smoke_Tests /path/to/tests.html
# Running 'robot/runner.py' directly and using test data in TSV format.
$ python /path/to/robot/runner.py tests.tsv
# Using custom start-up script, giving multiple options and executing a dir.
$ runtests.sh --test test1 --test test2 testdir/
# Executing multiple data sources and using case-insensitive long options.
$ pybot --SuiteStatLevel 2 /my/tests/*.html /your/tests.html
# Setting syslog file before running tests.
$ export ROBOT_SYSLOG_FILE=/tmp/syslog.txt
$ pybot tests.html
"""
import sys
try:
import pythonpathsetter
except ImportError:
# Get here when run as 'python -m robot.runner' and then importing robot
# works without this and pythonpathsetter is imported again later.
pass
import robot
if __name__ == '__main__':
rc = robot.run_from_cli(sys.argv[1:], __doc__)
sys.exit(rc)
| ajibawa-2023/Python-Code-Large/train/row_99912 | 8 | 321 | 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_99912:Expr_L17_C0", "label": "expression", "type": "expression", "loc": [17, 305], "level": 0, "parent": null, "vector": [8, 0, 0.5016, 0.9003, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"Robot Framework -- A keyword-driven test automation framework\n\nVersion: <VERSION>\n\nUsage: pybot [options] data_sources\n or: jybot [options] data_sources\n or: interpreter /path/robot/runner.py [options] data_sources\n or: python -m robot.runner [options] data_sources"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99912:Import_L307_C0", "label": "sys import sys", "type": "import", "loc": [307, 307], "level": 0, "parent": null, "vector": [1, 0, 0.9564, 0.0031, 0, 0.66, 0.25, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99912:Try_L309_C0", "label": "try", "type": "try", "loc": [309, 314], "level": 0, "parent": null, "vector": [7, 0, 0.9704, 0.0187, 0, 0.66, 0.5, 0, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "try:\n import pythonpathsetter\nexcept ImportError:\n # Get here when run as 'python -m robot.runner' and then importing robot\n # works without this and pythonpathsetter is imported again later.\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99912:Import_L310_C4", "label": "pythonpathsetter import pythonpathsetter", "type": "import", "loc": [310, 310], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99912:Try_L309_C0", "vector": [1, 1, 0.9657, 0.0031, 1, 0.78, 0.0, 49, 0, 1, 0, 0, 49, 0, 0], "semantic": {"name": "pythonpathsetter", "arg_names": [], "import_names": ["pythonpathsetter"], "rhs_call_name": "", "annotation": ""}, "snippet": " import pythonpathsetter"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99912:Import_L316_C0", "label": "robot import robot", "type": "import", "loc": [316, 316], "level": 0, "parent": null, "vector": [1, 0, 0.9844, 0.0031, 0, 0.66, 0.75, 735, 0, 1, 0, 0, 735, 0, 0], "semantic": {"name": "robot", "arg_names": [], "import_names": ["robot"], "rhs_call_name": "", "annotation": ""}, "snippet": "import robot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99912:If_L319_C0", "label": "if", "type": "if", "loc": [319, 321], "level": 0, "parent": null, "vector": [4, 0, 0.9969, 0.0093, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n rc = robot.run_from_cli(sys.argv[1:], __doc__)\n sys.exit(rc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99912:Assign_L320_C4", "label": "rc = run_from_cli()", "type": "assigned_variable", "loc": [320, 320], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99912:If_L319_C0", "vector": [14, 1, 0.9969, 0.0031, 1, 0.93, 0.0, 401, 3, 2, 0, 0, 746, 10, 1], "semantic": {"name": "rc", "arg_names": [], "import_names": [], "rhs_call_name": "run_from_cli", "annotation": ""}, "snippet": " rc = robot.run_from_cli(sys.argv[1:], __doc__)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99912:Expr_L321_C4", "label": "exit()", "type": "expression", "loc": [321, 321], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99912:If_L319_C0", "vector": [8, 1, 1.0, 0.0031, 1, 0.93, 1.0, 436, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "exit", "arg_names": [], "import_names": [], "rhs_call_name": "exit", "annotation": ""}, "snippet": " sys.exit(rc)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99912:Try_L309_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99912:Import_L310_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99912:If_L319_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99912:Assign_L320_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99912:If_L319_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99912:Expr_L321_C4"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from robot.errors import DataError
class UserErrorHandler:
"""Created if creating handlers fail -- running raises DataError.
The idea is not to raise DataError at processing time and prevent all
tests in affected test case file from executing. Instead UserErrorHandler
is created and if it is ever run DataError is raised then.
"""
type = 'error'
def __init__(self, name, error):
self.name = self.longname = name
self.doc = self.shortdoc = ''
self._error = error
self.timeout = ''
def init_keyword(self, varz):
pass
def run(self, *args):
raise DataError(self._error)
| ajibawa-2023/Python-Code-Large/train/row_99913 | 11 | 37 | 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_99913:ImportFrom_L15_C0", "label": "from robot.errors import DataError", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.4054, 0.027, 0, 0.66, 0.0, 299, 0, 1, 0, 0, 299, 0, 0], "semantic": {"name": "robot.errors", "arg_names": [], "import_names": ["DataError"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot.errors import DataError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99913:ClassDef_L18_C0", "label": "UserErrorHandler", "type": "class", "loc": [18, 37], "level": 0, "parent": null, "vector": [3, 0, 0.7432, 0.5405, 0, 0.66, 1.0, 290, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "UserErrorHandler", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class UserErrorHandler:\n \"\"\"Created if creating handlers fail -- running raises DataError.\n\n The idea is not to raise DataError at processing time and prevent all\n tests in affected test case file from executing. Instead UserErrorHandler\n is created and if it is ever run DataError is raised then.\n \"\"\"\n type = 'error'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99913:Expr_L19_C4", "label": "expression", "type": "expression", "loc": [19, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99913:ClassDef_L18_C0", "vector": [8, 1, 0.5811, 0.1622, 1, 0.41, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Created if creating handlers fail -- running raises DataError.\n\n The idea is not to raise DataError at processing time and prevent all\n tests in affected test case file from executing. Instead UserErrorHandler\n is created and if it is ever run DataError is raised then.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99913:Assign_L25_C4", "label": "type =", "type": "assigned_variable", "loc": [25, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99913:ClassDef_L18_C0", "vector": [14, 1, 0.6757, 0.027, 1, 0.41, 0.25, 801, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " type = 'error'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99913:FunctionDef_L27_C4", "label": "__init__", "type": "function", "loc": [27, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99913:ClassDef_L18_C0", "vector": [2, 1, 0.7838, 0.1351, 1, 0.41, 0.5, 555, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "name", "error"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, name, error):\n self.name = self.longname = name\n self.doc = self.shortdoc = ''\n self._error = error\n self.timeout = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99913:Assign_L28_C8", "label": "self.name =", "type": "assigned_variable", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99913:FunctionDef_L27_C4", "vector": [14, 2, 0.7568, 0.027, 2, 0.87, 0.0, 689, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.name = self.longname = name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99913:Assign_L29_C8", "label": "self.doc =", "type": "assigned_variable", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99913:FunctionDef_L27_C4", "vector": [14, 2, 0.7838, 0.027, 2, 0.87, 0.3333, 114, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.doc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.doc = self.shortdoc = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99913:Assign_L30_C8", "label": "self._error =", "type": "assigned_variable", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99913:FunctionDef_L27_C4", "vector": [14, 2, 0.8108, 0.027, 2, 0.87, 0.6667, 654, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._error", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._error = error"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99913:Assign_L31_C8", "label": "self.timeout =", "type": "assigned_variable", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99913:FunctionDef_L27_C4", "vector": [14, 2, 0.8378, 0.027, 2, 0.87, 1.0, 621, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.timeout", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.timeout = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99913:FunctionDef_L33_C4", "label": "init_keyword", "type": "function", "loc": [33, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99913:ClassDef_L18_C0", "vector": [2, 1, 0.9054, 0.0541, 1, 0.41, 0.75, 747, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "init_keyword", "arg_names": ["self", "varz"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def init_keyword(self, varz):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99913:FunctionDef_L36_C4", "label": "run", "type": "function", "loc": [36, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99913:ClassDef_L18_C0", "vector": [2, 1, 0.9865, 0.0541, 1, 0.41, 1.0, 679, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "run", "arg_names": ["self", "args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def run(self, *args):\n raise DataError(self._error)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99913:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99913:Expr_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99913:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99913:Assign_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99913:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99913:FunctionDef_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99913:FunctionDef_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99913:Assign_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99913:FunctionDef_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99913:Assign_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99913:FunctionDef_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99913:Assign_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99913:FunctionDef_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99913:Assign_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99913:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99913:FunctionDef_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99913:ClassDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99913:FunctionDef_L36_C4"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
class BaseKeyword:
def __init__(self, name='', args=None, doc='', timeout='', type='kw'):
self.name = name
self.args = args or []
self.doc = doc
self.timeout = timeout
self.type = type
self.status = 'NOT_RUN'
def serialize(self, serializer):
serializer.start_keyword(self)
serializer.end_keyword(self)
| ajibawa-2023/Python-Code-Large/train/row_99914 | 11 | 28 | 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_99914:ClassDef_L16_C0", "label": "BaseKeyword", "type": "class", "loc": [16, 28], "level": 0, "parent": null, "vector": [3, 0, 0.7857, 0.4643, 0, 0.66, 0.0, 776, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "BaseKeyword", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class BaseKeyword:\n\n def __init__(self, name='', args=None, doc='', timeout='', type='kw'):\n self.name = name\n self.args = args or []\n self.doc = doc\n self.timeout = timeout\n self.type = type"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99914:FunctionDef_L18_C4", "label": "__init__", "type": "function", "loc": [18, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99914:ClassDef_L16_C0", "vector": [2, 1, 0.75, 0.25, 1, 0.88, 0.0, 555, 0, 6, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "name", "args", "doc", "timeout", "type"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, name='', args=None, doc='', timeout='', type='kw'):\n self.name = name\n self.args = args or []\n self.doc = doc\n self.timeout = timeout\n self.type = type\n self.status = 'NOT_RUN'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99914:Assign_L19_C8", "label": "self.name =", "type": "assigned_variable", "loc": [19, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99914:FunctionDef_L18_C4", "vector": [14, 2, 0.6786, 0.0357, 2, 0.09, 0.0, 689, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.name = name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99914:Assign_L20_C8", "label": "self.args =", "type": "assigned_variable", "loc": [20, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99914:FunctionDef_L18_C4", "vector": [14, 2, 0.7143, 0.0357, 2, 0.09, 0.2, 640, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.args", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.args = args or []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99914:Assign_L21_C8", "label": "self.doc =", "type": "assigned_variable", "loc": [21, 21], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99914:FunctionDef_L18_C4", "vector": [14, 2, 0.75, 0.0357, 2, 0.09, 0.4, 114, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.doc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.doc = doc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99914:Assign_L22_C8", "label": "self.timeout =", "type": "assigned_variable", "loc": [22, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99914:FunctionDef_L18_C4", "vector": [14, 2, 0.7857, 0.0357, 2, 0.09, 0.6, 621, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.timeout", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.timeout = timeout"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99914:Assign_L23_C8", "label": "self.type =", "type": "assigned_variable", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99914:FunctionDef_L18_C4", "vector": [14, 2, 0.8214, 0.0357, 2, 0.09, 0.8, 398, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.type = type"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99914:Assign_L24_C8", "label": "self.status =", "type": "assigned_variable", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99914:FunctionDef_L18_C4", "vector": [14, 2, 0.8571, 0.0357, 2, 0.09, 1.0, 651, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.status", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.status = 'NOT_RUN'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99914:FunctionDef_L26_C4", "label": "serialize", "type": "function", "loc": [26, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99914:ClassDef_L16_C0", "vector": [2, 1, 0.9643, 0.1071, 1, 0.88, 1.0, 50, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "serialize", "arg_names": ["self", "serializer"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def serialize(self, serializer):\n serializer.start_keyword(self)\n serializer.end_keyword(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99914:Expr_L27_C8", "label": "start_keyword()", "type": "expression", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99914:FunctionDef_L26_C4", "vector": [8, 2, 0.9643, 0.0357, 2, 0.41, 0.0, 776, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "start_keyword", "arg_names": [], "import_names": [], "rhs_call_name": "start_keyword", "annotation": ""}, "snippet": " serializer.start_keyword(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99914:Expr_L28_C8", "label": "end_keyword()", "type": "expression", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99914:FunctionDef_L26_C4", "vector": [8, 2, 1.0, 0.0357, 2, 0.41, 1.0, 959, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "end_keyword", "arg_names": [], "import_names": [], "rhs_call_name": "end_keyword", "annotation": ""}, "snippet": " serializer.end_keyword(self)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99914:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99914:FunctionDef_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99914:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99914:Assign_L19_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99914:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99914:Assign_L20_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99914:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99914:Assign_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99914:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99914:Assign_L22_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99914:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99914:Assign_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99914:FunctionDef_L18_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99914:Assign_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99914:ClassDef_L16_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99914:FunctionDef_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99914:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99914:Expr_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99914:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99914:Expr_L28_C8"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import random
from statistics import Stat
from robot import utils
from robot.errors import DataError
class _TestAndSuiteHelper:
def __init__(self, name, parent=None):
self.name = name
self.doc = ''
self.parent = parent
self.setup = None
self.teardown = None
self.status = 'NOT_RUN'
self.message = ''
# TODO: Is this property and other html/serialize stuff here used anymore?
@property
def htmldoc(self):
return utils.html_format(self.doc)
# TODO: Replace with simple @property in 2.7.
# Cannot do that now because Mabot assigns longname.
_longname = None
longname = property(lambda self: self._longname or self.get_long_name(),
lambda self, name: setattr(self, '_longname', name))
# TODO: Is separator still used?
def get_long_name(self, separator='.'):
"""Returns long name. If separator is None, list of names is returned."""
names = self.parent and self.parent.get_long_name(separator=None) or []
names.append(self.name)
if separator:
return separator.join(names)
return names
def _set_teardown_fail_msg(self, message):
if self.message == '':
self.message = message
else:
self.message += '\n\nAlso ' + message[0].lower() + message[1:]
def __str__(self):
return self.name
def __repr__(self):
return repr(self.name)
class BaseTestSuite(_TestAndSuiteHelper):
"""Base class for TestSuite used in runtime and by rebot."""
def __init__(self, name, source=None, parent=None):
_TestAndSuiteHelper.__init__(self, name, parent)
self.source = source is not None and utils.abspath(source) or None
self.metadata = utils.NormalizedDict()
self.suites = []
self.tests = []
self.critical = _Critical()
self.critical_stats = Stat()
self.all_stats = Stat()
if parent:
parent.suites.append(self)
def set_name(self, name):
if name:
self.name = name
elif not self.parent and self.name == '': # MultiSourceSuite
self.name = ' & '.join([suite.name for suite in self.suites])
def set_critical_tags(self, critical, non_critical):
if critical is not None or non_critical is not None:
self.critical.set(critical, non_critical)
self._set_critical_tags(self.critical)
def _set_critical_tags(self, critical):
self.critical = critical
for suite in self.suites:
suite._set_critical_tags(critical)
for test in self.tests:
test.set_criticality(critical)
def set_doc(self, doc):
if doc:
self.doc = doc
def set_metadata(self, metalist):
for name, value in metalist:
self.metadata[name] = value
def get_metadata(self, html=False):
names = sorted(self.metadata.keys())
values = [self.metadata[n] for n in names]
if html:
values = [utils.html_format(v) for v in values]
return zip(names, values)
def get_test_count(self):
count = len(self.tests)
for suite in self.suites:
count += suite.get_test_count()
return count
def get_full_message(self, html=False):
"""Returns suite's message including statistics message"""
stat_msg = self.get_stat_message(html)
if not self.message:
return stat_msg
if not html:
return '%s\n\n%s' % (self.message, stat_msg)
return '%s<br /><br />%s' % (utils.html_escape(self.message), stat_msg)
def get_stat_message(self, html=False):
ctotal, cend, cpass, cfail = self._get_counts(self.critical_stats)
atotal, aend, apass, afail = self._get_counts(self.all_stats)
msg = ('%%d critical test%%s, %%d passed, %(cfail)s%%d failed%(end)s\n'
'%%d test%%s total, %%d passed, %(afail)s%%d failed%(end)s')
if html:
msg = msg.replace(' ', ' ').replace('\n', '<br />')
msg = msg % {'cfail': '<span%s>' % (cfail and ' class="fail"' or ''),
'afail': '<span%s>' % (afail and ' class="fail"' or ''),
'end': '</span>'}
else:
msg = msg % {'cfail': '', 'afail': '', 'end': ''}
return msg % (ctotal, cend, cpass, cfail, atotal, aend, apass, afail)
def _get_counts(self, stat):
total = stat.passed + stat.failed
ending = utils.plural_or_not(total)
return total, ending, stat.passed, stat.failed
def set_status(self):
"""Sets status and statistics based on subsuite and test statuses.
Can/should be used when statuses have been changed somehow.
"""
self.status = self._set_stats()
def _set_stats(self):
self.critical_stats = Stat()
self.all_stats = Stat()
for suite in self.suites:
suite.set_status()
self._add_suite_to_stats(suite)
for test in self.tests:
self._add_test_to_stats(test)
return self._get_status()
def _get_status(self):
return 'PASS' if not self.critical_stats.failed else 'FAIL'
def _add_test_to_stats(self, test):
self.all_stats.add_test(test)
if test.critical == 'yes':
self.critical_stats.add_test(test)
def _add_suite_to_stats(self, suite):
self.critical_stats.add_stat(suite.critical_stats)
self.all_stats.add_stat(suite.all_stats)
def suite_teardown_failed(self, message=None):
if message:
self._set_teardown_fail_msg(message)
self.critical_stats.fail_all()
self.all_stats.fail_all()
self.status = self._get_status()
sub_message = 'Teardown of the parent suite failed.'
for suite in self.suites:
suite.suite_teardown_failed(sub_message)
for test in self.tests:
test.suite_teardown_failed(sub_message)
def set_tags(self, tags):
if tags:
for test in self.tests:
test.tags = utils.normalize_tags(test.tags + tags)
for suite in self.suites:
suite.set_tags(tags)
def filter(self, suites=None, tests=None, includes=None, excludes=None,
zero_tests_ok=False):
self.filter_by_names(suites, tests, zero_tests_ok)
self.filter_by_tags(includes, excludes, zero_tests_ok)
def filter_by_names(self, suites=None, tests=None, zero_tests_ok=False):
if not (suites or tests):
return
suites = [([], name.split('.')) for name in suites or []]
tests = tests or []
if not self._filter_by_names(suites, tests) and not zero_tests_ok:
self._raise_no_tests_filtered_by_names(suites, tests)
def _filter_by_names(self, suites, tests):
suites = self._filter_suite_names(suites)
self.suites = [suite for suite in self.suites
if suite._filter_by_names(suites, tests)]
if not suites:
self.tests = [test for test in self.tests if tests == [] or
any(utils.matches_any(name, tests, ignore=['_'])
for name in [test.name, test.get_long_name()])]
else:
self.tests = []
return bool(self.suites or self.tests)
def _filter_suite_names(self, suites):
try:
return [self._filter_suite_name(p, s) for p, s in suites]
except StopIteration:
return []
def _filter_suite_name(self, parent, suite):
if utils.matches(self.name, suite[0], ignore=['_']):
if len(suite) == 1:
raise StopIteration('Match found')
return (parent + [suite[0]], suite[1:])
return ([], parent + suite)
def _raise_no_tests_filtered_by_names(self, suites, tests):
tests = utils.seq2str(tests, lastsep=' or ')
suites = utils.seq2str(['.'.join(p + s) for p, s in suites],
lastsep=' or ')
if not suites:
msg = 'test cases named %s.' % tests
elif not tests:
msg = 'test suites named %s.' % suites
else:
msg = 'test cases %s in suites %s.' % (tests, suites)
raise DataError("Suite '%s' contains no %s" % (self.name, msg))
def filter_by_tags(self, includes=None, excludes=None, zero_tests_ok=False):
if not (includes or excludes):
return
includes = includes or []
excludes = excludes or []
if not self._filter_by_tags(includes, excludes) and not zero_tests_ok:
self._raise_no_tests_filtered_by_tags(includes, excludes)
def _filter_by_tags(self, incls, excls):
self.suites = [suite for suite in self.suites
if suite._filter_by_tags(incls, excls)]
self.tests = [test for test in self.tests
if test.is_included(incls, excls)]
return bool(self.suites or self.tests)
def _raise_no_tests_filtered_by_tags(self, incls, excls):
incl = utils.seq2str(incls)
excl = utils.seq2str(excls)
msg = "Suite '%s' with " % self.name
if incl:
msg += 'includes %s ' % incl
if excl:
msg += 'and '
if excl:
msg += 'excludes %s ' % excl
raise DataError(msg + 'contains no test cases.')
def set_runmode(self, runmode):
runmode = runmode.upper()
if runmode == 'EXITONFAILURE':
self._run_mode_exit_on_failure = True
elif runmode == 'SKIPTEARDOWNONEXIT':
self._run_mode_skip_teardowns_on_exit = True
elif runmode == 'DRYRUN':
self._run_mode_dry_run = True
elif runmode == 'RANDOM:TEST':
random.shuffle(self.tests)
elif runmode == 'RANDOM:SUITE':
random.shuffle(self.suites)
elif runmode == 'RANDOM:ALL':
random.shuffle(self.suites)
random.shuffle(self.tests)
else:
return
for suite in self.suites:
suite.set_runmode(runmode)
def set_options(self, settings):
self.set_tags(settings['SetTag'])
self.filter(settings['SuiteNames'], settings['TestNames'],
settings['Include'], settings['Exclude'],
settings['RunEmptySuite'])
self.set_name(settings['Name'])
self.set_doc(settings['Doc'])
self.set_metadata(settings['Metadata'])
self.set_critical_tags(settings['Critical'], settings['NonCritical'])
self._return_status_rc = not settings['NoStatusRC']
if 'RunMode' in settings:
map(self.set_runmode, settings['RunMode'])
if 'RemoveKeywords' in settings:
self.remove_keywords(settings['RemoveKeywords'])
def serialize(self, serializer):
serializer.start_suite(self)
if self.setup is not None:
self.setup.serialize(serializer)
if self.teardown is not None:
self.teardown.serialize(serializer)
for suite in self.suites:
suite.serialize(serializer)
for test in self.tests:
test.serialize(serializer)
serializer.end_suite(self)
@property
def return_code(self):
rc = min(self.critical_stats.failed, 250)
return rc if self._return_status_rc else 0
class BaseTestCase(_TestAndSuiteHelper):
def __init__(self, name, parent):
_TestAndSuiteHelper.__init__(self, name, parent)
self.critical = 'yes'
if parent:
parent.tests.append(self)
def suite_teardown_failed(self, message):
self.status = 'FAIL'
self._set_teardown_fail_msg(message)
def set_criticality(self, critical):
self.critical = 'yes' if critical.are_critical(self.tags) else 'no'
def is_included(self, incl_tags, excl_tags):
"""Returns True if this test case is included but not excluded.
If no 'incl_tags' are given all tests are considered to be included.
"""
included = not incl_tags or self._matches_any_tag_rule(incl_tags)
excluded = self._matches_any_tag_rule(excl_tags)
return included and not excluded
def _matches_any_tag_rule(self, tag_rules):
"""Returns True if any of tag_rules matches self.tags
Matching equals supporting AND, & and NOT boolean operators and simple
pattern matching. NOT is 'or' operation meaning if any of the NOTs is
matching, False is returned.
"""
return any(self._matches_tag_rule(rule) for rule in tag_rules)
def _matches_tag_rule(self, tag_rule):
if 'NOT' not in tag_rule:
return self._matches_tag(tag_rule)
nots = tag_rule.split('NOT')
should_match = nots.pop(0)
return self._matches_tag(should_match) \
and not any(self._matches_tag(n) for n in nots)
def _matches_tag(self, tag):
"""Returns True if given tag matches any tag from self.tags.
Note that given tag may be ANDed combination of multiple tags (e.g.
tag1&tag2) and then all of them must match some tag from self.tags.
"""
for item in tag.split('&'):
if not any(utils.matches(t, item, ignore=['_']) for t in self.tags):
return False
return True
def __cmp__(self, other):
if self.status != other.status:
return -1 if self.status == 'FAIL' else 1
if self.critical != other.critical:
return -1 if self.critical == 'yes' else 1
try:
return cmp(self.longname, other.longname)
except AttributeError:
return cmp(self.name, other.name)
def serialize(self, serializer):
serializer.start_test(self)
if self.setup is not None:
self.setup.serialize(serializer)
for kw in self.keywords:
kw.serialize(serializer)
if self.teardown is not None:
self.teardown.serialize(serializer)
serializer.end_test(self)
class _Critical:
def __init__(self, tags=None, nons=None):
self.set(tags, nons)
def set(self, tags, nons):
self.tags = utils.normalize_tags(tags or [])
self.nons = utils.normalize_tags(nons or [])
def is_critical(self, tag):
return utils.matches_any(tag, self.tags)
def is_non_critical(self, tag):
return utils.matches_any(tag, self.nons)
def are_critical(self, tags):
for tag in tags:
if self.is_non_critical(tag):
return False
for tag in tags:
if self.is_critical(tag):
return True
return not self.tags
| ajibawa-2023/Python-Code-Large/train/row_99915 | 296 | 421 | 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_99915:Import_L15_C0", "label": "random import random", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.0356, 0.0024, 0, 0.66, 0.0, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "random", "arg_names": [], "import_names": ["random"], "rhs_call_name": "", "annotation": ""}, "snippet": "import random"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:ImportFrom_L17_C0", "label": "from statistics import Stat", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.0404, 0.0024, 0, 0.66, 0.1429, 35, 0, 1, 0, 0, 35, 0, 0], "semantic": {"name": "statistics", "arg_names": [], "import_names": ["Stat"], "rhs_call_name": "", "annotation": ""}, "snippet": "from statistics import Stat"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:ImportFrom_L18_C0", "label": "from robot import utils", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.0428, 0.0024, 0, 0.66, 0.2857, 735, 0, 1, 0, 0, 735, 0, 0], "semantic": {"name": "robot", "arg_names": [], "import_names": ["utils"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot import utils"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:ImportFrom_L19_C0", "label": "from robot.errors import DataError", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.0451, 0.0024, 0, 0.66, 0.4286, 299, 0, 1, 0, 0, 299, 0, 0], "semantic": {"name": "robot.errors", "arg_names": [], "import_names": ["DataError"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot.errors import DataError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L22_C0", "label": "_TestAndSuiteHelper", "type": "class", "loc": [22, 63], "level": 0, "parent": null, "vector": [3, 0, 0.101, 0.0998, 0, 0.66, 0.5714, 935, 0, 6, 0, 0, 0, 0, 9], "semantic": {"name": "_TestAndSuiteHelper", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _TestAndSuiteHelper:\n\n def __init__(self, name, parent=None):\n self.name = name\n self.doc = ''\n self.parent = parent\n self.setup = None\n self.teardown = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L24_C4", "label": "__init__", "type": "function", "loc": [24, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L22_C0", "vector": [2, 1, 0.0653, 0.019, 1, 0.43, 0.0, 555, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "name", "parent"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, name, parent=None):\n self.name = name\n self.doc = ''\n self.parent = parent\n self.setup = None\n self.teardown = None\n self.status = 'NOT_RUN'\n self.message = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L25_C8", "label": "self.name =", "type": "assigned_variable", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L24_C4", "vector": [14, 2, 0.0594, 0.0024, 2, 0.96, 0.0, 689, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.name = name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L26_C8", "label": "self.doc =", "type": "assigned_variable", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L24_C4", "vector": [14, 2, 0.0618, 0.0024, 2, 0.96, 0.1667, 114, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.doc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.doc = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L27_C8", "label": "self.parent =", "type": "assigned_variable", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L24_C4", "vector": [14, 2, 0.0641, 0.0024, 2, 0.96, 0.3333, 428, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.parent", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.parent = parent"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L28_C8", "label": "self.setup =", "type": "assigned_variable", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L24_C4", "vector": [14, 2, 0.0665, 0.0024, 2, 0.96, 0.5, 524, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.setup", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.setup = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L29_C8", "label": "self.teardown =", "type": "assigned_variable", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L24_C4", "vector": [14, 2, 0.0689, 0.0024, 2, 0.96, 0.6667, 281, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.teardown", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.teardown = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L30_C8", "label": "self.status =", "type": "assigned_variable", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L24_C4", "vector": [14, 2, 0.0713, 0.0024, 2, 0.96, 0.8333, 651, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.status", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.status = 'NOT_RUN'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L31_C8", "label": "self.message =", "type": "assigned_variable", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L24_C4", "vector": [14, 2, 0.0736, 0.0024, 2, 0.96, 1.0, 709, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.message", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.message = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L35_C4", "label": "htmldoc", "type": "function", "loc": [35, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L22_C0", "vector": [2, 1, 0.0843, 0.0048, 1, 0.43, 0.1429, 218, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "htmldoc", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def htmldoc(self):\n return utils.html_format(self.doc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L36_C8", "label": "return", "type": "return", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L35_C4", "vector": [13, 2, 0.0855, 0.0024, 2, 0.08, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return utils.html_format(self.doc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L40_C4", "label": "_longname =", "type": "assigned_variable", "loc": [40, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L22_C0", "vector": [14, 1, 0.095, 0.0024, 1, 0.43, 0.2857, 712, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "_longname", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _longname = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L41_C4", "label": "longname = property()", "type": "assigned_variable", "loc": [41, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L22_C0", "vector": [14, 1, 0.0986, 0.0048, 1, 0.43, 0.4286, 573, 3, 2, 0, 0, 244, 10, 3], "semantic": {"name": "longname", "arg_names": [], "import_names": [], "rhs_call_name": "property", "annotation": ""}, "snippet": " longname = property(lambda self: self._longname or self.get_long_name(),\n lambda self, name: setattr(self, '_longname', name))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L45_C4", "label": "get_long_name", "type": "function", "loc": [45, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L22_C0", "vector": [2, 1, 0.114, 0.0166, 1, 0.43, 0.5714, 299, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "get_long_name", "arg_names": ["self", "separator"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_long_name(self, separator='.'):\n \"\"\"Returns long name. If separator is None, list of names is returned.\"\"\"\n names = self.parent and self.parent.get_long_name(separator=None) or []\n names.append(self.name)\n if separator:\n return separator.join(names)\n return names"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L46_C8", "label": "expression", "type": "expression", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L45_C4", "vector": [8, 2, 0.1093, 0.0024, 2, 0.08, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Returns long name. If separator is None, list of names is returned.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L47_C8", "label": "names =", "type": "assigned_variable", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L45_C4", "vector": [14, 2, 0.1116, 0.0024, 2, 0.08, 0.25, 382, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "names", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " names = self.parent and self.parent.get_long_name(separator=None) or []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L48_C8", "label": "append()", "type": "expression", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L45_C4", "vector": [8, 2, 0.114, 0.0024, 2, 0.08, 0.5, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " names.append(self.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L49_C8", "label": "if", "type": "if", "loc": [49, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L45_C4", "vector": [4, 2, 0.1176, 0.0048, 2, 0.08, 0.75, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if separator:\n return separator.join(names)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L50_C12", "label": "return", "type": "return", "loc": [50, 50], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L49_C8", "vector": [13, 3, 0.1188, 0.0024, 3, 0.61, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return separator.join(names)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L51_C8", "label": "return", "type": "return", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L45_C4", "vector": [13, 2, 0.1211, 0.0024, 2, 0.08, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return names"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L53_C4", "label": "_set_teardown_fail_msg", "type": "function", "loc": [53, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L22_C0", "vector": [2, 1, 0.1306, 0.0119, 1, 0.43, 0.7143, 698, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_set_teardown_fail_msg", "arg_names": ["self", "message"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _set_teardown_fail_msg(self, message):\n if self.message == '':\n self.message = message\n else:\n self.message += '\\n\\nAlso ' + message[0].lower() + message[1:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L54_C8", "label": "if", "type": "if", "loc": [54, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L53_C4", "vector": [4, 2, 0.1318, 0.0095, 2, 0.36, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.message == '':\n self.message = message\n else:\n self.message += '\\n\\nAlso ' + message[0].lower() + message[1:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L55_C12", "label": "self.message =", "type": "assigned_variable", "loc": [55, 55], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L54_C8", "vector": [14, 3, 0.1306, 0.0024, 3, 0.79, 0.0, 709, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.message", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.message = message"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L59_C4", "label": "__str__", "type": "function", "loc": [59, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L22_C0", "vector": [2, 1, 0.1413, 0.0048, 1, 0.43, 0.8571, 527, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "__str__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __str__(self):\n return self.name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L60_C8", "label": "return", "type": "return", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L59_C4", "vector": [13, 2, 0.1425, 0.0024, 2, 0.47, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L62_C4", "label": "__repr__", "type": "function", "loc": [62, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L22_C0", "vector": [2, 1, 0.1485, 0.0048, 1, 0.43, 1.0, 204, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "__repr__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __repr__(self):\n return repr(self.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L63_C8", "label": "return", "type": "return", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L62_C4", "vector": [13, 2, 0.1496, 0.0024, 2, 0.28, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return repr(self.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L66_C0", "label": "BaseTestSuite", "type": "class", "loc": [66, 323], "level": 0, "parent": null, "vector": [3, 0, 0.462, 0.6128, 0, 0.66, 0.7143, 245, 0, 31, 0, 0, 935, 0, 92], "semantic": {"name": "BaseTestSuite", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class BaseTestSuite(_TestAndSuiteHelper):\n \"\"\"Base class for TestSuite used in runtime and by rebot.\"\"\"\n\n def __init__(self, name, source=None, parent=None):\n _TestAndSuiteHelper.__init__(self, name, parent)\n self.source = source is not None and utils.abspath(source) or None\n self.metadata = utils.NormalizedDict()\n self.suites = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L67_C4", "label": "expression", "type": "expression", "loc": [67, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L66_C0", "vector": [8, 1, 0.1591, 0.0024, 1, 0.1, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Base class for TestSuite used in runtime and by rebot.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L69_C4", "label": "__init__", "type": "function", "loc": [69, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L66_C0", "vector": [2, 1, 0.1758, 0.0261, 1, 0.1, 0.0323, 555, 0, 4, 0, 0, 0, 0, 7], "semantic": {"name": "__init__", "arg_names": ["self", "name", "source", "parent"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, name, source=None, parent=None):\n _TestAndSuiteHelper.__init__(self, name, parent)\n self.source = source is not None and utils.abspath(source) or None\n self.metadata = utils.NormalizedDict()\n self.suites = []\n self.tests = []\n self.critical = _Critical()\n self.critical_stats = Stat()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L70_C8", "label": "__init__()", "type": "expression", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L69_C4", "vector": [8, 2, 0.1663, 0.0024, 2, 0.18, 0.0, 555, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " _TestAndSuiteHelper.__init__(self, name, parent)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L71_C8", "label": "self.source =", "type": "assigned_variable", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L69_C4", "vector": [14, 2, 0.1686, 0.0024, 2, 0.18, 0.125, 848, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.source", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.source = source is not None and utils.abspath(source) or None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L72_C8", "label": "self.metadata = NormalizedDict()", "type": "assigned_variable", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L69_C4", "vector": [14, 2, 0.171, 0.0024, 2, 0.18, 0.25, 83, 3, 0, 0, 0, 696, 10, 1], "semantic": {"name": "self.metadata", "arg_names": [], "import_names": [], "rhs_call_name": "NormalizedDict", "annotation": ""}, "snippet": " self.metadata = utils.NormalizedDict()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L73_C8", "label": "self.suites =", "type": "assigned_variable", "loc": [73, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L69_C4", "vector": [14, 2, 0.1734, 0.0024, 2, 0.18, 0.375, 941, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.suites", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.suites = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L74_C8", "label": "self.tests =", "type": "assigned_variable", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L69_C4", "vector": [14, 2, 0.1758, 0.0024, 2, 0.18, 0.5, 606, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.tests", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.tests = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L75_C8", "label": "self.critical = _Critical()", "type": "assigned_variable", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L69_C4", "vector": [14, 2, 0.1781, 0.0024, 2, 0.18, 0.625, 227, 3, 0, 0, 0, 650, 10, 1], "semantic": {"name": "self.critical", "arg_names": [], "import_names": [], "rhs_call_name": "_Critical", "annotation": ""}, "snippet": " self.critical = _Critical()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L76_C8", "label": "self.critical_stats = Stat()", "type": "assigned_variable", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L69_C4", "vector": [14, 2, 0.1805, 0.0024, 2, 0.18, 0.75, 980, 3, 0, 0, 0, 415, 10, 1], "semantic": {"name": "self.critical_stats", "arg_names": [], "import_names": [], "rhs_call_name": "Stat", "annotation": ""}, "snippet": " self.critical_stats = Stat()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L77_C8", "label": "self.all_stats = Stat()", "type": "assigned_variable", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L69_C4", "vector": [14, 2, 0.1829, 0.0024, 2, 0.18, 0.875, 289, 3, 0, 0, 0, 415, 10, 1], "semantic": {"name": "self.all_stats", "arg_names": [], "import_names": [], "rhs_call_name": "Stat", "annotation": ""}, "snippet": " self.all_stats = Stat()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L78_C8", "label": "if", "type": "if", "loc": [78, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L69_C4", "vector": [4, 2, 0.1865, 0.0048, 2, 0.18, 1.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if parent:\n parent.suites.append(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L79_C12", "label": "append()", "type": "expression", "loc": [79, 79], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L78_C8", "vector": [8, 3, 0.1876, 0.0024, 3, 0.32, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " parent.suites.append(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L81_C4", "label": "set_name", "type": "function", "loc": [81, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L66_C0", "vector": [2, 1, 0.1971, 0.0119, 1, 0.1, 0.0645, 435, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_name", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_name(self, name):\n if name:\n self.name = name\n elif not self.parent and self.name == '': # MultiSourceSuite\n self.name = ' & '.join([suite.name for suite in self.suites])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L82_C8", "label": "if", "type": "if", "loc": [82, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L81_C4", "vector": [4, 2, 0.1983, 0.0095, 2, 0.02, 0.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if name:\n self.name = name\n elif not self.parent and self.name == '': # MultiSourceSuite\n self.name = ' & '.join([suite.name for suite in self.suites])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L83_C12", "label": "self.name =", "type": "assigned_variable", "loc": [83, 83], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L82_C8", "vector": [14, 3, 0.1971, 0.0024, 3, 0.82, 0.0, 689, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.name = name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L84_C8", "label": "if", "type": "if", "loc": [84, 85], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L82_C8", "vector": [4, 3, 0.2007, 0.0048, 3, 0.82, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif not self.parent and self.name == '': # MultiSourceSuite\n self.name = ' & '.join([suite.name for suite in self.suites])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L85_C12", "label": "self.name = join()", "type": "assigned_variable", "loc": [85, 85], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L84_C8", "vector": [14, 4, 0.2019, 0.0024, 4, 0.55, 0.0, 689, 3, 1, 0, 0, 933, 10, 1], "semantic": {"name": "self.name", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " self.name = ' & '.join([suite.name for suite in self.suites])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L87_C4", "label": "set_critical_tags", "type": "function", "loc": [87, 90], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L66_C0", "vector": [2, 1, 0.2102, 0.0095, 1, 0.1, 0.0968, 861, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "set_critical_tags", "arg_names": ["self", "critical", "non_critical"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_critical_tags(self, critical, non_critical):\n if critical is not None or non_critical is not None:\n self.critical.set(critical, non_critical)\n self._set_critical_tags(self.critical)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L88_C8", "label": "if", "type": "if", "loc": [88, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L87_C4", "vector": [4, 2, 0.2114, 0.0071, 2, 0.63, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if critical is not None or non_critical is not None:\n self.critical.set(critical, non_critical)\n self._set_critical_tags(self.critical)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L89_C12", "label": "set()", "type": "expression", "loc": [89, 89], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L88_C8", "vector": [8, 3, 0.2114, 0.0024, 3, 0.63, 0.0, 21, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set", "arg_names": [], "import_names": [], "rhs_call_name": "set", "annotation": ""}, "snippet": " self.critical.set(critical, non_critical)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L90_C12", "label": "_set_critical_tags()", "type": "expression", "loc": [90, 90], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L88_C8", "vector": [8, 3, 0.2138, 0.0024, 3, 0.63, 1.0, 214, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_set_critical_tags", "arg_names": [], "import_names": [], "rhs_call_name": "_set_critical_tags", "annotation": ""}, "snippet": " self._set_critical_tags(self.critical)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L92_C4", "label": "_set_critical_tags", "type": "function", "loc": [92, 97], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L66_C0", "vector": [2, 1, 0.2245, 0.0143, 1, 0.1, 0.129, 214, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "_set_critical_tags", "arg_names": ["self", "critical"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _set_critical_tags(self, critical):\n self.critical = critical\n for suite in self.suites:\n suite._set_critical_tags(critical)\n for test in self.tests:\n test.set_criticality(critical)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L93_C8", "label": "self.critical =", "type": "assigned_variable", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L92_C4", "vector": [14, 2, 0.2209, 0.0024, 2, 0.17, 0.0, 227, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.critical", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.critical = critical"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:For_L94_C8", "label": "for suite", "type": "for", "loc": [94, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L92_C4", "vector": [6, 2, 0.2245, 0.0048, 2, 0.17, 0.5, 425, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "suite", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for suite in self.suites:\n suite._set_critical_tags(critical)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L95_C12", "label": "_set_critical_tags()", "type": "expression", "loc": [95, 95], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:For_L94_C8", "vector": [8, 3, 0.2257, 0.0024, 3, 0.1, 0.0, 214, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_set_critical_tags", "arg_names": [], "import_names": [], "rhs_call_name": "_set_critical_tags", "annotation": ""}, "snippet": " suite._set_critical_tags(critical)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:For_L96_C8", "label": "for test", "type": "for", "loc": [96, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L92_C4", "vector": [6, 2, 0.2292, 0.0048, 2, 0.17, 1.0, 224, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "test", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for test in self.tests:\n test.set_criticality(critical)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L97_C12", "label": "set_criticality()", "type": "expression", "loc": [97, 97], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:For_L96_C8", "vector": [8, 3, 0.2304, 0.0024, 3, 0.87, 0.0, 158, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_criticality", "arg_names": [], "import_names": [], "rhs_call_name": "set_criticality", "annotation": ""}, "snippet": " test.set_criticality(critical)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L99_C4", "label": "set_doc", "type": "function", "loc": [99, 101], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L66_C0", "vector": [2, 1, 0.2375, 0.0071, 1, 0.1, 0.1613, 936, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "set_doc", "arg_names": ["self", "doc"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_doc(self, doc):\n if doc:\n self.doc = doc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L100_C8", "label": "if", "type": "if", "loc": [100, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L99_C4", "vector": [4, 2, 0.2387, 0.0048, 2, 0.32, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if doc:\n self.doc = doc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L101_C12", "label": "self.doc =", "type": "assigned_variable", "loc": [101, 101], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L100_C8", "vector": [14, 3, 0.2399, 0.0024, 3, 0.38, 0.0, 114, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.doc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.doc = doc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L103_C4", "label": "set_metadata", "type": "function", "loc": [103, 105], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L66_C0", "vector": [2, 1, 0.247, 0.0071, 1, 0.1, 0.1935, 345, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "set_metadata", "arg_names": ["self", "metalist"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_metadata(self, metalist):\n for name, value in metalist:\n self.metadata[name] = value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:For_L104_C8", "label": "for name, value", "type": "for", "loc": [104, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L103_C4", "vector": [6, 2, 0.2482, 0.0048, 2, 0.68, 0.0, 509, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "name, value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for name, value in metalist:\n self.metadata[name] = value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L105_C12", "label": "assign", "type": "assigned_variable", "loc": [105, 105], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:For_L104_C8", "vector": [14, 3, 0.2494, 0.0024, 3, 0.12, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.metadata[name] = value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L107_C4", "label": "get_metadata", "type": "function", "loc": [107, 112], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L66_C0", "vector": [2, 1, 0.2601, 0.0143, 1, 0.1, 0.2258, 736, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "get_metadata", "arg_names": ["self", "html"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_metadata(self, html=False):\n names = sorted(self.metadata.keys())\n values = [self.metadata[n] for n in names]\n if html:\n values = [utils.html_format(v) for v in values]\n return zip(names, values)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L108_C8", "label": "names = sorted()", "type": "assigned_variable", "loc": [108, 108], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L107_C4", "vector": [14, 2, 0.2565, 0.0024, 2, 0.23, 0.0, 382, 3, 1, 0, 0, 134, 10, 2], "semantic": {"name": "names", "arg_names": [], "import_names": [], "rhs_call_name": "sorted", "annotation": ""}, "snippet": " names = sorted(self.metadata.keys())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L109_C8", "label": "values =", "type": "assigned_variable", "loc": [109, 109], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L107_C4", "vector": [14, 2, 0.2589, 0.0024, 2, 0.23, 0.3333, 721, 5, 0, 0, 0, 0, 0, 0], "semantic": {"name": "values", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " values = [self.metadata[n] for n in names]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L110_C8", "label": "if", "type": "if", "loc": [110, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L107_C4", "vector": [4, 2, 0.2625, 0.0048, 2, 0.23, 0.6667, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if html:\n values = [utils.html_format(v) for v in values]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L111_C12", "label": "values =", "type": "assigned_variable", "loc": [111, 111], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L110_C8", "vector": [14, 3, 0.2637, 0.0024, 3, 0.44, 0.0, 721, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "values", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " values = [utils.html_format(v) for v in values]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L112_C8", "label": "return", "type": "return", "loc": [112, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L107_C4", "vector": [13, 2, 0.266, 0.0024, 2, 0.23, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return zip(names, values)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L114_C4", "label": "get_test_count", "type": "function", "loc": [114, 118], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L66_C0", "vector": [2, 1, 0.2755, 0.0119, 1, 0.1, 0.2581, 560, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "get_test_count", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_test_count(self):\n count = len(self.tests)\n for suite in self.suites:\n count += suite.get_test_count()\n return count"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L115_C8", "label": "count = len()", "type": "assigned_variable", "loc": [115, 115], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L114_C4", "vector": [14, 2, 0.2732, 0.0024, 2, 0.95, 0.0, 778, 3, 1, 0, 0, 890, 10, 1], "semantic": {"name": "count", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": " count = len(self.tests)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:For_L116_C8", "label": "for suite", "type": "for", "loc": [116, 117], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L114_C4", "vector": [6, 2, 0.2767, 0.0048, 2, 0.95, 0.5, 425, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "suite", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for suite in self.suites:\n count += suite.get_test_count()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L118_C8", "label": "return", "type": "return", "loc": [118, 118], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L114_C4", "vector": [13, 2, 0.2803, 0.0024, 2, 0.95, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return count"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L120_C4", "label": "get_full_message", "type": "function", "loc": [120, 127], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L66_C0", "vector": [2, 1, 0.2933, 0.019, 1, 0.1, 0.2903, 659, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "get_full_message", "arg_names": ["self", "html"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_full_message(self, html=False):\n \"\"\"Returns suite's message including statistics message\"\"\"\n stat_msg = self.get_stat_message(html)\n if not self.message:\n return stat_msg\n if not html:\n return '%s\\n\\n%s' % (self.message, stat_msg)\n return '%s<br /><br />%s' % (utils.html_escape(self.message), stat_msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L121_C8", "label": "expression", "type": "expression", "loc": [121, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L120_C4", "vector": [8, 2, 0.2874, 0.0024, 2, 0.72, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Returns suite's message including statistics message\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L122_C8", "label": "stat_msg = get_stat_message()", "type": "assigned_variable", "loc": [122, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L120_C4", "vector": [14, 2, 0.2898, 0.0024, 2, 0.72, 0.25, 664, 3, 1, 0, 0, 513, 10, 1], "semantic": {"name": "stat_msg", "arg_names": [], "import_names": [], "rhs_call_name": "get_stat_message", "annotation": ""}, "snippet": " stat_msg = self.get_stat_message(html)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L123_C8", "label": "if", "type": "if", "loc": [123, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L120_C4", "vector": [4, 2, 0.2933, 0.0048, 2, 0.72, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self.message:\n return stat_msg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L124_C12", "label": "return", "type": "return", "loc": [124, 124], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L123_C8", "vector": [13, 3, 0.2945, 0.0024, 3, 0.02, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return stat_msg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L125_C8", "label": "if", "type": "if", "loc": [125, 126], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L120_C4", "vector": [4, 2, 0.2981, 0.0048, 2, 0.72, 0.75, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not html:\n return '%s\\n\\n%s' % (self.message, stat_msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L126_C12", "label": "return", "type": "return", "loc": [126, 126], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L125_C8", "vector": [13, 3, 0.2993, 0.0024, 3, 0.67, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '%s\\n\\n%s' % (self.message, stat_msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L127_C8", "label": "return", "type": "return", "loc": [127, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L120_C4", "vector": [13, 2, 0.3017, 0.0024, 2, 0.72, 1.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '%s<br /><br />%s' % (utils.html_escape(self.message), stat_msg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L129_C4", "label": "get_stat_message", "type": "function", "loc": [129, 141], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L66_C0", "vector": [2, 1, 0.3207, 0.0309, 1, 0.1, 0.3226, 513, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "get_stat_message", "arg_names": ["self", "html"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_stat_message(self, html=False):\n ctotal, cend, cpass, cfail = self._get_counts(self.critical_stats)\n atotal, aend, apass, afail = self._get_counts(self.all_stats)\n msg = ('%%d critical test%%s, %%d passed, %(cfail)s%%d failed%(end)s\\n'\n '%%d test%%s total, %%d passed, %(afail)s%%d failed%(end)s')\n if html:\n msg = msg.replace(' ', ' ').replace('\\n', '<br />')\n msg = msg % {'cfail': '<span%s>' % (cfail and ' class=\"fail\"' or ''),"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L130_C8", "label": "ctotal, cend, cpass, cfail = _get_counts()", "type": "assigned_variable", "loc": [130, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L129_C4", "vector": [14, 2, 0.3088, 0.0024, 2, 0.95, 0.0, 399, 3, 1, 0, 0, 321, 10, 1], "semantic": {"name": "ctotal, cend, cpass, cfail", "arg_names": [], "import_names": [], "rhs_call_name": "_get_counts", "annotation": ""}, "snippet": " ctotal, cend, cpass, cfail = self._get_counts(self.critical_stats)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L131_C8", "label": "atotal, aend, apass, afail = _get_counts()", "type": "assigned_variable", "loc": [131, 131], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L129_C4", "vector": [14, 2, 0.3112, 0.0024, 2, 0.95, 0.25, 202, 3, 1, 0, 0, 321, 10, 1], "semantic": {"name": "atotal, aend, apass, afail", "arg_names": [], "import_names": [], "rhs_call_name": "_get_counts", "annotation": ""}, "snippet": " atotal, aend, apass, afail = self._get_counts(self.all_stats)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L132_C8", "label": "msg =", "type": "assigned_variable", "loc": [132, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L129_C4", "vector": [14, 2, 0.3147, 0.0048, 2, 0.95, 0.5, 712, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " msg = ('%%d critical test%%s, %%d passed, %(cfail)s%%d failed%(end)s\\n'\n '%%d test%%s total, %%d passed, %(afail)s%%d failed%(end)s')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L134_C8", "label": "if", "type": "if", "loc": [134, 140], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L129_C4", "vector": [4, 2, 0.3254, 0.0166, 2, 0.95, 0.75, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if html:\n msg = msg.replace(' ', ' ').replace('\\n', '<br />')\n msg = msg % {'cfail': '<span%s>' % (cfail and ' class=\"fail\"' or ''),\n 'afail': '<span%s>' % (afail and ' class=\"fail\"' or ''),\n 'end': '</span>'}\n else:\n msg = msg % {'cfail': '', 'afail': '', 'end': ''}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L135_C12", "label": "msg = replace()", "type": "assigned_variable", "loc": [135, 135], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L134_C8", "vector": [14, 3, 0.3207, 0.0024, 3, 0.91, 0.0, 712, 3, 2, 0, 0, 293, 10, 2], "semantic": {"name": "msg", "arg_names": [], "import_names": [], "rhs_call_name": "replace", "annotation": ""}, "snippet": " msg = msg.replace(' ', ' ').replace('\\n', '<br />')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L136_C12", "label": "msg =", "type": "assigned_variable", "loc": [136, 138], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L134_C8", "vector": [14, 3, 0.3254, 0.0071, 3, 0.91, 0.5, 712, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " msg = msg % {'cfail': '<span%s>' % (cfail and ' class=\"fail\"' or ''),\n 'afail': '<span%s>' % (afail and ' class=\"fail\"' or ''),\n 'end': '</span>'}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L140_C12", "label": "msg =", "type": "assigned_variable", "loc": [140, 140], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L134_C8", "vector": [14, 3, 0.3325, 0.0024, 3, 0.91, 1.0, 712, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " msg = msg % {'cfail': '', 'afail': '', 'end': ''}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L141_C8", "label": "return", "type": "return", "loc": [141, 141], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L129_C4", "vector": [13, 2, 0.3349, 0.0024, 2, 0.95, 1.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return msg % (ctotal, cend, cpass, cfail, atotal, aend, apass, afail)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L143_C4", "label": "_get_counts", "type": "function", "loc": [143, 146], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L66_C0", "vector": [2, 1, 0.3432, 0.0095, 1, 0.1, 0.3548, 321, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "_get_counts", "arg_names": ["self", "stat"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_counts(self, stat):\n total = stat.passed + stat.failed\n ending = utils.plural_or_not(total)\n return total, ending, stat.passed, stat.failed"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L144_C8", "label": "total =", "type": "assigned_variable", "loc": [144, 144], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L143_C4", "vector": [14, 2, 0.342, 0.0024, 2, 0.2, 0.0, 878, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "total", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " total = stat.passed + stat.failed"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L145_C8", "label": "ending = plural_or_not()", "type": "assigned_variable", "loc": [145, 145], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L143_C4", "vector": [14, 2, 0.3444, 0.0024, 2, 0.2, 0.5, 847, 3, 1, 0, 0, 673, 10, 1], "semantic": {"name": "ending", "arg_names": [], "import_names": [], "rhs_call_name": "plural_or_not", "annotation": ""}, "snippet": " ending = utils.plural_or_not(total)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L146_C8", "label": "return", "type": "return", "loc": [146, 146], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L143_C4", "vector": [13, 2, 0.3468, 0.0024, 2, 0.2, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return total, ending, stat.passed, stat.failed"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L148_C4", "label": "set_status", "type": "function", "loc": [148, 153], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L66_C0", "vector": [2, 1, 0.3575, 0.0143, 1, 0.1, 0.3871, 636, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_status", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_status(self):\n \"\"\"Sets status and statistics based on subsuite and test statuses.\n\n Can/should be used when statuses have been changed somehow.\n \"\"\"\n self.status = self._set_stats()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L149_C8", "label": "expression", "type": "expression", "loc": [149, 152], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L148_C4", "vector": [8, 2, 0.3575, 0.0095, 2, 0.29, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Sets status and statistics based on subsuite and test statuses.\n\n Can/should be used when statuses have been changed somehow.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L153_C8", "label": "self.status = _set_stats()", "type": "assigned_variable", "loc": [153, 153], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L148_C4", "vector": [14, 2, 0.3634, 0.0024, 2, 0.29, 1.0, 651, 3, 0, 0, 0, 258, 10, 1], "semantic": {"name": "self.status", "arg_names": [], "import_names": [], "rhs_call_name": "_set_stats", "annotation": ""}, "snippet": " self.status = self._set_stats()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L155_C4", "label": "_set_stats", "type": "function", "loc": [155, 163], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L66_C0", "vector": [2, 1, 0.3777, 0.0214, 1, 0.1, 0.4194, 258, 0, 1, 1, 0, 0, 0, 6], "semantic": {"name": "_set_stats", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _set_stats(self):\n self.critical_stats = Stat()\n self.all_stats = Stat()\n for suite in self.suites:\n suite.set_status()\n self._add_suite_to_stats(suite)\n for test in self.tests:\n self._add_test_to_stats(test)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L156_C8", "label": "self.critical_stats = Stat()", "type": "assigned_variable", "loc": [156, 156], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L155_C4", "vector": [14, 2, 0.3705, 0.0024, 2, 0.33, 0.0, 980, 3, 0, 0, 0, 415, 10, 1], "semantic": {"name": "self.critical_stats", "arg_names": [], "import_names": [], "rhs_call_name": "Stat", "annotation": ""}, "snippet": " self.critical_stats = Stat()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L157_C8", "label": "self.all_stats = Stat()", "type": "assigned_variable", "loc": [157, 157], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L155_C4", "vector": [14, 2, 0.3729, 0.0024, 2, 0.33, 0.25, 289, 3, 0, 0, 0, 415, 10, 1], "semantic": {"name": "self.all_stats", "arg_names": [], "import_names": [], "rhs_call_name": "Stat", "annotation": ""}, "snippet": " self.all_stats = Stat()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:For_L158_C8", "label": "for suite", "type": "for", "loc": [158, 160], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L155_C4", "vector": [6, 2, 0.3777, 0.0071, 2, 0.33, 0.5, 425, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "suite", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for suite in self.suites:\n suite.set_status()\n self._add_suite_to_stats(suite)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L159_C12", "label": "set_status()", "type": "expression", "loc": [159, 159], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:For_L158_C8", "vector": [8, 3, 0.3777, 0.0024, 3, 0.63, 0.0, 636, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "set_status", "arg_names": [], "import_names": [], "rhs_call_name": "set_status", "annotation": ""}, "snippet": " suite.set_status()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L160_C12", "label": "_add_suite_to_stats()", "type": "expression", "loc": [160, 160], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:For_L158_C8", "vector": [8, 3, 0.38, 0.0024, 3, 0.63, 1.0, 355, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_add_suite_to_stats", "arg_names": [], "import_names": [], "rhs_call_name": "_add_suite_to_stats", "annotation": ""}, "snippet": " self._add_suite_to_stats(suite)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:For_L161_C8", "label": "for test", "type": "for", "loc": [161, 162], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L155_C4", "vector": [6, 2, 0.3836, 0.0048, 2, 0.33, 0.75, 224, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "test", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for test in self.tests:\n self._add_test_to_stats(test)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L162_C12", "label": "_add_test_to_stats()", "type": "expression", "loc": [162, 162], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:For_L161_C8", "vector": [8, 3, 0.3848, 0.0024, 3, 0.74, 0.0, 715, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_add_test_to_stats", "arg_names": [], "import_names": [], "rhs_call_name": "_add_test_to_stats", "annotation": ""}, "snippet": " self._add_test_to_stats(test)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L163_C8", "label": "return", "type": "return", "loc": [163, 163], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L155_C4", "vector": [13, 2, 0.3872, 0.0024, 2, 0.33, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._get_status()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L165_C4", "label": "_get_status", "type": "function", "loc": [165, 166], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L66_C0", "vector": [2, 1, 0.3931, 0.0048, 1, 0.1, 0.4516, 890, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "_get_status", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_status(self):\n return 'PASS' if not self.critical_stats.failed else 'FAIL'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L166_C8", "label": "return", "type": "return", "loc": [166, 166], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L165_C4", "vector": [13, 2, 0.3943, 0.0024, 2, 0.99, 0.0, 0, 8, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'PASS' if not self.critical_stats.failed else 'FAIL'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L168_C4", "label": "_add_test_to_stats", "type": "function", "loc": [168, 171], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L66_C0", "vector": [2, 1, 0.4026, 0.0095, 1, 0.1, 0.4839, 715, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "_add_test_to_stats", "arg_names": ["self", "test"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _add_test_to_stats(self, test):\n self.all_stats.add_test(test)\n if test.critical == 'yes':\n self.critical_stats.add_test(test)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L169_C8", "label": "add_test()", "type": "expression", "loc": [169, 169], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L168_C4", "vector": [8, 2, 0.4014, 0.0024, 2, 0.45, 0.0, 653, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add_test", "arg_names": [], "import_names": [], "rhs_call_name": "add_test", "annotation": ""}, "snippet": " self.all_stats.add_test(test)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L170_C8", "label": "if", "type": "if", "loc": [170, 171], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L168_C4", "vector": [4, 2, 0.405, 0.0048, 2, 0.45, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if test.critical == 'yes':\n self.critical_stats.add_test(test)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L171_C12", "label": "add_test()", "type": "expression", "loc": [171, 171], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L170_C8", "vector": [8, 3, 0.4062, 0.0024, 3, 0.64, 0.0, 653, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add_test", "arg_names": [], "import_names": [], "rhs_call_name": "add_test", "annotation": ""}, "snippet": " self.critical_stats.add_test(test)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L173_C4", "label": "_add_suite_to_stats", "type": "function", "loc": [173, 175], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L66_C0", "vector": [2, 1, 0.4133, 0.0071, 1, 0.1, 0.5161, 355, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "_add_suite_to_stats", "arg_names": ["self", "suite"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _add_suite_to_stats(self, suite):\n self.critical_stats.add_stat(suite.critical_stats)\n self.all_stats.add_stat(suite.all_stats)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L174_C8", "label": "add_stat()", "type": "expression", "loc": [174, 174], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L173_C4", "vector": [8, 2, 0.4133, 0.0024, 2, 0.37, 0.0, 363, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add_stat", "arg_names": [], "import_names": [], "rhs_call_name": "add_stat", "annotation": ""}, "snippet": " self.critical_stats.add_stat(suite.critical_stats)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L175_C8", "label": "add_stat()", "type": "expression", "loc": [175, 175], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L173_C4", "vector": [8, 2, 0.4157, 0.0024, 2, 0.37, 1.0, 363, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add_stat", "arg_names": [], "import_names": [], "rhs_call_name": "add_stat", "annotation": ""}, "snippet": " self.all_stats.add_stat(suite.all_stats)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L177_C4", "label": "suite_teardown_failed", "type": "function", "loc": [177, 187], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L66_C0", "vector": [2, 1, 0.4323, 0.0261, 1, 0.1, 0.5484, 553, 0, 2, 0, 0, 0, 0, 6], "semantic": {"name": "suite_teardown_failed", "arg_names": ["self", "message"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def suite_teardown_failed(self, message=None):\n if message:\n self._set_teardown_fail_msg(message)\n self.critical_stats.fail_all()\n self.all_stats.fail_all()\n self.status = self._get_status()\n sub_message = 'Teardown of the parent suite failed.'\n for suite in self.suites:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L178_C8", "label": "if", "type": "if", "loc": [178, 179], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L177_C4", "vector": [4, 2, 0.424, 0.0048, 2, 0.23, 0.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if message:\n self._set_teardown_fail_msg(message)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L179_C12", "label": "_set_teardown_fail_msg()", "type": "expression", "loc": [179, 179], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L178_C8", "vector": [8, 3, 0.4252, 0.0024, 3, 0.11, 0.0, 698, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_set_teardown_fail_msg", "arg_names": [], "import_names": [], "rhs_call_name": "_set_teardown_fail_msg", "annotation": ""}, "snippet": " self._set_teardown_fail_msg(message)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L180_C8", "label": "fail_all()", "type": "expression", "loc": [180, 180], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L177_C4", "vector": [8, 2, 0.4276, 0.0024, 2, 0.23, 0.1667, 181, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "fail_all", "arg_names": [], "import_names": [], "rhs_call_name": "fail_all", "annotation": ""}, "snippet": " self.critical_stats.fail_all()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L181_C8", "label": "fail_all()", "type": "expression", "loc": [181, 181], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L177_C4", "vector": [8, 2, 0.4299, 0.0024, 2, 0.23, 0.3333, 181, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "fail_all", "arg_names": [], "import_names": [], "rhs_call_name": "fail_all", "annotation": ""}, "snippet": " self.all_stats.fail_all()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L182_C8", "label": "self.status = _get_status()", "type": "assigned_variable", "loc": [182, 182], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L177_C4", "vector": [14, 2, 0.4323, 0.0024, 2, 0.23, 0.5, 651, 3, 0, 0, 0, 890, 10, 1], "semantic": {"name": "self.status", "arg_names": [], "import_names": [], "rhs_call_name": "_get_status", "annotation": ""}, "snippet": " self.status = self._get_status()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L183_C8", "label": "sub_message =", "type": "assigned_variable", "loc": [183, 183], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L177_C4", "vector": [14, 2, 0.4347, 0.0024, 2, 0.23, 0.6667, 938, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "sub_message", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sub_message = 'Teardown of the parent suite failed.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:For_L184_C8", "label": "for suite", "type": "for", "loc": [184, 185], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L177_C4", "vector": [6, 2, 0.4382, 0.0048, 2, 0.23, 0.8333, 425, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "suite", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for suite in self.suites:\n suite.suite_teardown_failed(sub_message)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L185_C12", "label": "suite_teardown_failed()", "type": "expression", "loc": [185, 185], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:For_L184_C8", "vector": [8, 3, 0.4394, 0.0024, 3, 0.25, 0.0, 553, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "suite_teardown_failed", "arg_names": [], "import_names": [], "rhs_call_name": "suite_teardown_failed", "annotation": ""}, "snippet": " suite.suite_teardown_failed(sub_message)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:For_L186_C8", "label": "for test", "type": "for", "loc": [186, 187], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L177_C4", "vector": [6, 2, 0.443, 0.0048, 2, 0.23, 1.0, 224, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "test", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for test in self.tests:\n test.suite_teardown_failed(sub_message)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L187_C12", "label": "suite_teardown_failed()", "type": "expression", "loc": [187, 187], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:For_L186_C8", "vector": [8, 3, 0.4442, 0.0024, 3, 0.27, 0.0, 553, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "suite_teardown_failed", "arg_names": [], "import_names": [], "rhs_call_name": "suite_teardown_failed", "annotation": ""}, "snippet": " test.suite_teardown_failed(sub_message)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L189_C4", "label": "set_tags", "type": "function", "loc": [189, 194], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L66_C0", "vector": [2, 1, 0.4549, 0.0143, 1, 0.1, 0.5806, 288, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "set_tags", "arg_names": ["self", "tags"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_tags(self, tags):\n if tags:\n for test in self.tests:\n test.tags = utils.normalize_tags(test.tags + tags)\n for suite in self.suites:\n suite.set_tags(tags)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L190_C8", "label": "if", "type": "if", "loc": [190, 194], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L189_C4", "vector": [4, 2, 0.4561, 0.0119, 2, 0.98, 0.0, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if tags:\n for test in self.tests:\n test.tags = utils.normalize_tags(test.tags + tags)\n for suite in self.suites:\n suite.set_tags(tags)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:For_L191_C12", "label": "for test", "type": "for", "loc": [191, 192], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L190_C8", "vector": [6, 3, 0.4549, 0.0048, 3, 0.51, 0.0, 224, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "test", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for test in self.tests:\n test.tags = utils.normalize_tags(test.tags + tags)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L192_C16", "label": "test.tags = normalize_tags()", "type": "assigned_variable", "loc": [192, 192], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:For_L191_C12", "vector": [14, 4, 0.4561, 0.0024, 4, 0.48, 0.0, 339, 3, 1, 0, 0, 625, 10, 1], "semantic": {"name": "test.tags", "arg_names": [], "import_names": [], "rhs_call_name": "normalize_tags", "annotation": ""}, "snippet": " test.tags = utils.normalize_tags(test.tags + tags)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:For_L193_C12", "label": "for suite", "type": "for", "loc": [193, 194], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L190_C8", "vector": [6, 3, 0.4596, 0.0048, 3, 0.51, 1.0, 425, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "suite", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for suite in self.suites:\n suite.set_tags(tags)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L194_C16", "label": "set_tags()", "type": "expression", "loc": [194, 194], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:For_L193_C12", "vector": [8, 4, 0.4608, 0.0024, 4, 0.98, 0.0, 288, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_tags", "arg_names": [], "import_names": [], "rhs_call_name": "set_tags", "annotation": ""}, "snippet": " suite.set_tags(tags)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L196_C4", "label": "filter", "type": "function", "loc": [196, 199], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L66_C0", "vector": [2, 1, 0.4691, 0.0095, 1, 0.1, 0.6129, 526, 0, 6, 0, 0, 0, 0, 2], "semantic": {"name": "filter", "arg_names": ["self", "suites", "tests", "includes", "excludes", "zero_tests_ok"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def filter(self, suites=None, tests=None, includes=None, excludes=None,\n zero_tests_ok=False):\n self.filter_by_names(suites, tests, zero_tests_ok)\n self.filter_by_tags(includes, excludes, zero_tests_ok)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L198_C8", "label": "filter_by_names()", "type": "expression", "loc": [198, 198], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L196_C4", "vector": [8, 2, 0.4703, 0.0024, 2, 0.85, 0.0, 140, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "filter_by_names", "arg_names": [], "import_names": [], "rhs_call_name": "filter_by_names", "annotation": ""}, "snippet": " self.filter_by_names(suites, tests, zero_tests_ok)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L199_C8", "label": "filter_by_tags()", "type": "expression", "loc": [199, 199], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L196_C4", "vector": [8, 2, 0.4727, 0.0024, 2, 0.85, 1.0, 443, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "filter_by_tags", "arg_names": [], "import_names": [], "rhs_call_name": "filter_by_tags", "annotation": ""}, "snippet": " self.filter_by_tags(includes, excludes, zero_tests_ok)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L201_C4", "label": "filter_by_names", "type": "function", "loc": [201, 207], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L66_C0", "vector": [2, 1, 0.4846, 0.0166, 1, 0.1, 0.6452, 140, 0, 4, 0, 0, 0, 0, 3], "semantic": {"name": "filter_by_names", "arg_names": ["self", "suites", "tests", "zero_tests_ok"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def filter_by_names(self, suites=None, tests=None, zero_tests_ok=False):\n if not (suites or tests):\n return\n suites = [([], name.split('.')) for name in suites or []]\n tests = tests or []\n if not self._filter_by_names(suites, tests) and not zero_tests_ok:\n self._raise_no_tests_filtered_by_names(suites, tests)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L202_C8", "label": "if", "type": "if", "loc": [202, 203], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L201_C4", "vector": [4, 2, 0.481, 0.0048, 2, 0.45, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not (suites or tests):\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L203_C12", "label": "return", "type": "return", "loc": [203, 203], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L202_C8", "vector": [13, 3, 0.4822, 0.0024, 3, 0.08, 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_99915:Assign_L204_C8", "label": "suites =", "type": "assigned_variable", "loc": [204, 204], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L201_C4", "vector": [14, 2, 0.4846, 0.0024, 2, 0.45, 0.3333, 481, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "suites", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " suites = [([], name.split('.')) for name in suites or []]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L205_C8", "label": "tests =", "type": "assigned_variable", "loc": [205, 205], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L201_C4", "vector": [14, 2, 0.4869, 0.0024, 2, 0.45, 0.6667, 416, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "tests", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " tests = tests or []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L206_C8", "label": "if", "type": "if", "loc": [206, 207], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L201_C4", "vector": [4, 2, 0.4905, 0.0048, 2, 0.45, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self._filter_by_names(suites, tests) and not zero_tests_ok:\n self._raise_no_tests_filtered_by_names(suites, tests)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L207_C12", "label": "_raise_no_tests_filtered_by_names()", "type": "expression", "loc": [207, 207], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L206_C8", "vector": [8, 3, 0.4917, 0.0024, 3, 0.42, 0.0, 721, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_raise_no_tests_filtered_by_names", "arg_names": [], "import_names": [], "rhs_call_name": "_raise_no_tests_filtered_by_names", "annotation": ""}, "snippet": " self._raise_no_tests_filtered_by_names(suites, tests)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L209_C4", "label": "_filter_by_names", "type": "function", "loc": [209, 219], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L66_C0", "vector": [2, 1, 0.5083, 0.0261, 1, 0.1, 0.6774, 87, 0, 3, 1, 0, 0, 0, 6], "semantic": {"name": "_filter_by_names", "arg_names": ["self", "suites", "tests"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _filter_by_names(self, suites, tests):\n suites = self._filter_suite_names(suites)\n self.suites = [suite for suite in self.suites\n if suite._filter_by_names(suites, tests)]\n if not suites:\n self.tests = [test for test in self.tests if tests == [] or\n any(utils.matches_any(name, tests, ignore=['_'])\n for name in [test.name, test.get_long_name()])]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L210_C8", "label": "suites = _filter_suite_names()", "type": "assigned_variable", "loc": [210, 210], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L209_C4", "vector": [14, 2, 0.4988, 0.0024, 2, 0.36, 0.0, 481, 3, 1, 0, 0, 200, 10, 1], "semantic": {"name": "suites", "arg_names": [], "import_names": [], "rhs_call_name": "_filter_suite_names", "annotation": ""}, "snippet": " suites = self._filter_suite_names(suites)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L211_C8", "label": "self.suites =", "type": "assigned_variable", "loc": [211, 212], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L209_C4", "vector": [14, 2, 0.5024, 0.0048, 2, 0.36, 0.3333, 941, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.suites", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.suites = [suite for suite in self.suites\n if suite._filter_by_names(suites, tests)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L213_C8", "label": "if", "type": "if", "loc": [213, 218], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L209_C4", "vector": [4, 2, 0.5119, 0.0143, 2, 0.36, 0.6667, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not suites:\n self.tests = [test for test in self.tests if tests == [] or\n any(utils.matches_any(name, tests, ignore=['_'])\n for name in [test.name, test.get_long_name()])]\n else:\n self.tests = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L214_C12", "label": "self.tests =", "type": "assigned_variable", "loc": [214, 216], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L213_C8", "vector": [14, 3, 0.5107, 0.0071, 3, 0.47, 0.0, 606, 5, 0, 0, 0, 0, 0, 3], "semantic": {"name": "self.tests", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.tests = [test for test in self.tests if tests == [] or\n any(utils.matches_any(name, tests, ignore=['_'])\n for name in [test.name, test.get_long_name()])]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L218_C12", "label": "self.tests =", "type": "assigned_variable", "loc": [218, 218], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L213_C8", "vector": [14, 3, 0.5178, 0.0024, 3, 0.47, 1.0, 606, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.tests", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.tests = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L219_C8", "label": "return", "type": "return", "loc": [219, 219], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L209_C4", "vector": [13, 2, 0.5202, 0.0024, 2, 0.36, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return bool(self.suites or self.tests)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L221_C4", "label": "_filter_suite_names", "type": "function", "loc": [221, 225], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L66_C0", "vector": [2, 1, 0.5297, 0.0119, 1, 0.1, 0.7097, 200, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "_filter_suite_names", "arg_names": ["self", "suites"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _filter_suite_names(self, suites):\n try:\n return [self._filter_suite_name(p, s) for p, s in suites]\n except StopIteration:\n return []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Try_L222_C8", "label": "try", "type": "try", "loc": [222, 225], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L221_C4", "vector": [7, 2, 0.5309, 0.0095, 2, 0.46, 0.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n return [self._filter_suite_name(p, s) for p, s in suites]\n except StopIteration:\n return []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L223_C12", "label": "return", "type": "return", "loc": [223, 223], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:Try_L222_C8", "vector": [13, 3, 0.5297, 0.0024, 3, 0.74, 0.0, 0, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [self._filter_suite_name(p, s) for p, s in suites]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L225_C12", "label": "return", "type": "return", "loc": [225, 225], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:Try_L222_C8", "vector": [13, 3, 0.5344, 0.0024, 3, 0.74, 0.0, 0, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L227_C4", "label": "_filter_suite_name", "type": "function", "loc": [227, 232], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L66_C0", "vector": [2, 1, 0.5451, 0.0143, 1, 0.1, 0.7419, 148, 0, 3, 1, 0, 0, 0, 3], "semantic": {"name": "_filter_suite_name", "arg_names": ["self", "parent", "suite"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _filter_suite_name(self, parent, suite):\n if utils.matches(self.name, suite[0], ignore=['_']):\n if len(suite) == 1:\n raise StopIteration('Match found')\n return (parent + [suite[0]], suite[1:])\n return ([], parent + suite)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L228_C8", "label": "if", "type": "if", "loc": [228, 231], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L227_C4", "vector": [4, 2, 0.5451, 0.0095, 2, 0.89, 0.0, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if utils.matches(self.name, suite[0], ignore=['_']):\n if len(suite) == 1:\n raise StopIteration('Match found')\n return (parent + [suite[0]], suite[1:])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L229_C12", "label": "if", "type": "if", "loc": [229, 230], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L228_C8", "vector": [4, 3, 0.5451, 0.0048, 3, 0.18, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(suite) == 1:\n raise StopIteration('Match found')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L231_C12", "label": "return", "type": "return", "loc": [231, 231], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L228_C8", "vector": [13, 3, 0.5487, 0.0024, 3, 0.18, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return (parent + [suite[0]], suite[1:])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L232_C8", "label": "return", "type": "return", "loc": [232, 232], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L227_C4", "vector": [13, 2, 0.5511, 0.0024, 2, 0.89, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ([], parent + suite)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L234_C4", "label": "_raise_no_tests_filtered_by_names", "type": "function", "loc": [234, 244], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L66_C0", "vector": [2, 1, 0.5677, 0.0261, 1, 0.1, 0.7742, 721, 0, 3, 0, 0, 0, 0, 4], "semantic": {"name": "_raise_no_tests_filtered_by_names", "arg_names": ["self", "suites", "tests"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _raise_no_tests_filtered_by_names(self, suites, tests):\n tests = utils.seq2str(tests, lastsep=' or ')\n suites = utils.seq2str(['.'.join(p + s) for p, s in suites],\n lastsep=' or ')\n if not suites:\n msg = 'test cases named %s.' % tests\n elif not tests:\n msg = 'test suites named %s.' % suites"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L235_C8", "label": "tests = seq2str()", "type": "assigned_variable", "loc": [235, 235], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L234_C4", "vector": [14, 2, 0.5582, 0.0024, 2, 0.21, 0.0, 416, 3, 2, 0, 0, 58, 10, 1], "semantic": {"name": "tests", "arg_names": [], "import_names": [], "rhs_call_name": "seq2str", "annotation": ""}, "snippet": " tests = utils.seq2str(tests, lastsep=' or ')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L236_C8", "label": "suites = seq2str()", "type": "assigned_variable", "loc": [236, 237], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L234_C4", "vector": [14, 2, 0.5618, 0.0048, 2, 0.21, 0.5, 481, 3, 2, 0, 0, 58, 10, 2], "semantic": {"name": "suites", "arg_names": [], "import_names": [], "rhs_call_name": "seq2str", "annotation": ""}, "snippet": " suites = utils.seq2str(['.'.join(p + s) for p, s in suites],\n lastsep=' or ')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L238_C8", "label": "if", "type": "if", "loc": [238, 243], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L234_C4", "vector": [4, 2, 0.5713, 0.0143, 2, 0.21, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not suites:\n msg = 'test cases named %s.' % tests\n elif not tests:\n msg = 'test suites named %s.' % suites\n else:\n msg = 'test cases %s in suites %s.' % (tests, suites)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L239_C12", "label": "msg =", "type": "assigned_variable", "loc": [239, 239], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L238_C8", "vector": [14, 3, 0.5677, 0.0024, 3, 0.81, 0.0, 712, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " msg = 'test cases named %s.' % tests"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L240_C8", "label": "if", "type": "if", "loc": [240, 243], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L238_C8", "vector": [4, 3, 0.5736, 0.0095, 3, 0.81, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif not tests:\n msg = 'test suites named %s.' % suites\n else:\n msg = 'test cases %s in suites %s.' % (tests, suites)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L241_C12", "label": "msg =", "type": "assigned_variable", "loc": [241, 241], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L240_C8", "vector": [14, 4, 0.5724, 0.0024, 4, 0.75, 0.0, 712, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " msg = 'test suites named %s.' % suites"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L243_C12", "label": "msg =", "type": "assigned_variable", "loc": [243, 243], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L240_C8", "vector": [14, 4, 0.5772, 0.0024, 4, 0.75, 1.0, 712, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " msg = 'test cases %s in suites %s.' % (tests, suites)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L246_C4", "label": "filter_by_tags", "type": "function", "loc": [246, 252], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L66_C0", "vector": [2, 1, 0.5914, 0.0166, 1, 0.1, 0.8065, 443, 0, 4, 0, 0, 0, 0, 2], "semantic": {"name": "filter_by_tags", "arg_names": ["self", "includes", "excludes", "zero_tests_ok"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def filter_by_tags(self, includes=None, excludes=None, zero_tests_ok=False):\n if not (includes or excludes):\n return\n includes = includes or []\n excludes = excludes or []\n if not self._filter_by_tags(includes, excludes) and not zero_tests_ok:\n self._raise_no_tests_filtered_by_tags(includes, excludes)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L247_C8", "label": "if", "type": "if", "loc": [247, 248], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L246_C4", "vector": [4, 2, 0.5879, 0.0048, 2, 0.32, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not (includes or excludes):\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L248_C12", "label": "return", "type": "return", "loc": [248, 248], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L247_C8", "vector": [13, 3, 0.5891, 0.0024, 3, 0.48, 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_99915:Assign_L249_C8", "label": "includes =", "type": "assigned_variable", "loc": [249, 249], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L246_C4", "vector": [14, 2, 0.5914, 0.0024, 2, 0.32, 0.3333, 671, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "includes", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " includes = includes or []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L250_C8", "label": "excludes =", "type": "assigned_variable", "loc": [250, 250], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L246_C4", "vector": [14, 2, 0.5938, 0.0024, 2, 0.32, 0.6667, 626, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "excludes", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " excludes = excludes or []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L251_C8", "label": "if", "type": "if", "loc": [251, 252], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L246_C4", "vector": [4, 2, 0.5974, 0.0048, 2, 0.32, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self._filter_by_tags(includes, excludes) and not zero_tests_ok:\n self._raise_no_tests_filtered_by_tags(includes, excludes)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L252_C12", "label": "_raise_no_tests_filtered_by_tags()", "type": "expression", "loc": [252, 252], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L251_C8", "vector": [8, 3, 0.5986, 0.0024, 3, 0.6, 0.0, 461, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_raise_no_tests_filtered_by_tags", "arg_names": [], "import_names": [], "rhs_call_name": "_raise_no_tests_filtered_by_tags", "annotation": ""}, "snippet": " self._raise_no_tests_filtered_by_tags(includes, excludes)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L254_C4", "label": "_filter_by_tags", "type": "function", "loc": [254, 259], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L66_C0", "vector": [2, 1, 0.6093, 0.0143, 1, 0.1, 0.8387, 712, 0, 3, 1, 0, 0, 0, 3], "semantic": {"name": "_filter_by_tags", "arg_names": ["self", "incls", "excls"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _filter_by_tags(self, incls, excls):\n self.suites = [suite for suite in self.suites\n if suite._filter_by_tags(incls, excls)]\n self.tests = [test for test in self.tests\n if test.is_included(incls, excls)]\n return bool(self.suites or self.tests)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L255_C8", "label": "self.suites =", "type": "assigned_variable", "loc": [255, 256], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L254_C4", "vector": [14, 2, 0.6069, 0.0048, 2, 0.62, 0.0, 941, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.suites", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.suites = [suite for suite in self.suites\n if suite._filter_by_tags(incls, excls)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L257_C8", "label": "self.tests =", "type": "assigned_variable", "loc": [257, 258], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L254_C4", "vector": [14, 2, 0.6116, 0.0048, 2, 0.62, 0.5, 606, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.tests", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.tests = [test for test in self.tests\n if test.is_included(incls, excls)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L259_C8", "label": "return", "type": "return", "loc": [259, 259], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L254_C4", "vector": [13, 2, 0.6152, 0.0024, 2, 0.62, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return bool(self.suites or self.tests)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L261_C4", "label": "_raise_no_tests_filtered_by_tags", "type": "function", "loc": [261, 271], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L66_C0", "vector": [2, 1, 0.6318, 0.0261, 1, 0.1, 0.871, 461, 0, 3, 0, 0, 0, 0, 3], "semantic": {"name": "_raise_no_tests_filtered_by_tags", "arg_names": ["self", "incls", "excls"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _raise_no_tests_filtered_by_tags(self, incls, excls):\n incl = utils.seq2str(incls)\n excl = utils.seq2str(excls)\n msg = \"Suite '%s' with \" % self.name\n if incl:\n msg += 'includes %s ' % incl\n if excl:\n msg += 'and '"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L262_C8", "label": "incl = seq2str()", "type": "assigned_variable", "loc": [262, 262], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L261_C4", "vector": [14, 2, 0.6223, 0.0024, 2, 0.03, 0.0, 976, 3, 1, 0, 0, 58, 10, 1], "semantic": {"name": "incl", "arg_names": [], "import_names": [], "rhs_call_name": "seq2str", "annotation": ""}, "snippet": " incl = utils.seq2str(incls)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L263_C8", "label": "excl = seq2str()", "type": "assigned_variable", "loc": [263, 263], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L261_C4", "vector": [14, 2, 0.6247, 0.0024, 2, 0.03, 0.25, 451, 3, 1, 0, 0, 58, 10, 1], "semantic": {"name": "excl", "arg_names": [], "import_names": [], "rhs_call_name": "seq2str", "annotation": ""}, "snippet": " excl = utils.seq2str(excls)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L264_C8", "label": "msg =", "type": "assigned_variable", "loc": [264, 264], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L261_C4", "vector": [14, 2, 0.6271, 0.0024, 2, 0.03, 0.5, 712, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "msg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " msg = \"Suite '%s' with \" % self.name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L265_C8", "label": "if", "type": "if", "loc": [265, 268], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L261_C4", "vector": [4, 2, 0.633, 0.0095, 2, 0.03, 0.75, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if incl:\n msg += 'includes %s ' % incl\n if excl:\n msg += 'and '"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L267_C12", "label": "if", "type": "if", "loc": [267, 268], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L265_C8", "vector": [4, 3, 0.6354, 0.0048, 3, 0.53, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if excl:\n msg += 'and '"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L269_C8", "label": "if", "type": "if", "loc": [269, 270], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L261_C4", "vector": [4, 2, 0.6401, 0.0048, 2, 0.03, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if excl:\n msg += 'excludes %s ' % excl"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L273_C4", "label": "set_runmode", "type": "function", "loc": [273, 291], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L66_C0", "vector": [2, 1, 0.6698, 0.0451, 1, 0.1, 0.9032, 75, 0, 2, 0, 0, 0, 0, 6], "semantic": {"name": "set_runmode", "arg_names": ["self", "runmode"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_runmode(self, runmode):\n runmode = runmode.upper()\n if runmode == 'EXITONFAILURE':\n self._run_mode_exit_on_failure = True\n elif runmode == 'SKIPTEARDOWNONEXIT':\n self._run_mode_skip_teardowns_on_exit = True\n elif runmode == 'DRYRUN':\n self._run_mode_dry_run = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L274_C8", "label": "runmode = upper()", "type": "assigned_variable", "loc": [274, 274], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L273_C4", "vector": [14, 2, 0.6508, 0.0024, 2, 0.47, 0.0, 583, 3, 0, 0, 0, 347, 10, 1], "semantic": {"name": "runmode", "arg_names": [], "import_names": [], "rhs_call_name": "upper", "annotation": ""}, "snippet": " runmode = runmode.upper()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L275_C8", "label": "if", "type": "if", "loc": [275, 289], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L273_C4", "vector": [4, 2, 0.6698, 0.0356, 2, 0.47, 0.5, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if runmode == 'EXITONFAILURE':\n self._run_mode_exit_on_failure = True\n elif runmode == 'SKIPTEARDOWNONEXIT':\n self._run_mode_skip_teardowns_on_exit = True\n elif runmode == 'DRYRUN':\n self._run_mode_dry_run = True\n elif runmode == 'RANDOM:TEST':\n random.shuffle(self.tests)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L276_C12", "label": "self._run_mode_exit_on_failure =", "type": "assigned_variable", "loc": [276, 276], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L275_C8", "vector": [14, 3, 0.6556, 0.0024, 3, 0.47, 0.0, 136, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self._run_mode_exit_on_failure", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._run_mode_exit_on_failure = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L277_C8", "label": "if", "type": "if", "loc": [277, 289], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L275_C8", "vector": [4, 3, 0.6722, 0.0309, 3, 0.47, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif runmode == 'SKIPTEARDOWNONEXIT':\n self._run_mode_skip_teardowns_on_exit = True\n elif runmode == 'DRYRUN':\n self._run_mode_dry_run = True\n elif runmode == 'RANDOM:TEST':\n random.shuffle(self.tests)\n elif runmode == 'RANDOM:SUITE':\n random.shuffle(self.suites)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L278_C12", "label": "self._run_mode_skip_teardowns_on_exit =", "type": "assigned_variable", "loc": [278, 278], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L277_C8", "vector": [14, 4, 0.6603, 0.0024, 4, 0.53, 0.0, 519, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self._run_mode_skip_teardowns_on_exit", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._run_mode_skip_teardowns_on_exit = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L279_C8", "label": "if", "type": "if", "loc": [279, 289], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L277_C8", "vector": [4, 4, 0.6746, 0.0261, 4, 0.53, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif runmode == 'DRYRUN':\n self._run_mode_dry_run = True\n elif runmode == 'RANDOM:TEST':\n random.shuffle(self.tests)\n elif runmode == 'RANDOM:SUITE':\n random.shuffle(self.suites)\n elif runmode == 'RANDOM:ALL':\n random.shuffle(self.suites)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L280_C12", "label": "self._run_mode_dry_run =", "type": "assigned_variable", "loc": [280, 280], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L279_C8", "vector": [14, 5, 0.6651, 0.0024, 5, 0.36, 0.0, 569, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self._run_mode_dry_run", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._run_mode_dry_run = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L281_C8", "label": "if", "type": "if", "loc": [281, 289], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L279_C8", "vector": [4, 5, 0.677, 0.0214, 5, 0.36, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif runmode == 'RANDOM:TEST':\n random.shuffle(self.tests)\n elif runmode == 'RANDOM:SUITE':\n random.shuffle(self.suites)\n elif runmode == 'RANDOM:ALL':\n random.shuffle(self.suites)\n random.shuffle(self.tests)\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L282_C12", "label": "shuffle()", "type": "expression", "loc": [282, 282], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L281_C8", "vector": [8, 6, 0.6698, 0.0024, 6, 0.8, 0.0, 903, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "shuffle", "arg_names": [], "import_names": [], "rhs_call_name": "shuffle", "annotation": ""}, "snippet": " random.shuffle(self.tests)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L283_C8", "label": "if", "type": "if", "loc": [283, 289], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L281_C8", "vector": [4, 6, 0.6793, 0.0166, 6, 0.8, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif runmode == 'RANDOM:SUITE':\n random.shuffle(self.suites)\n elif runmode == 'RANDOM:ALL':\n random.shuffle(self.suites)\n random.shuffle(self.tests)\n else:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L284_C12", "label": "shuffle()", "type": "expression", "loc": [284, 284], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L283_C8", "vector": [8, 7, 0.6746, 0.0024, 7, 0.88, 0.0, 903, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "shuffle", "arg_names": [], "import_names": [], "rhs_call_name": "shuffle", "annotation": ""}, "snippet": " random.shuffle(self.suites)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L285_C8", "label": "if", "type": "if", "loc": [285, 289], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L283_C8", "vector": [4, 7, 0.6817, 0.0119, 7, 0.88, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif runmode == 'RANDOM:ALL':\n random.shuffle(self.suites)\n random.shuffle(self.tests)\n else:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L286_C12", "label": "shuffle()", "type": "expression", "loc": [286, 286], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L285_C8", "vector": [8, 8, 0.6793, 0.0024, 8, 0.92, 0.0, 903, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "shuffle", "arg_names": [], "import_names": [], "rhs_call_name": "shuffle", "annotation": ""}, "snippet": " random.shuffle(self.suites)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L287_C12", "label": "shuffle()", "type": "expression", "loc": [287, 287], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L285_C8", "vector": [8, 8, 0.6817, 0.0024, 8, 0.92, 0.5, 903, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "shuffle", "arg_names": [], "import_names": [], "rhs_call_name": "shuffle", "annotation": ""}, "snippet": " random.shuffle(self.tests)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L289_C12", "label": "return", "type": "return", "loc": [289, 289], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L285_C8", "vector": [13, 8, 0.6865, 0.0024, 8, 0.92, 1.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_99915:For_L290_C8", "label": "for suite", "type": "for", "loc": [290, 291], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L273_C4", "vector": [6, 2, 0.69, 0.0048, 2, 0.47, 1.0, 425, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "suite", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for suite in self.suites:\n suite.set_runmode(runmode)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L291_C12", "label": "set_runmode()", "type": "expression", "loc": [291, 291], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:For_L290_C8", "vector": [8, 3, 0.6912, 0.0024, 3, 0.71, 0.0, 75, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_runmode", "arg_names": [], "import_names": [], "rhs_call_name": "set_runmode", "annotation": ""}, "snippet": " suite.set_runmode(runmode)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L293_C4", "label": "set_options", "type": "function", "loc": [293, 306], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L66_C0", "vector": [2, 1, 0.7114, 0.0333, 1, 0.1, 0.9355, 961, 0, 2, 0, 0, 0, 0, 8], "semantic": {"name": "set_options", "arg_names": ["self", "settings"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_options(self, settings):\n self.set_tags(settings['SetTag'])\n self.filter(settings['SuiteNames'], settings['TestNames'],\n settings['Include'], settings['Exclude'],\n settings['RunEmptySuite'])\n self.set_name(settings['Name'])\n self.set_doc(settings['Doc'])\n self.set_metadata(settings['Metadata'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L294_C8", "label": "set_tags()", "type": "expression", "loc": [294, 294], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L293_C4", "vector": [8, 2, 0.6983, 0.0024, 2, 0.88, 0.0, 288, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_tags", "arg_names": [], "import_names": [], "rhs_call_name": "set_tags", "annotation": ""}, "snippet": " self.set_tags(settings['SetTag'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L295_C8", "label": "filter()", "type": "expression", "loc": [295, 297], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L293_C4", "vector": [8, 2, 0.7031, 0.0071, 2, 0.88, 0.125, 526, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "filter", "arg_names": [], "import_names": [], "rhs_call_name": "filter", "annotation": ""}, "snippet": " self.filter(settings['SuiteNames'], settings['TestNames'],\n settings['Include'], settings['Exclude'],\n settings['RunEmptySuite'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L298_C8", "label": "set_name()", "type": "expression", "loc": [298, 298], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L293_C4", "vector": [8, 2, 0.7078, 0.0024, 2, 0.88, 0.25, 435, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_name", "arg_names": [], "import_names": [], "rhs_call_name": "set_name", "annotation": ""}, "snippet": " self.set_name(settings['Name'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L299_C8", "label": "set_doc()", "type": "expression", "loc": [299, 299], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L293_C4", "vector": [8, 2, 0.7102, 0.0024, 2, 0.88, 0.375, 936, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_doc", "arg_names": [], "import_names": [], "rhs_call_name": "set_doc", "annotation": ""}, "snippet": " self.set_doc(settings['Doc'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L300_C8", "label": "set_metadata()", "type": "expression", "loc": [300, 300], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L293_C4", "vector": [8, 2, 0.7126, 0.0024, 2, 0.88, 0.5, 345, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "set_metadata", "arg_names": [], "import_names": [], "rhs_call_name": "set_metadata", "annotation": ""}, "snippet": " self.set_metadata(settings['Metadata'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L301_C8", "label": "set_critical_tags()", "type": "expression", "loc": [301, 301], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L293_C4", "vector": [8, 2, 0.715, 0.0024, 2, 0.88, 0.625, 861, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_critical_tags", "arg_names": [], "import_names": [], "rhs_call_name": "set_critical_tags", "annotation": ""}, "snippet": " self.set_critical_tags(settings['Critical'], settings['NonCritical'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L302_C8", "label": "self._return_status_rc =", "type": "assigned_variable", "loc": [302, 302], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L293_C4", "vector": [14, 2, 0.7173, 0.0024, 2, 0.88, 0.75, 491, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._return_status_rc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._return_status_rc = not settings['NoStatusRC']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L303_C8", "label": "if", "type": "if", "loc": [303, 304], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L293_C4", "vector": [4, 2, 0.7209, 0.0048, 2, 0.88, 0.875, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'RunMode' in settings:\n map(self.set_runmode, settings['RunMode'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L304_C12", "label": "map()", "type": "expression", "loc": [304, 304], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L303_C8", "vector": [8, 3, 0.7221, 0.0024, 3, 0.73, 0.0, 53, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "map", "arg_names": [], "import_names": [], "rhs_call_name": "map", "annotation": ""}, "snippet": " map(self.set_runmode, settings['RunMode'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L305_C8", "label": "if", "type": "if", "loc": [305, 306], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L293_C4", "vector": [4, 2, 0.7257, 0.0048, 2, 0.88, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'RemoveKeywords' in settings:\n self.remove_keywords(settings['RemoveKeywords'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L306_C12", "label": "remove_keywords()", "type": "expression", "loc": [306, 306], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L305_C8", "vector": [8, 3, 0.7268, 0.0024, 3, 0.64, 0.0, 336, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "remove_keywords", "arg_names": [], "import_names": [], "rhs_call_name": "remove_keywords", "annotation": ""}, "snippet": " self.remove_keywords(settings['RemoveKeywords'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L308_C4", "label": "serialize", "type": "function", "loc": [308, 318], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L66_C0", "vector": [2, 1, 0.7435, 0.0261, 1, 0.1, 0.9677, 50, 0, 2, 0, 0, 0, 0, 6], "semantic": {"name": "serialize", "arg_names": ["self", "serializer"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def serialize(self, serializer):\n serializer.start_suite(self)\n if self.setup is not None:\n self.setup.serialize(serializer)\n if self.teardown is not None:\n self.teardown.serialize(serializer)\n for suite in self.suites:\n suite.serialize(serializer)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L309_C8", "label": "start_suite()", "type": "expression", "loc": [309, 309], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L308_C4", "vector": [8, 2, 0.734, 0.0024, 2, 0.9, 0.0, 38, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "start_suite", "arg_names": [], "import_names": [], "rhs_call_name": "start_suite", "annotation": ""}, "snippet": " serializer.start_suite(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L310_C8", "label": "if", "type": "if", "loc": [310, 311], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L308_C4", "vector": [4, 2, 0.7375, 0.0048, 2, 0.9, 0.2, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.setup is not None:\n self.setup.serialize(serializer)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L311_C12", "label": "serialize()", "type": "expression", "loc": [311, 311], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L310_C8", "vector": [8, 3, 0.7387, 0.0024, 3, 0.93, 0.0, 50, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "serialize", "arg_names": [], "import_names": [], "rhs_call_name": "serialize", "annotation": ""}, "snippet": " self.setup.serialize(serializer)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L312_C8", "label": "if", "type": "if", "loc": [312, 313], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L308_C4", "vector": [4, 2, 0.7423, 0.0048, 2, 0.9, 0.4, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.teardown is not None:\n self.teardown.serialize(serializer)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L313_C12", "label": "serialize()", "type": "expression", "loc": [313, 313], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L312_C8", "vector": [8, 3, 0.7435, 0.0024, 3, 0.89, 0.0, 50, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "serialize", "arg_names": [], "import_names": [], "rhs_call_name": "serialize", "annotation": ""}, "snippet": " self.teardown.serialize(serializer)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:For_L314_C8", "label": "for suite", "type": "for", "loc": [314, 315], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L308_C4", "vector": [6, 2, 0.747, 0.0048, 2, 0.9, 0.6, 425, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "suite", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for suite in self.suites:\n suite.serialize(serializer)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L315_C12", "label": "serialize()", "type": "expression", "loc": [315, 315], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:For_L314_C8", "vector": [8, 3, 0.7482, 0.0024, 3, 0.87, 0.0, 50, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "serialize", "arg_names": [], "import_names": [], "rhs_call_name": "serialize", "annotation": ""}, "snippet": " suite.serialize(serializer)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:For_L316_C8", "label": "for test", "type": "for", "loc": [316, 317], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L308_C4", "vector": [6, 2, 0.7518, 0.0048, 2, 0.9, 0.8, 224, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "test", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for test in self.tests:\n test.serialize(serializer)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L317_C12", "label": "serialize()", "type": "expression", "loc": [317, 317], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:For_L316_C8", "vector": [8, 3, 0.753, 0.0024, 3, 0.87, 0.0, 50, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "serialize", "arg_names": [], "import_names": [], "rhs_call_name": "serialize", "annotation": ""}, "snippet": " test.serialize(serializer)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L318_C8", "label": "end_suite()", "type": "expression", "loc": [318, 318], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L308_C4", "vector": [8, 2, 0.7553, 0.0024, 2, 0.9, 1.0, 81, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "end_suite", "arg_names": [], "import_names": [], "rhs_call_name": "end_suite", "annotation": ""}, "snippet": " serializer.end_suite(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L321_C4", "label": "return_code", "type": "function", "loc": [321, 323], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L66_C0", "vector": [2, 1, 0.7648, 0.0071, 1, 0.1, 1.0, 647, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "return_code", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def return_code(self):\n rc = min(self.critical_stats.failed, 250)\n return rc if self._return_status_rc else 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L322_C8", "label": "rc = min()", "type": "assigned_variable", "loc": [322, 322], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L321_C4", "vector": [14, 2, 0.7648, 0.0024, 2, 0.46, 0.0, 401, 3, 2, 0, 0, 867, 10, 1], "semantic": {"name": "rc", "arg_names": [], "import_names": [], "rhs_call_name": "min", "annotation": ""}, "snippet": " rc = min(self.critical_stats.failed, 250)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L323_C8", "label": "return", "type": "return", "loc": [323, 323], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L321_C4", "vector": [13, 2, 0.7672, 0.0024, 2, 0.46, 1.0, 0, 8, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return rc if self._return_status_rc else 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L326_C0", "label": "BaseTestCase", "type": "class", "loc": [326, 396], "level": 0, "parent": null, "vector": [3, 0, 0.8575, 0.1686, 0, 0.66, 0.8571, 639, 0, 9, 0, 0, 935, 0, 24], "semantic": {"name": "BaseTestCase", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class BaseTestCase(_TestAndSuiteHelper):\n\n def __init__(self, name, parent):\n _TestAndSuiteHelper.__init__(self, name, parent)\n self.critical = 'yes'\n if parent:\n parent.tests.append(self)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L328_C4", "label": "__init__", "type": "function", "loc": [328, 332], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L326_C0", "vector": [2, 1, 0.7838, 0.0119, 1, 0.8, 0.0, 555, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "name", "parent"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, name, parent):\n _TestAndSuiteHelper.__init__(self, name, parent)\n self.critical = 'yes'\n if parent:\n parent.tests.append(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L329_C8", "label": "__init__()", "type": "expression", "loc": [329, 329], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L328_C4", "vector": [8, 2, 0.7815, 0.0024, 2, 0.04, 0.0, 555, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " _TestAndSuiteHelper.__init__(self, name, parent)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L330_C8", "label": "self.critical =", "type": "assigned_variable", "loc": [330, 330], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L328_C4", "vector": [14, 2, 0.7838, 0.0024, 2, 0.04, 0.5, 227, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.critical", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.critical = 'yes'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L331_C8", "label": "if", "type": "if", "loc": [331, 332], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L328_C4", "vector": [4, 2, 0.7874, 0.0048, 2, 0.04, 1.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if parent:\n parent.tests.append(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L332_C12", "label": "append()", "type": "expression", "loc": [332, 332], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L331_C8", "vector": [8, 3, 0.7886, 0.0024, 3, 0.0, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " parent.tests.append(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L334_C4", "label": "suite_teardown_failed", "type": "function", "loc": [334, 336], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L326_C0", "vector": [2, 1, 0.7957, 0.0071, 1, 0.8, 0.125, 553, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "suite_teardown_failed", "arg_names": ["self", "message"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def suite_teardown_failed(self, message):\n self.status = 'FAIL'\n self._set_teardown_fail_msg(message)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L335_C8", "label": "self.status =", "type": "assigned_variable", "loc": [335, 335], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L334_C4", "vector": [14, 2, 0.7957, 0.0024, 2, 0.3, 0.0, 651, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.status", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.status = 'FAIL'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L336_C8", "label": "_set_teardown_fail_msg()", "type": "expression", "loc": [336, 336], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L334_C4", "vector": [8, 2, 0.7981, 0.0024, 2, 0.3, 1.0, 698, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_set_teardown_fail_msg", "arg_names": [], "import_names": [], "rhs_call_name": "_set_teardown_fail_msg", "annotation": ""}, "snippet": " self._set_teardown_fail_msg(message)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L338_C4", "label": "set_criticality", "type": "function", "loc": [338, 339], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L326_C0", "vector": [2, 1, 0.804, 0.0048, 1, 0.8, 0.25, 158, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set_criticality", "arg_names": ["self", "critical"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_criticality(self, critical):\n self.critical = 'yes' if critical.are_critical(self.tags) else 'no'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L339_C8", "label": "self.critical =", "type": "assigned_variable", "loc": [339, 339], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L338_C4", "vector": [14, 2, 0.8052, 0.0024, 2, 0.69, 0.0, 227, 8, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self.critical", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.critical = 'yes' if critical.are_critical(self.tags) else 'no'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L341_C4", "label": "is_included", "type": "function", "loc": [341, 348], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L326_C0", "vector": [2, 1, 0.8183, 0.019, 1, 0.8, 0.375, 934, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "is_included", "arg_names": ["self", "incl_tags", "excl_tags"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def is_included(self, incl_tags, excl_tags):\n \"\"\"Returns True if this test case is included but not excluded.\n\n If no 'incl_tags' are given all tests are considered to be included.\n \"\"\"\n included = not incl_tags or self._matches_any_tag_rule(incl_tags)\n excluded = self._matches_any_tag_rule(excl_tags)\n return included and not excluded"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L342_C8", "label": "expression", "type": "expression", "loc": [342, 345], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L341_C4", "vector": [8, 2, 0.8159, 0.0095, 2, 0.55, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Returns True if this test case is included but not excluded.\n\n If no 'incl_tags' are given all tests are considered to be included.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L346_C8", "label": "included =", "type": "assigned_variable", "loc": [346, 346], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L341_C4", "vector": [14, 2, 0.8219, 0.0024, 2, 0.55, 0.3333, 335, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "included", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " included = not incl_tags or self._matches_any_tag_rule(incl_tags)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L347_C8", "label": "excluded = _matches_any_tag_rule()", "type": "assigned_variable", "loc": [347, 347], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L341_C4", "vector": [14, 2, 0.8242, 0.0024, 2, 0.55, 0.6667, 44, 3, 1, 0, 0, 565, 10, 1], "semantic": {"name": "excluded", "arg_names": [], "import_names": [], "rhs_call_name": "_matches_any_tag_rule", "annotation": ""}, "snippet": " excluded = self._matches_any_tag_rule(excl_tags)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L348_C8", "label": "return", "type": "return", "loc": [348, 348], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L341_C4", "vector": [13, 2, 0.8266, 0.0024, 2, 0.55, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return included and not excluded"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L350_C4", "label": "_matches_any_tag_rule", "type": "function", "loc": [350, 357], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L326_C0", "vector": [2, 1, 0.8397, 0.019, 1, 0.8, 0.5, 565, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "_matches_any_tag_rule", "arg_names": ["self", "tag_rules"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _matches_any_tag_rule(self, tag_rules):\n \"\"\"Returns True if any of tag_rules matches self.tags\n\n Matching equals supporting AND, & and NOT boolean operators and simple\n pattern matching. NOT is 'or' operation meaning if any of the NOTs is\n matching, False is returned.\n \"\"\"\n return any(self._matches_tag_rule(rule) for rule in tag_rules)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L351_C8", "label": "expression", "type": "expression", "loc": [351, 356], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L350_C4", "vector": [8, 2, 0.8397, 0.0143, 2, 0.45, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Returns True if any of tag_rules matches self.tags\n\n Matching equals supporting AND, & and NOT boolean operators and simple\n pattern matching. NOT is 'or' operation meaning if any of the NOTs is\n matching, False is returned.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L357_C8", "label": "return", "type": "return", "loc": [357, 357], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L350_C4", "vector": [13, 2, 0.848, 0.0024, 2, 0.45, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return any(self._matches_tag_rule(rule) for rule in tag_rules)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L359_C4", "label": "_matches_tag_rule", "type": "function", "loc": [359, 365], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L326_C0", "vector": [2, 1, 0.8599, 0.0166, 1, 0.8, 0.625, 632, 0, 2, 1, 0, 0, 0, 6], "semantic": {"name": "_matches_tag_rule", "arg_names": ["self", "tag_rule"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _matches_tag_rule(self, tag_rule):\n if 'NOT' not in tag_rule:\n return self._matches_tag(tag_rule)\n nots = tag_rule.split('NOT')\n should_match = nots.pop(0)\n return self._matches_tag(should_match) \\\n and not any(self._matches_tag(n) for n in nots)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L360_C8", "label": "if", "type": "if", "loc": [360, 361], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L359_C4", "vector": [4, 2, 0.8563, 0.0048, 2, 0.73, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'NOT' not in tag_rule:\n return self._matches_tag(tag_rule)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L361_C12", "label": "return", "type": "return", "loc": [361, 361], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L360_C8", "vector": [13, 3, 0.8575, 0.0024, 3, 0.3, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._matches_tag(tag_rule)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L362_C8", "label": "nots = split()", "type": "assigned_variable", "loc": [362, 362], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L359_C4", "vector": [14, 2, 0.8599, 0.0024, 2, 0.73, 0.3333, 919, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "nots", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " nots = tag_rule.split('NOT')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L363_C8", "label": "should_match = pop()", "type": "assigned_variable", "loc": [363, 363], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L359_C4", "vector": [14, 2, 0.8622, 0.0024, 2, 0.73, 0.6667, 953, 3, 1, 0, 0, 969, 10, 1], "semantic": {"name": "should_match", "arg_names": [], "import_names": [], "rhs_call_name": "pop", "annotation": ""}, "snippet": " should_match = nots.pop(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L364_C8", "label": "return", "type": "return", "loc": [364, 365], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L359_C4", "vector": [13, 2, 0.8658, 0.0048, 2, 0.73, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._matches_tag(should_match) \\\n and not any(self._matches_tag(n) for n in nots)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L367_C4", "label": "_matches_tag", "type": "function", "loc": [367, 376], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L326_C0", "vector": [2, 1, 0.8824, 0.0238, 1, 0.8, 0.75, 632, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "_matches_tag", "arg_names": ["self", "tag"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _matches_tag(self, tag):\n \"\"\"Returns True if given tag matches any tag from self.tags.\n\n Note that given tag may be ANDed combination of multiple tags (e.g.\n tag1&tag2) and then all of them must match some tag from self.tags.\n \"\"\"\n for item in tag.split('&'):\n if not any(utils.matches(t, item, ignore=['_']) for t in self.tags):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L368_C8", "label": "expression", "type": "expression", "loc": [368, 372], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L367_C4", "vector": [8, 2, 0.8789, 0.0119, 2, 0.7, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Returns True if given tag matches any tag from self.tags.\n\n Note that given tag may be ANDed combination of multiple tags (e.g.\n tag1&tag2) and then all of them must match some tag from self.tags.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:For_L373_C8", "label": "for item", "type": "for", "loc": [373, 375], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L367_C4", "vector": [6, 2, 0.8884, 0.0071, 2, 0.7, 0.5, 434, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "item", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for item in tag.split('&'):\n if not any(utils.matches(t, item, ignore=['_']) for t in self.tags):\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L374_C12", "label": "if", "type": "if", "loc": [374, 375], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:For_L373_C8", "vector": [4, 3, 0.8895, 0.0048, 3, 0.13, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not any(utils.matches(t, item, ignore=['_']) for t in self.tags):\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L375_C16", "label": "return", "type": "return", "loc": [375, 375], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L374_C12", "vector": [13, 4, 0.8907, 0.0024, 4, 0.41, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L376_C8", "label": "return", "type": "return", "loc": [376, 376], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L367_C4", "vector": [13, 2, 0.8931, 0.0024, 2, 0.7, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L378_C4", "label": "__cmp__", "type": "function", "loc": [378, 386], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L326_C0", "vector": [2, 1, 0.9074, 0.0214, 1, 0.8, 0.875, 271, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "__cmp__", "arg_names": ["self", "other"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __cmp__(self, other):\n if self.status != other.status:\n return -1 if self.status == 'FAIL' else 1\n if self.critical != other.critical:\n return -1 if self.critical == 'yes' else 1\n try:\n return cmp(self.longname, other.longname)\n except AttributeError:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L379_C8", "label": "if", "type": "if", "loc": [379, 380], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L378_C4", "vector": [4, 2, 0.9014, 0.0048, 2, 0.15, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.status != other.status:\n return -1 if self.status == 'FAIL' else 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L380_C12", "label": "return", "type": "return", "loc": [380, 380], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L379_C8", "vector": [13, 3, 0.9026, 0.0024, 3, 0.7, 0.0, 0, 8, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return -1 if self.status == 'FAIL' else 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L381_C8", "label": "if", "type": "if", "loc": [381, 382], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L378_C4", "vector": [4, 2, 0.9062, 0.0048, 2, 0.15, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.critical != other.critical:\n return -1 if self.critical == 'yes' else 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L382_C12", "label": "return", "type": "return", "loc": [382, 382], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L381_C8", "vector": [13, 3, 0.9074, 0.0024, 3, 0.35, 0.0, 0, 8, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return -1 if self.critical == 'yes' else 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Try_L383_C8", "label": "try", "type": "try", "loc": [383, 386], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L378_C4", "vector": [7, 2, 0.9133, 0.0095, 2, 0.15, 1.0, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n return cmp(self.longname, other.longname)\n except AttributeError:\n return cmp(self.name, other.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L384_C12", "label": "return", "type": "return", "loc": [384, 384], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:Try_L383_C8", "vector": [13, 3, 0.9121, 0.0024, 3, 0.57, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return cmp(self.longname, other.longname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L386_C12", "label": "return", "type": "return", "loc": [386, 386], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:Try_L383_C8", "vector": [13, 3, 0.9169, 0.0024, 3, 0.57, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return cmp(self.name, other.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L388_C4", "label": "serialize", "type": "function", "loc": [388, 396], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L326_C0", "vector": [2, 1, 0.9311, 0.0214, 1, 0.8, 1.0, 50, 0, 2, 0, 0, 0, 0, 5], "semantic": {"name": "serialize", "arg_names": ["self", "serializer"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def serialize(self, serializer):\n serializer.start_test(self)\n if self.setup is not None:\n self.setup.serialize(serializer)\n for kw in self.keywords:\n kw.serialize(serializer)\n if self.teardown is not None:\n self.teardown.serialize(serializer)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L389_C8", "label": "start_test()", "type": "expression", "loc": [389, 389], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L388_C4", "vector": [8, 2, 0.924, 0.0024, 2, 0.03, 0.0, 246, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "start_test", "arg_names": [], "import_names": [], "rhs_call_name": "start_test", "annotation": ""}, "snippet": " serializer.start_test(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L390_C8", "label": "if", "type": "if", "loc": [390, 391], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L388_C4", "vector": [4, 2, 0.9276, 0.0048, 2, 0.03, 0.25, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.setup is not None:\n self.setup.serialize(serializer)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L391_C12", "label": "serialize()", "type": "expression", "loc": [391, 391], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L390_C8", "vector": [8, 3, 0.9287, 0.0024, 3, 0.72, 0.0, 50, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "serialize", "arg_names": [], "import_names": [], "rhs_call_name": "serialize", "annotation": ""}, "snippet": " self.setup.serialize(serializer)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:For_L392_C8", "label": "for kw", "type": "for", "loc": [392, 393], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L388_C4", "vector": [6, 2, 0.9323, 0.0048, 2, 0.03, 0.5, 755, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "kw", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for kw in self.keywords:\n kw.serialize(serializer)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L393_C12", "label": "serialize()", "type": "expression", "loc": [393, 393], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:For_L392_C8", "vector": [8, 3, 0.9335, 0.0024, 3, 0.55, 0.0, 50, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "serialize", "arg_names": [], "import_names": [], "rhs_call_name": "serialize", "annotation": ""}, "snippet": " kw.serialize(serializer)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L394_C8", "label": "if", "type": "if", "loc": [394, 395], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L388_C4", "vector": [4, 2, 0.9371, 0.0048, 2, 0.03, 0.75, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.teardown is not None:\n self.teardown.serialize(serializer)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L395_C12", "label": "serialize()", "type": "expression", "loc": [395, 395], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L394_C8", "vector": [8, 3, 0.9382, 0.0024, 3, 0.23, 0.0, 50, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "serialize", "arg_names": [], "import_names": [], "rhs_call_name": "serialize", "annotation": ""}, "snippet": " self.teardown.serialize(serializer)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L396_C8", "label": "end_test()", "type": "expression", "loc": [396, 396], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L388_C4", "vector": [8, 2, 0.9406, 0.0024, 2, 0.03, 1.0, 220, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "end_test", "arg_names": [], "import_names": [], "rhs_call_name": "end_test", "annotation": ""}, "snippet": " serializer.end_test(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L399_C0", "label": "_Critical", "type": "class", "loc": [399, 421], "level": 0, "parent": null, "vector": [3, 0, 0.9739, 0.0546, 0, 0.66, 1.0, 650, 0, 5, 0, 0, 0, 0, 7], "semantic": {"name": "_Critical", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _Critical:\n\n def __init__(self, tags=None, nons=None):\n self.set(tags, nons)\n\n def set(self, tags, nons):\n self.tags = utils.normalize_tags(tags or [])\n self.nons = utils.normalize_tags(nons or [])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L401_C4", "label": "__init__", "type": "function", "loc": [401, 402], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L399_C0", "vector": [2, 1, 0.9537, 0.0048, 1, 0.1, 0.0, 555, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "tags", "nons"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, tags=None, nons=None):\n self.set(tags, nons)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L402_C8", "label": "set()", "type": "expression", "loc": [402, 402], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L401_C4", "vector": [8, 2, 0.9549, 0.0024, 2, 0.54, 0.0, 21, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "set", "arg_names": [], "import_names": [], "rhs_call_name": "set", "annotation": ""}, "snippet": " self.set(tags, nons)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L404_C4", "label": "set", "type": "function", "loc": [404, 406], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L399_C0", "vector": [2, 1, 0.962, 0.0071, 1, 0.1, 0.25, 21, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "set", "arg_names": ["self", "tags", "nons"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set(self, tags, nons):\n self.tags = utils.normalize_tags(tags or [])\n self.nons = utils.normalize_tags(nons or [])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L405_C8", "label": "self.tags = normalize_tags()", "type": "assigned_variable", "loc": [405, 405], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L404_C4", "vector": [14, 2, 0.962, 0.0024, 2, 0.22, 0.0, 664, 3, 1, 0, 0, 625, 10, 1], "semantic": {"name": "self.tags", "arg_names": [], "import_names": [], "rhs_call_name": "normalize_tags", "annotation": ""}, "snippet": " self.tags = utils.normalize_tags(tags or [])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L406_C8", "label": "self.nons = normalize_tags()", "type": "assigned_variable", "loc": [406, 406], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L404_C4", "vector": [14, 2, 0.9644, 0.0024, 2, 0.22, 1.0, 909, 3, 1, 0, 0, 625, 10, 1], "semantic": {"name": "self.nons", "arg_names": [], "import_names": [], "rhs_call_name": "normalize_tags", "annotation": ""}, "snippet": " self.nons = utils.normalize_tags(nons or [])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L408_C4", "label": "is_critical", "type": "function", "loc": [408, 409], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L399_C0", "vector": [2, 1, 0.9703, 0.0048, 1, 0.1, 0.5, 928, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "is_critical", "arg_names": ["self", "tag"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def is_critical(self, tag):\n return utils.matches_any(tag, self.tags)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L409_C8", "label": "return", "type": "return", "loc": [409, 409], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L408_C4", "vector": [13, 2, 0.9715, 0.0024, 2, 0.97, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return utils.matches_any(tag, self.tags)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L411_C4", "label": "is_non_critical", "type": "function", "loc": [411, 412], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L399_C0", "vector": [2, 1, 0.9774, 0.0048, 1, 0.1, 0.75, 774, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "is_non_critical", "arg_names": ["self", "tag"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def is_non_critical(self, tag):\n return utils.matches_any(tag, self.nons)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L412_C8", "label": "return", "type": "return", "loc": [412, 412], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L411_C4", "vector": [13, 2, 0.9786, 0.0024, 2, 0.71, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return utils.matches_any(tag, self.nons)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L414_C4", "label": "are_critical", "type": "function", "loc": [414, 421], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L399_C0", "vector": [2, 1, 0.9917, 0.019, 1, 0.1, 1.0, 959, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "are_critical", "arg_names": ["self", "tags"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def are_critical(self, tags):\n for tag in tags:\n if self.is_non_critical(tag):\n return False\n for tag in tags:\n if self.is_critical(tag):\n return True\n return not self.tags"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:For_L415_C8", "label": "for tag", "type": "for", "loc": [415, 417], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L414_C4", "vector": [6, 2, 0.9881, 0.0071, 2, 0.23, 0.0, 732, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "tag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for tag in tags:\n if self.is_non_critical(tag):\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L416_C12", "label": "if", "type": "if", "loc": [416, 417], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:For_L415_C8", "vector": [4, 3, 0.9893, 0.0048, 3, 0.75, 0.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.is_non_critical(tag):\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L417_C16", "label": "return", "type": "return", "loc": [417, 417], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L416_C12", "vector": [13, 4, 0.9905, 0.0024, 4, 0.21, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:For_L418_C8", "label": "for tag", "type": "for", "loc": [418, 420], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L414_C4", "vector": [6, 2, 0.9952, 0.0071, 2, 0.23, 0.5, 732, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "tag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for tag in tags:\n if self.is_critical(tag):\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L419_C12", "label": "if", "type": "if", "loc": [419, 420], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:For_L418_C8", "vector": [4, 3, 0.9964, 0.0048, 3, 0.2, 0.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.is_critical(tag):\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L420_C16", "label": "return", "type": "return", "loc": [420, 420], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L419_C12", "vector": [13, 4, 0.9976, 0.0024, 4, 0.12, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L421_C8", "label": "return", "type": "return", "loc": [421, 421], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L414_C4", "vector": [13, 2, 1.0, 0.0024, 2, 0.23, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return not self.tags"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L49_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L50_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L54_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L55_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L62_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L62_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L78_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L79_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L82_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L83_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L82_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L84_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L85_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L87_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L88_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L89_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L88_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L90_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L92_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:For_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:For_L94_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L95_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:For_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:For_L96_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L97_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L99_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L99_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L100_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L101_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L103_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:For_L104_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:For_L104_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L105_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L107_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L108_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L109_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L110_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L110_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L111_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L112_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L114_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L114_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L115_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L114_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:For_L116_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L114_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L118_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L120_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L121_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L122_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L123_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L123_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L124_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L125_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L125_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L126_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L127_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L129_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L130_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L131_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L132_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L134_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L134_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L135_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L134_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L136_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L134_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L140_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L141_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L143_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L144_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L145_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L146_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L148_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L148_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L149_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L148_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L153_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L155_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L155_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L156_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L155_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L157_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L155_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:For_L158_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:For_L158_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L159_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:For_L158_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L160_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L155_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:For_L161_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:For_L161_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L162_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L155_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L163_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L165_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L165_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L166_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L168_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L168_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L169_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L168_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L170_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L170_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L171_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L173_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L174_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L173_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L175_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L177_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L177_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L178_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L178_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L179_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L177_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L180_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L177_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L181_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L177_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L182_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L177_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L183_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L177_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:For_L184_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:For_L184_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L185_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L177_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:For_L186_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:For_L186_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L187_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L189_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L189_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L190_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L190_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:For_L191_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:For_L191_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L192_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L190_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:For_L193_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:For_L193_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L194_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L196_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L198_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L199_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L201_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L201_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L202_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L202_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L203_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L201_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L204_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L201_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L205_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L201_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L206_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L206_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L207_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L209_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L209_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L210_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L209_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L211_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L209_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L213_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L213_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L214_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L213_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L218_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L209_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L219_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L221_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L221_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Try_L222_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:Try_L222_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L223_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:Try_L222_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L225_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L227_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L227_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L228_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L228_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L229_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L228_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L231_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L227_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L232_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L234_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L234_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L235_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L234_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L236_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L234_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L238_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L238_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L239_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L238_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L240_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L240_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L241_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L240_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L243_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L246_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L246_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L247_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L247_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L248_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L246_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L249_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L246_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L250_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L246_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L251_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L251_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L252_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L254_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L254_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L255_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L254_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L257_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L254_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L259_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L261_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L261_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L262_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L261_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L263_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L261_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L264_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L261_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L265_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L265_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L267_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L261_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L269_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L273_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L273_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L274_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L273_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L275_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L275_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L276_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L275_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L277_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L277_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L278_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L277_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L279_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L279_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L280_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L279_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L281_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L281_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L282_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L281_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L283_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L283_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L284_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L283_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L285_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L285_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L286_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L285_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L287_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L285_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L289_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L273_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:For_L290_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:For_L290_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L291_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L293_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L293_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L294_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L293_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L295_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L293_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L298_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L293_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L299_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L293_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L300_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L293_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L301_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L293_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L302_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L293_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L303_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L303_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L304_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L293_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L305_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L305_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L306_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L308_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L309_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L310_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L310_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L311_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L312_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L312_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L313_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:For_L314_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:For_L314_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L315_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:For_L316_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:For_L316_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L317_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L308_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L318_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L321_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L321_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L322_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L321_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L323_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L326_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L328_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L328_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L329_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L328_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L330_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L328_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L331_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L331_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L332_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L326_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L334_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L334_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L335_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L334_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L336_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L326_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L338_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L338_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L339_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L326_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L341_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L341_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L342_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L341_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L346_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L341_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L347_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L341_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L348_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L326_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L350_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L350_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L351_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L350_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L357_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L326_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L359_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L359_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L360_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L360_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L361_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L359_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L362_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L359_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L363_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L359_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L364_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L326_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L367_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L367_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L368_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L367_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:For_L373_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:For_L373_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L374_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L374_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L375_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L367_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L376_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L326_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L378_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L378_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L379_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L379_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L380_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L378_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L381_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L381_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L382_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L378_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Try_L383_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:Try_L383_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L384_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:Try_L383_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L386_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L326_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L388_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L388_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L389_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L388_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L390_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L390_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L391_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L388_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:For_L392_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:For_L392_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L393_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L388_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L394_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L394_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L395_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L388_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L396_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L399_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L401_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L401_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Expr_L402_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L399_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L404_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L404_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L405_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L404_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Assign_L406_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L399_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L408_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L408_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L409_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L399_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L411_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L411_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L412_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:ClassDef_L399_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L414_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L414_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:For_L415_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:For_L415_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L416_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L416_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L417_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L414_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:For_L418_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:For_L418_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L419_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:If_L419_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L420_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99915:FunctionDef_L414_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99915:Return_L421_C8"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import re
from robot import utils
class Statistics:
def __init__(self, suite, suite_stat_level=-1, tag_stat_include=None,
tag_stat_exclude=None, tag_stat_combine=None, tag_doc=None,
tag_stat_link=None):
self.tags = TagStatistics(tag_stat_include, tag_stat_exclude,
tag_stat_combine, tag_doc, tag_stat_link)
self.suite = SuiteStatistics(suite, self.tags, suite_stat_level)
self.total = TotalStatistics(self.suite)
self.tags.sort()
def serialize(self, serializer):
serializer.start_statistics(self)
self.total.serialize(serializer)
self.tags.serialize(serializer)
self.suite.serialize(serializer)
serializer.end_statistics(self)
class Stat:
def __init__(self, name=''):
self.name = name
self.passed = 0
self.failed = 0
def add_stat(self, other):
self.passed += other.passed
self.failed += other.failed
def add_test(self, test):
if test.status == 'PASS':
self.passed += 1
else:
self.failed += 1
def fail_all(self):
self.failed += self.passed
self.passed = 0
def __cmp__(self, other):
return cmp(self.name, other.name)
def __nonzero__(self):
return self.failed == 0
class SuiteStat(Stat):
type = 'suite'
def __init__(self, suite):
Stat.__init__(self, suite.name)
self.long_name = suite.get_long_name()
def serialize(self, serializer):
serializer.suite_stat(self)
class TagStat(Stat):
type = 'tag'
def __init__(self, name, doc='', links=[], critical=False,
non_critical=False, combined=''):
Stat.__init__(self, name)
self.doc = doc
self.links = links
self.critical = critical
self.non_critical = non_critical
self.combined = combined
self.tests = []
def add_test(self, test):
Stat.add_test(self, test)
self.tests.append(test)
def __cmp__(self, other):
if self.critical != other.critical:
return cmp(other.critical, self.critical)
if self.non_critical != other.non_critical:
return cmp(other.non_critical, self.non_critical)
if bool(self.combined) != bool(other.combined):
return cmp(bool(other.combined), bool(self.combined))
return cmp(self.name, other.name)
def serialize(self, serializer):
serializer.tag_stat(self)
class TotalStat(Stat):
type = 'total'
def __init__(self, name, suite_stat):
Stat.__init__(self, name)
self.passed = suite_stat.passed
self.failed = suite_stat.failed
def serialize(self, serializer):
serializer.total_stat(self)
class SuiteStatistics:
def __init__(self, suite, tag_stats, suite_stat_level=-1):
self.all = SuiteStat(suite)
self.critical = SuiteStat(suite)
self.suites = []
self._process_suites(suite, tag_stats)
self._process_tests(suite, tag_stats)
self._suite_stat_level = suite_stat_level
def _process_suites(self, suite, tag_stats):
for subsuite in suite.suites:
substat = SuiteStatistics(subsuite, tag_stats)
self.suites.append(substat)
self.all.add_stat(substat.all)
self.critical.add_stat(substat.critical)
def _process_tests(self, suite, tag_stats):
for test in suite.tests:
self.all.add_test(test)
if test.critical == 'yes':
self.critical.add_test(test)
tag_stats.add_test(test, suite.critical)
def serialize(self, serializer):
serializer.start_suite_stats(self)
self._serialize(serializer, self._suite_stat_level)
serializer.end_suite_stats(self)
def _serialize(self, serializer, max_suite_level, suite_level=1):
self.all.serialize(serializer)
if max_suite_level < 0 or max_suite_level > suite_level:
for suite in self.suites:
suite._serialize(serializer, max_suite_level, suite_level+1)
class TagStatistics:
def __init__(self, include=None, exclude=None, combine=None, docs=None,
links=None):
self.stats = utils.NormalizedDict()
self._include = include or []
self._exclude = exclude or []
self._combine = combine or []
info = TagStatInfo(docs or [], links or [])
self._get_doc = info.get_doc
self._get_links = info.get_links
def add_test(self, test, critical):
self._add_tags_statistics(test, critical)
self._add_combined_statistics(test)
def _add_tags_statistics(self, test, critical):
for tag in test.tags:
if not self._is_included(tag):
continue
if tag not in self.stats:
self.stats[tag] = TagStat(tag, self._get_doc(tag),
self._get_links(tag),
critical.is_critical(tag),
critical.is_non_critical(tag))
self.stats[tag].add_test(test)
def _is_included(self, tag):
if self._include and not utils.matches_any(tag, self._include):
return False
return not utils.matches_any(tag, self._exclude)
def _add_combined_statistics(self, test):
for pattern, name in self._combine:
name = name or pattern
if name not in self.stats:
self.stats[name] = TagStat(name, self._get_doc(name),
self._get_links(name),
combined=pattern)
if test.is_included([pattern], []):
self.stats[name].add_test(test)
def serialize(self, serializer):
serializer.start_tag_stats(self)
for stat in sorted(self.stats.values()):
stat.serialize(serializer)
serializer.end_tag_stats(self)
def sort(self):
for stat in self.stats.values():
stat.tests.sort()
class TotalStatistics:
def __init__(self, suite):
self.critical = TotalStat('Critical Tests', suite.critical)
self.all = TotalStat('All Tests', suite.all)
def serialize(self, serializer):
serializer.start_total_stats(self)
self.critical.serialize(serializer)
self.all.serialize(serializer)
serializer.end_total_stats(self)
class TagStatInfo:
def __init__(self, docs, links):
self._docs = [TagStatDoc(*doc) for doc in docs]
self._links = [TagStatLink(*link) for link in links]
def get_doc(self, tag):
return ' & '.join(doc.text for doc in self._docs if doc.matches(tag))
def get_links(self, tag):
return [link.get_link(tag) for link in self._links if link.matches(tag)]
class TagStatDoc:
def __init__(self, pattern, doc):
self.text = doc
self._pattern = pattern
def matches(self, tag):
return utils.matches(tag, self._pattern)
class TagStatLink:
_match_pattern_tokenizer = re.compile('(\*|\?)')
def __init__(self, pattern, link, title):
self._regexp = self._get_match_regexp(pattern)
self._link = link
self._title = title.replace('_', ' ')
def matches(self, tag):
return self._regexp.match(tag) is not None
def get_link(self, tag):
match = self._regexp.match(tag)
if not match:
return None
link, title = self._replace_groups(self._link, self._title, match)
return link, title
def _replace_groups(self, link, title, match):
for index, group in enumerate(match.groups()):
placefolder = '%' + str(index+1)
link = link.replace(placefolder, group)
title = title.replace(placefolder, group)
return link, title
def _get_match_regexp(self, pattern):
regexp = []
open_parenthesis = False
for token in self._match_pattern_tokenizer.split(pattern):
if token == '':
continue
if token == '?':
if not open_parenthesis:
regexp.append('(')
open_parenthesis = True
regexp.append('.')
continue
if open_parenthesis:
regexp.append(')')
open_parenthesis = False
if token == '*':
regexp.append('(.*)')
continue
regexp.append(re.escape(token))
if open_parenthesis:
regexp.append(')')
return re.compile('^%s$' % ''.join(regexp), re.IGNORECASE)
| ajibawa-2023/Python-Code-Large/train/row_99916 | 194 | 291 | 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_99916:Import_L15_C0", "label": "re import re", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.0515, 0.0034, 0, 0.66, 0.0, 540, 0, 1, 0, 0, 540, 0, 0], "semantic": {"name": "re", "arg_names": [], "import_names": ["re"], "rhs_call_name": "", "annotation": ""}, "snippet": "import re"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:ImportFrom_L17_C0", "label": "from robot import utils", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.0584, 0.0034, 0, 0.66, 0.0833, 735, 0, 1, 0, 0, 735, 0, 0], "semantic": {"name": "robot", "arg_names": [], "import_names": ["utils"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot import utils"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L20_C0", "label": "Statistics", "type": "class", "loc": [20, 36], "level": 0, "parent": null, "vector": [3, 0, 0.0962, 0.0584, 0, 0.66, 0.1667, 138, 0, 2, 0, 0, 0, 0, 9], "semantic": {"name": "Statistics", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Statistics:\n\n def __init__(self, suite, suite_stat_level=-1, tag_stat_include=None,\n tag_stat_exclude=None, tag_stat_combine=None, tag_doc=None,\n tag_stat_link=None):\n self.tags = TagStatistics(tag_stat_include, tag_stat_exclude,\n tag_stat_combine, tag_doc, tag_stat_link)\n self.suite = SuiteStatistics(suite, self.tags, suite_stat_level)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L22_C4", "label": "__init__", "type": "function", "loc": [22, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L20_C0", "vector": [2, 1, 0.0876, 0.0275, 1, 0.08, 0.0, 555, 0, 8, 0, 0, 0, 0, 4], "semantic": {"name": "__init__", "arg_names": ["self", "suite", "suite_stat_level", "tag_stat_include", "tag_stat_exclude", "tag_stat_combine", "tag_doc", "tag_stat_link"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, suite, suite_stat_level=-1, tag_stat_include=None,\n tag_stat_exclude=None, tag_stat_combine=None, tag_doc=None,\n tag_stat_link=None):\n self.tags = TagStatistics(tag_stat_include, tag_stat_exclude,\n tag_stat_combine, tag_doc, tag_stat_link)\n self.suite = SuiteStatistics(suite, self.tags, suite_stat_level)\n self.total = TotalStatistics(self.suite)\n self.tags.sort()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L25_C8", "label": "self.tags = TagStatistics()", "type": "assigned_variable", "loc": [25, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L22_C4", "vector": [14, 2, 0.0876, 0.0069, 2, 0.58, 0.0, 664, 3, 5, 0, 0, 828, 10, 1], "semantic": {"name": "self.tags", "arg_names": [], "import_names": [], "rhs_call_name": "TagStatistics", "annotation": ""}, "snippet": " self.tags = TagStatistics(tag_stat_include, tag_stat_exclude,\n tag_stat_combine, tag_doc, tag_stat_link)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L27_C8", "label": "self.suite = SuiteStatistics()", "type": "assigned_variable", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L22_C4", "vector": [14, 2, 0.0928, 0.0034, 2, 0.58, 0.3333, 360, 3, 3, 0, 0, 210, 10, 1], "semantic": {"name": "self.suite", "arg_names": [], "import_names": [], "rhs_call_name": "SuiteStatistics", "annotation": ""}, "snippet": " self.suite = SuiteStatistics(suite, self.tags, suite_stat_level)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L28_C8", "label": "self.total = TotalStatistics()", "type": "assigned_variable", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L22_C4", "vector": [14, 2, 0.0962, 0.0034, 2, 0.58, 0.6667, 927, 3, 1, 0, 0, 557, 10, 1], "semantic": {"name": "self.total", "arg_names": [], "import_names": [], "rhs_call_name": "TotalStatistics", "annotation": ""}, "snippet": " self.total = TotalStatistics(self.suite)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L29_C8", "label": "sort()", "type": "expression", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L22_C4", "vector": [8, 2, 0.0997, 0.0034, 2, 0.58, 1.0, 489, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sort", "arg_names": [], "import_names": [], "rhs_call_name": "sort", "annotation": ""}, "snippet": " self.tags.sort()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L31_C4", "label": "serialize", "type": "function", "loc": [31, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L20_C0", "vector": [2, 1, 0.1151, 0.0206, 1, 0.08, 1.0, 50, 0, 2, 0, 0, 0, 0, 5], "semantic": {"name": "serialize", "arg_names": ["self", "serializer"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def serialize(self, serializer):\n serializer.start_statistics(self)\n self.total.serialize(serializer)\n self.tags.serialize(serializer)\n self.suite.serialize(serializer)\n serializer.end_statistics(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L32_C8", "label": "start_statistics()", "type": "expression", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L31_C4", "vector": [8, 2, 0.11, 0.0034, 2, 0.01, 0.0, 478, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "start_statistics", "arg_names": [], "import_names": [], "rhs_call_name": "start_statistics", "annotation": ""}, "snippet": " serializer.start_statistics(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L33_C8", "label": "serialize()", "type": "expression", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L31_C4", "vector": [8, 2, 0.1134, 0.0034, 2, 0.01, 0.25, 50, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "serialize", "arg_names": [], "import_names": [], "rhs_call_name": "serialize", "annotation": ""}, "snippet": " self.total.serialize(serializer)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L34_C8", "label": "serialize()", "type": "expression", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L31_C4", "vector": [8, 2, 0.1168, 0.0034, 2, 0.01, 0.5, 50, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "serialize", "arg_names": [], "import_names": [], "rhs_call_name": "serialize", "annotation": ""}, "snippet": " self.tags.serialize(serializer)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L35_C8", "label": "serialize()", "type": "expression", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L31_C4", "vector": [8, 2, 0.1203, 0.0034, 2, 0.01, 0.75, 50, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "serialize", "arg_names": [], "import_names": [], "rhs_call_name": "serialize", "annotation": ""}, "snippet": " self.suite.serialize(serializer)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L36_C8", "label": "end_statistics()", "type": "expression", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L31_C4", "vector": [8, 2, 0.1237, 0.0034, 2, 0.01, 1.0, 989, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "end_statistics", "arg_names": [], "import_names": [], "rhs_call_name": "end_statistics", "annotation": ""}, "snippet": " serializer.end_statistics(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L39_C0", "label": "Stat", "type": "class", "loc": [39, 64], "level": 0, "parent": null, "vector": [3, 0, 0.177, 0.0893, 0, 0.66, 0.25, 415, 0, 6, 0, 0, 0, 0, 1], "semantic": {"name": "Stat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Stat:\n\n def __init__(self, name=''):\n self.name = name\n self.passed = 0\n self.failed = 0\n\n def add_stat(self, other):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L41_C4", "label": "__init__", "type": "function", "loc": [41, 44], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L39_C0", "vector": [2, 1, 0.146, 0.0137, 1, 0.03, 0.0, 555, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, name=''):\n self.name = name\n self.passed = 0\n self.failed = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L42_C8", "label": "self.name =", "type": "assigned_variable", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L41_C4", "vector": [14, 2, 0.1443, 0.0034, 2, 0.99, 0.0, 689, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.name = name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L43_C8", "label": "self.passed =", "type": "assigned_variable", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L41_C4", "vector": [14, 2, 0.1478, 0.0034, 2, 0.99, 0.5, 247, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.passed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.passed = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L44_C8", "label": "self.failed =", "type": "assigned_variable", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L41_C4", "vector": [14, 2, 0.1512, 0.0034, 2, 0.99, 1.0, 297, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.failed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.failed = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L46_C4", "label": "add_stat", "type": "function", "loc": [46, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L39_C0", "vector": [2, 1, 0.1615, 0.0103, 1, 0.03, 0.2, 363, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "add_stat", "arg_names": ["self", "other"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add_stat(self, other):\n self.passed += other.passed\n self.failed += other.failed"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L50_C4", "label": "add_test", "type": "function", "loc": [50, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L39_C0", "vector": [2, 1, 0.1787, 0.0172, 1, 0.03, 0.4, 653, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "add_test", "arg_names": ["self", "test"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add_test(self, test):\n if test.status == 'PASS':\n self.passed += 1\n else:\n self.failed += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L51_C8", "label": "if", "type": "if", "loc": [51, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L50_C4", "vector": [4, 2, 0.1804, 0.0137, 2, 0.44, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if test.status == 'PASS':\n self.passed += 1\n else:\n self.failed += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L56_C4", "label": "fail_all", "type": "function", "loc": [56, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L39_C0", "vector": [2, 1, 0.1959, 0.0103, 1, 0.03, 0.6, 181, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "fail_all", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def fail_all(self):\n self.failed += self.passed\n self.passed = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L58_C8", "label": "self.passed =", "type": "assigned_variable", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L56_C4", "vector": [14, 2, 0.1993, 0.0034, 2, 0.55, 0.0, 247, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.passed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.passed = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L60_C4", "label": "__cmp__", "type": "function", "loc": [60, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L39_C0", "vector": [2, 1, 0.2079, 0.0069, 1, 0.03, 0.8, 271, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "__cmp__", "arg_names": ["self", "other"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __cmp__(self, other):\n return cmp(self.name, other.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Return_L61_C8", "label": "return", "type": "return", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L60_C4", "vector": [13, 2, 0.2096, 0.0034, 2, 0.95, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return cmp(self.name, other.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L63_C4", "label": "__nonzero__", "type": "function", "loc": [63, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L39_C0", "vector": [2, 1, 0.2182, 0.0069, 1, 0.03, 1.0, 322, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "__nonzero__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __nonzero__(self):\n return self.failed == 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Return_L64_C8", "label": "return", "type": "return", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L63_C4", "vector": [13, 2, 0.2199, 0.0034, 2, 0.08, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.failed == 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L67_C0", "label": "SuiteStat", "type": "class", "loc": [67, 75], "level": 0, "parent": null, "vector": [3, 0, 0.244, 0.0309, 0, 0.66, 0.3333, 945, 0, 2, 0, 0, 415, 0, 3], "semantic": {"name": "SuiteStat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class SuiteStat(Stat):\n type = 'suite'\n\n def __init__(self, suite):\n Stat.__init__(self, suite.name)\n self.long_name = suite.get_long_name()\n\n def serialize(self, serializer):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L68_C4", "label": "type =", "type": "assigned_variable", "loc": [68, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L67_C0", "vector": [14, 1, 0.2337, 0.0034, 1, 0.88, 0.0, 801, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " type = 'suite'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L70_C4", "label": "__init__", "type": "function", "loc": [70, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L67_C0", "vector": [2, 1, 0.244, 0.0103, 1, 0.88, 0.5, 555, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "suite"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, suite):\n Stat.__init__(self, suite.name)\n self.long_name = suite.get_long_name()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L71_C8", "label": "__init__()", "type": "expression", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L70_C4", "vector": [8, 2, 0.244, 0.0034, 2, 0.5, 0.0, 555, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " Stat.__init__(self, suite.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L72_C8", "label": "self.long_name = get_long_name()", "type": "assigned_variable", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L70_C4", "vector": [14, 2, 0.2474, 0.0034, 2, 0.5, 1.0, 113, 3, 0, 0, 0, 299, 10, 1], "semantic": {"name": "self.long_name", "arg_names": [], "import_names": [], "rhs_call_name": "get_long_name", "annotation": ""}, "snippet": " self.long_name = suite.get_long_name()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L74_C4", "label": "serialize", "type": "function", "loc": [74, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L67_C0", "vector": [2, 1, 0.256, 0.0069, 1, 0.88, 1.0, 50, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "serialize", "arg_names": ["self", "serializer"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def serialize(self, serializer):\n serializer.suite_stat(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L75_C8", "label": "suite_stat()", "type": "expression", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L74_C4", "vector": [8, 2, 0.2577, 0.0034, 2, 0.77, 0.0, 331, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "suite_stat", "arg_names": [], "import_names": [], "rhs_call_name": "suite_stat", "annotation": ""}, "snippet": " serializer.suite_stat(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L78_C0", "label": "TagStat", "type": "class", "loc": [78, 105], "level": 0, "parent": null, "vector": [3, 0, 0.3144, 0.0962, 0, 0.66, 0.4167, 137, 0, 4, 0, 0, 415, 0, 12], "semantic": {"name": "TagStat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class TagStat(Stat):\n type = 'tag'\n\n def __init__(self, name, doc='', links=[], critical=False,\n non_critical=False, combined=''):\n Stat.__init__(self, name)\n self.doc = doc\n self.links = links"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L79_C4", "label": "type =", "type": "assigned_variable", "loc": [79, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L78_C0", "vector": [14, 1, 0.2715, 0.0034, 1, 0.91, 0.0, 801, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " type = 'tag'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L81_C4", "label": "__init__", "type": "function", "loc": [81, 89], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L78_C0", "vector": [2, 1, 0.2921, 0.0309, 1, 0.91, 0.25, 555, 0, 7, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "name", "doc", "links", "critical", "non_critical", "combined"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, name, doc='', links=[], critical=False,\n non_critical=False, combined=''):\n Stat.__init__(self, name)\n self.doc = doc\n self.links = links\n self.critical = critical\n self.non_critical = non_critical\n self.combined = combined"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L83_C8", "label": "__init__()", "type": "expression", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L81_C4", "vector": [8, 2, 0.2852, 0.0034, 2, 0.59, 0.0, 555, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " Stat.__init__(self, name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L84_C8", "label": "self.doc =", "type": "assigned_variable", "loc": [84, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L81_C4", "vector": [14, 2, 0.2887, 0.0034, 2, 0.59, 0.1667, 114, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.doc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.doc = doc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L85_C8", "label": "self.links =", "type": "assigned_variable", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L81_C4", "vector": [14, 2, 0.2921, 0.0034, 2, 0.59, 0.3333, 458, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.links", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.links = links"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L86_C8", "label": "self.critical =", "type": "assigned_variable", "loc": [86, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L81_C4", "vector": [14, 2, 0.2955, 0.0034, 2, 0.59, 0.5, 227, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.critical", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.critical = critical"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L87_C8", "label": "self.non_critical =", "type": "assigned_variable", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L81_C4", "vector": [14, 2, 0.299, 0.0034, 2, 0.59, 0.6667, 298, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.non_critical", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.non_critical = non_critical"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L88_C8", "label": "self.combined =", "type": "assigned_variable", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L81_C4", "vector": [14, 2, 0.3024, 0.0034, 2, 0.59, 0.8333, 762, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.combined", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.combined = combined"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L89_C8", "label": "self.tests =", "type": "assigned_variable", "loc": [89, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L81_C4", "vector": [14, 2, 0.3058, 0.0034, 2, 0.59, 1.0, 606, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.tests", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.tests = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L91_C4", "label": "add_test", "type": "function", "loc": [91, 93], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L78_C0", "vector": [2, 1, 0.3162, 0.0103, 1, 0.91, 0.5, 653, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "add_test", "arg_names": ["self", "test"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add_test(self, test):\n Stat.add_test(self, test)\n self.tests.append(test)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L92_C8", "label": "add_test()", "type": "expression", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L91_C4", "vector": [8, 2, 0.3162, 0.0034, 2, 0.58, 0.0, 653, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "add_test", "arg_names": [], "import_names": [], "rhs_call_name": "add_test", "annotation": ""}, "snippet": " Stat.add_test(self, test)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L93_C8", "label": "append()", "type": "expression", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L91_C4", "vector": [8, 2, 0.3196, 0.0034, 2, 0.58, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.tests.append(test)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L95_C4", "label": "__cmp__", "type": "function", "loc": [95, 102], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L78_C0", "vector": [2, 1, 0.3385, 0.0275, 1, 0.91, 0.75, 271, 0, 2, 1, 0, 0, 0, 8], "semantic": {"name": "__cmp__", "arg_names": ["self", "other"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __cmp__(self, other):\n if self.critical != other.critical:\n return cmp(other.critical, self.critical)\n if self.non_critical != other.non_critical:\n return cmp(other.non_critical, self.non_critical)\n if bool(self.combined) != bool(other.combined):\n return cmp(bool(other.combined), bool(self.combined))\n return cmp(self.name, other.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L96_C8", "label": "if", "type": "if", "loc": [96, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L95_C4", "vector": [4, 2, 0.3316, 0.0069, 2, 0.56, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.critical != other.critical:\n return cmp(other.critical, self.critical)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Return_L97_C12", "label": "return", "type": "return", "loc": [97, 97], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L96_C8", "vector": [13, 3, 0.3333, 0.0034, 3, 0.26, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return cmp(other.critical, self.critical)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L98_C8", "label": "if", "type": "if", "loc": [98, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L95_C4", "vector": [4, 2, 0.3385, 0.0069, 2, 0.56, 0.3333, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.non_critical != other.non_critical:\n return cmp(other.non_critical, self.non_critical)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Return_L99_C12", "label": "return", "type": "return", "loc": [99, 99], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L98_C8", "vector": [13, 3, 0.3402, 0.0034, 3, 0.49, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return cmp(other.non_critical, self.non_critical)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L100_C8", "label": "if", "type": "if", "loc": [100, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L95_C4", "vector": [4, 2, 0.3454, 0.0069, 2, 0.56, 0.6667, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if bool(self.combined) != bool(other.combined):\n return cmp(bool(other.combined), bool(self.combined))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Return_L101_C12", "label": "return", "type": "return", "loc": [101, 101], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L100_C8", "vector": [13, 3, 0.3471, 0.0034, 3, 0.11, 0.0, 0, 3, 0, 0, 0, 0, 10, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return cmp(bool(other.combined), bool(self.combined))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Return_L102_C8", "label": "return", "type": "return", "loc": [102, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L95_C4", "vector": [13, 2, 0.3505, 0.0034, 2, 0.56, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return cmp(self.name, other.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L104_C4", "label": "serialize", "type": "function", "loc": [104, 105], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L78_C0", "vector": [2, 1, 0.3591, 0.0069, 1, 0.91, 1.0, 50, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "serialize", "arg_names": ["self", "serializer"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def serialize(self, serializer):\n serializer.tag_stat(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L105_C8", "label": "tag_stat()", "type": "expression", "loc": [105, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L104_C4", "vector": [8, 2, 0.3608, 0.0034, 2, 0.8, 0.0, 959, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "tag_stat", "arg_names": [], "import_names": [], "rhs_call_name": "tag_stat", "annotation": ""}, "snippet": " serializer.tag_stat(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L108_C0", "label": "TotalStat", "type": "class", "loc": [108, 117], "level": 0, "parent": null, "vector": [3, 0, 0.3866, 0.0344, 0, 0.66, 0.5, 903, 0, 2, 0, 0, 415, 0, 2], "semantic": {"name": "TotalStat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class TotalStat(Stat):\n type = 'total'\n\n def __init__(self, name, suite_stat):\n Stat.__init__(self, name)\n self.passed = suite_stat.passed\n self.failed = suite_stat.failed\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L109_C4", "label": "type =", "type": "assigned_variable", "loc": [109, 109], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L108_C0", "vector": [14, 1, 0.3746, 0.0034, 1, 0.6, 0.0, 801, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " type = 'total'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L111_C4", "label": "__init__", "type": "function", "loc": [111, 114], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L108_C0", "vector": [2, 1, 0.3866, 0.0137, 1, 0.6, 0.5, 555, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "name", "suite_stat"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, name, suite_stat):\n Stat.__init__(self, name)\n self.passed = suite_stat.passed\n self.failed = suite_stat.failed"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L112_C8", "label": "__init__()", "type": "expression", "loc": [112, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L111_C4", "vector": [8, 2, 0.3849, 0.0034, 2, 0.01, 0.0, 555, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " Stat.__init__(self, name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L113_C8", "label": "self.passed =", "type": "assigned_variable", "loc": [113, 113], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L111_C4", "vector": [14, 2, 0.3883, 0.0034, 2, 0.01, 0.5, 247, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.passed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.passed = suite_stat.passed"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L114_C8", "label": "self.failed =", "type": "assigned_variable", "loc": [114, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L111_C4", "vector": [14, 2, 0.3918, 0.0034, 2, 0.01, 1.0, 297, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.failed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.failed = suite_stat.failed"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L116_C4", "label": "serialize", "type": "function", "loc": [116, 117], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L108_C0", "vector": [2, 1, 0.4003, 0.0069, 1, 0.6, 1.0, 50, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "serialize", "arg_names": ["self", "serializer"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def serialize(self, serializer):\n serializer.total_stat(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L117_C8", "label": "total_stat()", "type": "expression", "loc": [117, 117], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L116_C4", "vector": [8, 2, 0.4021, 0.0034, 2, 0.46, 0.0, 85, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "total_stat", "arg_names": [], "import_names": [], "rhs_call_name": "total_stat", "annotation": ""}, "snippet": " serializer.total_stat(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L120_C0", "label": "SuiteStatistics", "type": "class", "loc": [120, 153], "level": 0, "parent": null, "vector": [3, 0, 0.4691, 0.1168, 0, 0.66, 0.5833, 210, 0, 5, 0, 0, 0, 0, 16], "semantic": {"name": "SuiteStatistics", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class SuiteStatistics:\n\n def __init__(self, suite, tag_stats, suite_stat_level=-1):\n self.all = SuiteStat(suite)\n self.critical = SuiteStat(suite)\n self.suites = []\n self._process_suites(suite, tag_stats)\n self._process_tests(suite, tag_stats)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L122_C4", "label": "__init__", "type": "function", "loc": [122, 128], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L120_C0", "vector": [2, 1, 0.4296, 0.0241, 1, 0.84, 0.0, 555, 0, 4, 0, 0, 0, 0, 4], "semantic": {"name": "__init__", "arg_names": ["self", "suite", "tag_stats", "suite_stat_level"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, suite, tag_stats, suite_stat_level=-1):\n self.all = SuiteStat(suite)\n self.critical = SuiteStat(suite)\n self.suites = []\n self._process_suites(suite, tag_stats)\n self._process_tests(suite, tag_stats)\n self._suite_stat_level = suite_stat_level"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L123_C8", "label": "self.all = SuiteStat()", "type": "assigned_variable", "loc": [123, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L122_C4", "vector": [14, 2, 0.4227, 0.0034, 2, 0.14, 0.0, 857, 3, 1, 0, 0, 945, 10, 1], "semantic": {"name": "self.all", "arg_names": [], "import_names": [], "rhs_call_name": "SuiteStat", "annotation": ""}, "snippet": " self.all = SuiteStat(suite)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L124_C8", "label": "self.critical = SuiteStat()", "type": "assigned_variable", "loc": [124, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L122_C4", "vector": [14, 2, 0.4261, 0.0034, 2, 0.14, 0.2, 227, 3, 1, 0, 0, 945, 10, 1], "semantic": {"name": "self.critical", "arg_names": [], "import_names": [], "rhs_call_name": "SuiteStat", "annotation": ""}, "snippet": " self.critical = SuiteStat(suite)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L125_C8", "label": "self.suites =", "type": "assigned_variable", "loc": [125, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L122_C4", "vector": [14, 2, 0.4296, 0.0034, 2, 0.14, 0.4, 941, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.suites", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.suites = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L126_C8", "label": "_process_suites()", "type": "expression", "loc": [126, 126], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L122_C4", "vector": [8, 2, 0.433, 0.0034, 2, 0.14, 0.6, 645, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_process_suites", "arg_names": [], "import_names": [], "rhs_call_name": "_process_suites", "annotation": ""}, "snippet": " self._process_suites(suite, tag_stats)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L127_C8", "label": "_process_tests()", "type": "expression", "loc": [127, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L122_C4", "vector": [8, 2, 0.4364, 0.0034, 2, 0.14, 0.8, 835, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_process_tests", "arg_names": [], "import_names": [], "rhs_call_name": "_process_tests", "annotation": ""}, "snippet": " self._process_tests(suite, tag_stats)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L128_C8", "label": "self._suite_stat_level =", "type": "assigned_variable", "loc": [128, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L122_C4", "vector": [14, 2, 0.4399, 0.0034, 2, 0.14, 1.0, 789, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._suite_stat_level", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._suite_stat_level = suite_stat_level"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L130_C4", "label": "_process_suites", "type": "function", "loc": [130, 135], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L120_C0", "vector": [2, 1, 0.4553, 0.0206, 1, 0.84, 0.25, 645, 0, 3, 0, 0, 0, 0, 4], "semantic": {"name": "_process_suites", "arg_names": ["self", "suite", "tag_stats"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _process_suites(self, suite, tag_stats):\n for subsuite in suite.suites:\n substat = SuiteStatistics(subsuite, tag_stats)\n self.suites.append(substat)\n self.all.add_stat(substat.all)\n self.critical.add_stat(substat.critical)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:For_L131_C8", "label": "for subsuite", "type": "for", "loc": [131, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L130_C4", "vector": [6, 2, 0.457, 0.0172, 2, 0.69, 0.0, 700, 7, 0, 0, 0, 0, 0, 4], "semantic": {"name": "subsuite", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for subsuite in suite.suites:\n substat = SuiteStatistics(subsuite, tag_stats)\n self.suites.append(substat)\n self.all.add_stat(substat.all)\n self.critical.add_stat(substat.critical)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L132_C12", "label": "substat = SuiteStatistics()", "type": "assigned_variable", "loc": [132, 132], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:For_L131_C8", "vector": [14, 3, 0.4536, 0.0034, 3, 0.81, 0.0, 945, 3, 2, 0, 0, 210, 10, 1], "semantic": {"name": "substat", "arg_names": [], "import_names": [], "rhs_call_name": "SuiteStatistics", "annotation": ""}, "snippet": " substat = SuiteStatistics(subsuite, tag_stats)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L133_C12", "label": "append()", "type": "expression", "loc": [133, 133], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:For_L131_C8", "vector": [8, 3, 0.457, 0.0034, 3, 0.81, 0.3333, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.suites.append(substat)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L134_C12", "label": "add_stat()", "type": "expression", "loc": [134, 134], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:For_L131_C8", "vector": [8, 3, 0.4605, 0.0034, 3, 0.81, 0.6667, 363, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add_stat", "arg_names": [], "import_names": [], "rhs_call_name": "add_stat", "annotation": ""}, "snippet": " self.all.add_stat(substat.all)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L135_C12", "label": "add_stat()", "type": "expression", "loc": [135, 135], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:For_L131_C8", "vector": [8, 3, 0.4639, 0.0034, 3, 0.81, 1.0, 363, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add_stat", "arg_names": [], "import_names": [], "rhs_call_name": "add_stat", "annotation": ""}, "snippet": " self.critical.add_stat(substat.critical)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L137_C4", "label": "_process_tests", "type": "function", "loc": [137, 142], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L120_C0", "vector": [2, 1, 0.4794, 0.0206, 1, 0.84, 0.5, 835, 0, 3, 0, 0, 0, 0, 3], "semantic": {"name": "_process_tests", "arg_names": ["self", "suite", "tag_stats"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _process_tests(self, suite, tag_stats):\n for test in suite.tests:\n self.all.add_test(test)\n if test.critical == 'yes':\n self.critical.add_test(test)\n tag_stats.add_test(test, suite.critical)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:For_L138_C8", "label": "for test", "type": "for", "loc": [138, 142], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L137_C4", "vector": [6, 2, 0.4811, 0.0172, 2, 0.68, 0.0, 224, 7, 0, 0, 0, 0, 0, 3], "semantic": {"name": "test", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for test in suite.tests:\n self.all.add_test(test)\n if test.critical == 'yes':\n self.critical.add_test(test)\n tag_stats.add_test(test, suite.critical)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L139_C12", "label": "add_test()", "type": "expression", "loc": [139, 139], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:For_L138_C8", "vector": [8, 3, 0.4777, 0.0034, 3, 0.63, 0.0, 653, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add_test", "arg_names": [], "import_names": [], "rhs_call_name": "add_test", "annotation": ""}, "snippet": " self.all.add_test(test)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L140_C12", "label": "if", "type": "if", "loc": [140, 141], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:For_L138_C8", "vector": [4, 3, 0.4828, 0.0069, 3, 0.63, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if test.critical == 'yes':\n self.critical.add_test(test)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L141_C16", "label": "add_test()", "type": "expression", "loc": [141, 141], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L140_C12", "vector": [8, 4, 0.4845, 0.0034, 4, 0.16, 0.0, 653, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add_test", "arg_names": [], "import_names": [], "rhs_call_name": "add_test", "annotation": ""}, "snippet": " self.critical.add_test(test)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L142_C12", "label": "add_test()", "type": "expression", "loc": [142, 142], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:For_L138_C8", "vector": [8, 3, 0.488, 0.0034, 3, 0.63, 1.0, 653, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "add_test", "arg_names": [], "import_names": [], "rhs_call_name": "add_test", "annotation": ""}, "snippet": " tag_stats.add_test(test, suite.critical)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L144_C4", "label": "serialize", "type": "function", "loc": [144, 147], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L120_C0", "vector": [2, 1, 0.5, 0.0137, 1, 0.84, 0.75, 50, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "serialize", "arg_names": ["self", "serializer"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def serialize(self, serializer):\n serializer.start_suite_stats(self)\n self._serialize(serializer, self._suite_stat_level)\n serializer.end_suite_stats(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L145_C8", "label": "start_suite_stats()", "type": "expression", "loc": [145, 145], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L144_C4", "vector": [8, 2, 0.4983, 0.0034, 2, 0.58, 0.0, 41, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "start_suite_stats", "arg_names": [], "import_names": [], "rhs_call_name": "start_suite_stats", "annotation": ""}, "snippet": " serializer.start_suite_stats(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L146_C8", "label": "_serialize()", "type": "expression", "loc": [146, 146], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L144_C4", "vector": [8, 2, 0.5017, 0.0034, 2, 0.58, 0.5, 898, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_serialize", "arg_names": [], "import_names": [], "rhs_call_name": "_serialize", "annotation": ""}, "snippet": " self._serialize(serializer, self._suite_stat_level)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L147_C8", "label": "end_suite_stats()", "type": "expression", "loc": [147, 147], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L144_C4", "vector": [8, 2, 0.5052, 0.0034, 2, 0.58, 1.0, 730, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "end_suite_stats", "arg_names": [], "import_names": [], "rhs_call_name": "end_suite_stats", "annotation": ""}, "snippet": " serializer.end_suite_stats(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L149_C4", "label": "_serialize", "type": "function", "loc": [149, 153], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L120_C0", "vector": [2, 1, 0.5189, 0.0172, 1, 0.84, 1.0, 898, 0, 4, 0, 0, 0, 0, 2], "semantic": {"name": "_serialize", "arg_names": ["self", "serializer", "max_suite_level", "suite_level"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _serialize(self, serializer, max_suite_level, suite_level=1):\n self.all.serialize(serializer)\n if max_suite_level < 0 or max_suite_level > suite_level:\n for suite in self.suites:\n suite._serialize(serializer, max_suite_level, suite_level+1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L150_C8", "label": "serialize()", "type": "expression", "loc": [150, 150], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L149_C4", "vector": [8, 2, 0.5155, 0.0034, 2, 0.47, 0.0, 50, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "serialize", "arg_names": [], "import_names": [], "rhs_call_name": "serialize", "annotation": ""}, "snippet": " self.all.serialize(serializer)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L151_C8", "label": "if", "type": "if", "loc": [151, 153], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L149_C4", "vector": [4, 2, 0.5223, 0.0103, 2, 0.47, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if max_suite_level < 0 or max_suite_level > suite_level:\n for suite in self.suites:\n suite._serialize(serializer, max_suite_level, suite_level+1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:For_L152_C12", "label": "for suite", "type": "for", "loc": [152, 153], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L151_C8", "vector": [6, 3, 0.5241, 0.0069, 3, 0.42, 0.0, 425, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "suite", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for suite in self.suites:\n suite._serialize(serializer, max_suite_level, suite_level+1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L153_C16", "label": "_serialize()", "type": "expression", "loc": [153, 153], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:For_L152_C12", "vector": [8, 4, 0.5258, 0.0034, 4, 0.47, 0.0, 898, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "_serialize", "arg_names": [], "import_names": [], "rhs_call_name": "_serialize", "annotation": ""}, "snippet": " suite._serialize(serializer, max_suite_level, suite_level+1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L156_C0", "label": "TagStatistics", "type": "class", "loc": [156, 206], "level": 0, "parent": null, "vector": [3, 0, 0.622, 0.1753, 0, 0.66, 0.6667, 828, 0, 7, 0, 0, 0, 0, 25], "semantic": {"name": "TagStatistics", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class TagStatistics:\n\n def __init__(self, include=None, exclude=None, combine=None, docs=None,\n links=None):\n self.stats = utils.NormalizedDict()\n self._include = include or []\n self._exclude = exclude or []\n self._combine = combine or []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L158_C4", "label": "__init__", "type": "function", "loc": [158, 166], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L156_C0", "vector": [2, 1, 0.5567, 0.0309, 1, 0.26, 0.0, 555, 0, 6, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "include", "exclude", "combine", "docs", "links"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, include=None, exclude=None, combine=None, docs=None,\n links=None):\n self.stats = utils.NormalizedDict()\n self._include = include or []\n self._exclude = exclude or []\n self._combine = combine or []\n info = TagStatInfo(docs or [], links or [])\n self._get_doc = info.get_doc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L160_C8", "label": "self.stats = NormalizedDict()", "type": "assigned_variable", "loc": [160, 160], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L158_C4", "vector": [14, 2, 0.5498, 0.0034, 2, 0.6, 0.0, 665, 3, 0, 0, 0, 696, 10, 1], "semantic": {"name": "self.stats", "arg_names": [], "import_names": [], "rhs_call_name": "NormalizedDict", "annotation": ""}, "snippet": " self.stats = utils.NormalizedDict()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L161_C8", "label": "self._include =", "type": "assigned_variable", "loc": [161, 161], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L158_C4", "vector": [14, 2, 0.5533, 0.0034, 2, 0.6, 0.1667, 372, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._include", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._include = include or []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L162_C8", "label": "self._exclude =", "type": "assigned_variable", "loc": [162, 162], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L158_C4", "vector": [14, 2, 0.5567, 0.0034, 2, 0.6, 0.3333, 73, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._exclude", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._exclude = exclude or []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L163_C8", "label": "self._combine =", "type": "assigned_variable", "loc": [163, 163], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L158_C4", "vector": [14, 2, 0.5601, 0.0034, 2, 0.6, 0.5, 227, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._combine", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._combine = combine or []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L164_C8", "label": "info = TagStatInfo()", "type": "assigned_variable", "loc": [164, 164], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L158_C4", "vector": [14, 2, 0.5636, 0.0034, 2, 0.6, 0.6667, 730, 3, 2, 0, 0, 762, 10, 1], "semantic": {"name": "info", "arg_names": [], "import_names": [], "rhs_call_name": "TagStatInfo", "annotation": ""}, "snippet": " info = TagStatInfo(docs or [], links or [])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L165_C8", "label": "self._get_doc =", "type": "assigned_variable", "loc": [165, 165], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L158_C4", "vector": [14, 2, 0.567, 0.0034, 2, 0.6, 0.8333, 191, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._get_doc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._get_doc = info.get_doc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L166_C8", "label": "self._get_links =", "type": "assigned_variable", "loc": [166, 166], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L158_C4", "vector": [14, 2, 0.5704, 0.0034, 2, 0.6, 1.0, 391, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._get_links", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._get_links = info.get_links"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L168_C4", "label": "add_test", "type": "function", "loc": [168, 170], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L156_C0", "vector": [2, 1, 0.5808, 0.0103, 1, 0.26, 0.1667, 653, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "add_test", "arg_names": ["self", "test", "critical"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add_test(self, test, critical):\n self._add_tags_statistics(test, critical)\n self._add_combined_statistics(test)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L169_C8", "label": "_add_tags_statistics()", "type": "expression", "loc": [169, 169], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L168_C4", "vector": [8, 2, 0.5808, 0.0034, 2, 0.76, 0.0, 298, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_add_tags_statistics", "arg_names": [], "import_names": [], "rhs_call_name": "_add_tags_statistics", "annotation": ""}, "snippet": " self._add_tags_statistics(test, critical)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L170_C8", "label": "_add_combined_statistics()", "type": "expression", "loc": [170, 170], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L168_C4", "vector": [8, 2, 0.5842, 0.0034, 2, 0.76, 1.0, 954, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_add_combined_statistics", "arg_names": [], "import_names": [], "rhs_call_name": "_add_combined_statistics", "annotation": ""}, "snippet": " self._add_combined_statistics(test)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L172_C4", "label": "_add_tags_statistics", "type": "function", "loc": [172, 181], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L156_C0", "vector": [2, 1, 0.6065, 0.0344, 1, 0.26, 0.3333, 298, 0, 3, 0, 0, 0, 0, 7], "semantic": {"name": "_add_tags_statistics", "arg_names": ["self", "test", "critical"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _add_tags_statistics(self, test, critical):\n for tag in test.tags:\n if not self._is_included(tag):\n continue\n if tag not in self.stats:\n self.stats[tag] = TagStat(tag, self._get_doc(tag),\n self._get_links(tag),\n critical.is_critical(tag),"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:For_L173_C8", "label": "for tag", "type": "for", "loc": [173, 181], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L172_C4", "vector": [6, 2, 0.6082, 0.0309, 2, 0.64, 0.0, 732, 7, 0, 0, 0, 0, 0, 7], "semantic": {"name": "tag", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for tag in test.tags:\n if not self._is_included(tag):\n continue\n if tag not in self.stats:\n self.stats[tag] = TagStat(tag, self._get_doc(tag),\n self._get_links(tag),\n critical.is_critical(tag),\n critical.is_non_critical(tag))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L174_C12", "label": "if", "type": "if", "loc": [174, 175], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:For_L173_C8", "vector": [4, 3, 0.5997, 0.0069, 3, 0.16, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self._is_included(tag):\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L176_C12", "label": "if", "type": "if", "loc": [176, 180], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:For_L173_C8", "vector": [4, 3, 0.6117, 0.0172, 3, 0.16, 0.5, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if tag not in self.stats:\n self.stats[tag] = TagStat(tag, self._get_doc(tag),\n self._get_links(tag),\n critical.is_critical(tag),\n critical.is_non_critical(tag))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L177_C16", "label": " = TagStat()", "type": "assigned_variable", "loc": [177, 180], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L176_C12", "vector": [14, 4, 0.6134, 0.0137, 4, 0.33, 0.0, 0, 3, 5, 0, 0, 137, 10, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "TagStat", "annotation": ""}, "snippet": " self.stats[tag] = TagStat(tag, self._get_doc(tag),\n self._get_links(tag),\n critical.is_critical(tag),\n critical.is_non_critical(tag))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L181_C12", "label": "add_test()", "type": "expression", "loc": [181, 181], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:For_L173_C8", "vector": [8, 3, 0.622, 0.0034, 3, 0.16, 1.0, 653, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add_test", "arg_names": [], "import_names": [], "rhs_call_name": "add_test", "annotation": ""}, "snippet": " self.stats[tag].add_test(test)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L183_C4", "label": "_is_included", "type": "function", "loc": [183, 186], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L156_C0", "vector": [2, 1, 0.634, 0.0137, 1, 0.26, 0.5, 221, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "_is_included", "arg_names": ["self", "tag"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _is_included(self, tag):\n if self._include and not utils.matches_any(tag, self._include):\n return False\n return not utils.matches_any(tag, self._exclude)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L184_C8", "label": "if", "type": "if", "loc": [184, 185], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L183_C4", "vector": [4, 2, 0.634, 0.0069, 2, 0.82, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._include and not utils.matches_any(tag, self._include):\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Return_L185_C12", "label": "return", "type": "return", "loc": [185, 185], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L184_C8", "vector": [13, 3, 0.6357, 0.0034, 3, 0.29, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Return_L186_C8", "label": "return", "type": "return", "loc": [186, 186], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L183_C4", "vector": [13, 2, 0.6392, 0.0034, 2, 0.82, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return not utils.matches_any(tag, self._exclude)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L188_C4", "label": "_add_combined_statistics", "type": "function", "loc": [188, 196], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L156_C0", "vector": [2, 1, 0.6598, 0.0309, 1, 0.26, 0.6667, 954, 0, 2, 0, 0, 0, 0, 5], "semantic": {"name": "_add_combined_statistics", "arg_names": ["self", "test"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _add_combined_statistics(self, test):\n for pattern, name in self._combine:\n name = name or pattern\n if name not in self.stats:\n self.stats[name] = TagStat(name, self._get_doc(name),\n self._get_links(name),\n combined=pattern)\n if test.is_included([pattern], []):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:For_L189_C8", "label": "for pattern, name", "type": "for", "loc": [189, 196], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L188_C4", "vector": [6, 2, 0.6615, 0.0275, 2, 0.89, 0.0, 5, 7, 0, 0, 0, 0, 0, 5], "semantic": {"name": "pattern, name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for pattern, name in self._combine:\n name = name or pattern\n if name not in self.stats:\n self.stats[name] = TagStat(name, self._get_doc(name),\n self._get_links(name),\n combined=pattern)\n if test.is_included([pattern], []):\n self.stats[name].add_test(test)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L190_C12", "label": "name =", "type": "assigned_variable", "loc": [190, 190], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:For_L189_C8", "vector": [14, 3, 0.6529, 0.0034, 3, 0.91, 0.0, 57, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " name = name or pattern"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L191_C12", "label": "if", "type": "if", "loc": [191, 194], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:For_L189_C8", "vector": [4, 3, 0.6615, 0.0137, 3, 0.91, 0.5, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if name not in self.stats:\n self.stats[name] = TagStat(name, self._get_doc(name),\n self._get_links(name),\n combined=pattern)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L192_C16", "label": " = TagStat()", "type": "assigned_variable", "loc": [192, 194], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L191_C12", "vector": [14, 4, 0.6632, 0.0103, 4, 0.15, 0.0, 0, 3, 4, 0, 0, 137, 10, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "TagStat", "annotation": ""}, "snippet": " self.stats[name] = TagStat(name, self._get_doc(name),\n self._get_links(name),\n combined=pattern)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L195_C12", "label": "if", "type": "if", "loc": [195, 196], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:For_L189_C8", "vector": [4, 3, 0.6718, 0.0069, 3, 0.91, 1.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if test.is_included([pattern], []):\n self.stats[name].add_test(test)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L196_C16", "label": "add_test()", "type": "expression", "loc": [196, 196], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L195_C12", "vector": [8, 4, 0.6735, 0.0034, 4, 0.56, 0.0, 653, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add_test", "arg_names": [], "import_names": [], "rhs_call_name": "add_test", "annotation": ""}, "snippet": " self.stats[name].add_test(test)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L198_C4", "label": "serialize", "type": "function", "loc": [198, 202], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L156_C0", "vector": [2, 1, 0.6873, 0.0172, 1, 0.26, 0.8333, 50, 0, 2, 0, 0, 0, 0, 5], "semantic": {"name": "serialize", "arg_names": ["self", "serializer"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def serialize(self, serializer):\n serializer.start_tag_stats(self)\n for stat in sorted(self.stats.values()):\n stat.serialize(serializer)\n serializer.end_tag_stats(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L199_C8", "label": "start_tag_stats()", "type": "expression", "loc": [199, 199], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L198_C4", "vector": [8, 2, 0.6838, 0.0034, 2, 0.7, 0.0, 5, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "start_tag_stats", "arg_names": [], "import_names": [], "rhs_call_name": "start_tag_stats", "annotation": ""}, "snippet": " serializer.start_tag_stats(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:For_L200_C8", "label": "for stat", "type": "for", "loc": [200, 201], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L198_C4", "vector": [6, 2, 0.689, 0.0069, 2, 0.7, 0.5, 48, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "stat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for stat in sorted(self.stats.values()):\n stat.serialize(serializer)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L201_C12", "label": "serialize()", "type": "expression", "loc": [201, 201], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:For_L200_C8", "vector": [8, 3, 0.6907, 0.0034, 3, 0.45, 0.0, 50, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "serialize", "arg_names": [], "import_names": [], "rhs_call_name": "serialize", "annotation": ""}, "snippet": " stat.serialize(serializer)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L202_C8", "label": "end_tag_stats()", "type": "expression", "loc": [202, 202], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L198_C4", "vector": [8, 2, 0.6942, 0.0034, 2, 0.7, 1.0, 676, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "end_tag_stats", "arg_names": [], "import_names": [], "rhs_call_name": "end_tag_stats", "annotation": ""}, "snippet": " serializer.end_tag_stats(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L204_C4", "label": "sort", "type": "function", "loc": [204, 206], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L156_C0", "vector": [2, 1, 0.7045, 0.0103, 1, 0.26, 1.0, 489, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "sort", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def sort(self):\n for stat in self.stats.values():\n stat.tests.sort()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:For_L205_C8", "label": "for stat", "type": "for", "loc": [205, 206], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L204_C4", "vector": [6, 2, 0.7062, 0.0069, 2, 0.35, 0.0, 48, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "stat", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for stat in self.stats.values():\n stat.tests.sort()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L206_C12", "label": "sort()", "type": "expression", "loc": [206, 206], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:For_L205_C8", "vector": [8, 3, 0.7079, 0.0034, 3, 0.66, 0.0, 489, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sort", "arg_names": [], "import_names": [], "rhs_call_name": "sort", "annotation": ""}, "snippet": " stat.tests.sort()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L209_C0", "label": "TotalStatistics", "type": "class", "loc": [209, 219], "level": 0, "parent": null, "vector": [3, 0, 0.7354, 0.0378, 0, 0.66, 0.75, 557, 0, 2, 0, 0, 0, 0, 6], "semantic": {"name": "TotalStatistics", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class TotalStatistics:\n\n def __init__(self, suite):\n self.critical = TotalStat('Critical Tests', suite.critical)\n self.all = TotalStat('All Tests', suite.all)\n\n def serialize(self, serializer):\n serializer.start_total_stats(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L211_C4", "label": "__init__", "type": "function", "loc": [211, 213], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L209_C0", "vector": [2, 1, 0.7285, 0.0103, 1, 0.51, 0.0, 555, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "suite"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, suite):\n self.critical = TotalStat('Critical Tests', suite.critical)\n self.all = TotalStat('All Tests', suite.all)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L212_C8", "label": "self.critical = TotalStat()", "type": "assigned_variable", "loc": [212, 212], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L211_C4", "vector": [14, 2, 0.7285, 0.0034, 2, 0.62, 0.0, 227, 3, 2, 0, 0, 903, 10, 1], "semantic": {"name": "self.critical", "arg_names": [], "import_names": [], "rhs_call_name": "TotalStat", "annotation": ""}, "snippet": " self.critical = TotalStat('Critical Tests', suite.critical)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L213_C8", "label": "self.all = TotalStat()", "type": "assigned_variable", "loc": [213, 213], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L211_C4", "vector": [14, 2, 0.732, 0.0034, 2, 0.62, 1.0, 857, 3, 2, 0, 0, 903, 10, 1], "semantic": {"name": "self.all", "arg_names": [], "import_names": [], "rhs_call_name": "TotalStat", "annotation": ""}, "snippet": " self.all = TotalStat('All Tests', suite.all)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L215_C4", "label": "serialize", "type": "function", "loc": [215, 219], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L209_C0", "vector": [2, 1, 0.7457, 0.0172, 1, 0.51, 1.0, 50, 0, 2, 0, 0, 0, 0, 4], "semantic": {"name": "serialize", "arg_names": ["self", "serializer"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def serialize(self, serializer):\n serializer.start_total_stats(self)\n self.critical.serialize(serializer)\n self.all.serialize(serializer)\n serializer.end_total_stats(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L216_C8", "label": "start_total_stats()", "type": "expression", "loc": [216, 216], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L215_C4", "vector": [8, 2, 0.7423, 0.0034, 2, 0.46, 0.0, 965, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "start_total_stats", "arg_names": [], "import_names": [], "rhs_call_name": "start_total_stats", "annotation": ""}, "snippet": " serializer.start_total_stats(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L217_C8", "label": "serialize()", "type": "expression", "loc": [217, 217], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L215_C4", "vector": [8, 2, 0.7457, 0.0034, 2, 0.46, 0.3333, 50, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "serialize", "arg_names": [], "import_names": [], "rhs_call_name": "serialize", "annotation": ""}, "snippet": " self.critical.serialize(serializer)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L218_C8", "label": "serialize()", "type": "expression", "loc": [218, 218], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L215_C4", "vector": [8, 2, 0.7491, 0.0034, 2, 0.46, 0.6667, 50, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "serialize", "arg_names": [], "import_names": [], "rhs_call_name": "serialize", "annotation": ""}, "snippet": " self.all.serialize(serializer)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L219_C8", "label": "end_total_stats()", "type": "expression", "loc": [219, 219], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L215_C4", "vector": [8, 2, 0.7526, 0.0034, 2, 0.46, 1.0, 602, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "end_total_stats", "arg_names": [], "import_names": [], "rhs_call_name": "end_total_stats", "annotation": ""}, "snippet": " serializer.end_total_stats(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L222_C0", "label": "TagStatInfo", "type": "class", "loc": [222, 232], "level": 0, "parent": null, "vector": [3, 0, 0.7801, 0.0378, 0, 0.66, 0.8333, 762, 0, 3, 0, 0, 0, 0, 6], "semantic": {"name": "TagStatInfo", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class TagStatInfo:\n\n def __init__(self, docs, links):\n self._docs = [TagStatDoc(*doc) for doc in docs]\n self._links = [TagStatLink(*link) for link in links]\n\n def get_doc(self, tag):\n return ' & '.join(doc.text for doc in self._docs if doc.matches(tag))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L224_C4", "label": "__init__", "type": "function", "loc": [224, 226], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L222_C0", "vector": [2, 1, 0.7732, 0.0103, 1, 0.89, 0.0, 555, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "docs", "links"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, docs, links):\n self._docs = [TagStatDoc(*doc) for doc in docs]\n self._links = [TagStatLink(*link) for link in links]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L225_C8", "label": "self._docs =", "type": "assigned_variable", "loc": [225, 225], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L224_C4", "vector": [14, 2, 0.7732, 0.0034, 2, 0.89, 0.0, 879, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self._docs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._docs = [TagStatDoc(*doc) for doc in docs]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L226_C8", "label": "self._links =", "type": "assigned_variable", "loc": [226, 226], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L224_C4", "vector": [14, 2, 0.7766, 0.0034, 2, 0.89, 1.0, 497, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self._links", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._links = [TagStatLink(*link) for link in links]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L228_C4", "label": "get_doc", "type": "function", "loc": [228, 229], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L222_C0", "vector": [2, 1, 0.7852, 0.0069, 1, 0.89, 0.5, 109, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "get_doc", "arg_names": ["self", "tag"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_doc(self, tag):\n return ' & '.join(doc.text for doc in self._docs if doc.matches(tag))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Return_L229_C8", "label": "return", "type": "return", "loc": [229, 229], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L228_C4", "vector": [13, 2, 0.7869, 0.0034, 2, 0.22, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ' & '.join(doc.text for doc in self._docs if doc.matches(tag))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L231_C4", "label": "get_links", "type": "function", "loc": [231, 232], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L222_C0", "vector": [2, 1, 0.7955, 0.0069, 1, 0.89, 1.0, 735, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "get_links", "arg_names": ["self", "tag"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_links(self, tag):\n return [link.get_link(tag) for link in self._links if link.matches(tag)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Return_L232_C8", "label": "return", "type": "return", "loc": [232, 232], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L231_C4", "vector": [13, 2, 0.7973, 0.0034, 2, 0.32, 0.0, 0, 5, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [link.get_link(tag) for link in self._links if link.matches(tag)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L235_C0", "label": "TagStatDoc", "type": "class", "loc": [235, 242], "level": 0, "parent": null, "vector": [3, 0, 0.8196, 0.0275, 0, 0.66, 0.9167, 746, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "TagStatDoc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class TagStatDoc:\n\n def __init__(self, pattern, doc):\n self.text = doc\n self._pattern = pattern\n\n def matches(self, tag):\n return utils.matches(tag, self._pattern)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L237_C4", "label": "__init__", "type": "function", "loc": [237, 239], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L235_C0", "vector": [2, 1, 0.8179, 0.0103, 1, 0.5, 0.0, 555, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "pattern", "doc"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, pattern, doc):\n self.text = doc\n self._pattern = pattern"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L238_C8", "label": "self.text =", "type": "assigned_variable", "loc": [238, 238], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L237_C4", "vector": [14, 2, 0.8179, 0.0034, 2, 0.91, 0.0, 320, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.text", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.text = doc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L239_C8", "label": "self._pattern =", "type": "assigned_variable", "loc": [239, 239], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L237_C4", "vector": [14, 2, 0.8213, 0.0034, 2, 0.91, 1.0, 701, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._pattern", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._pattern = pattern"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L241_C4", "label": "matches", "type": "function", "loc": [241, 242], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L235_C0", "vector": [2, 1, 0.8299, 0.0069, 1, 0.5, 1.0, 684, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "matches", "arg_names": ["self", "tag"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def matches(self, tag):\n return utils.matches(tag, self._pattern)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Return_L242_C8", "label": "return", "type": "return", "loc": [242, 242], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L241_C4", "vector": [13, 2, 0.8316, 0.0034, 2, 0.73, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return utils.matches(tag, self._pattern)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L245_C0", "label": "TagStatLink", "type": "class", "loc": [245, 291], "level": 0, "parent": null, "vector": [3, 0, 0.921, 0.1615, 0, 0.66, 1.0, 767, 0, 5, 0, 0, 0, 0, 21], "semantic": {"name": "TagStatLink", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class TagStatLink:\n _match_pattern_tokenizer = re.compile('(\\*|\\?)')\n\n def __init__(self, pattern, link, title):\n self._regexp = self._get_match_regexp(pattern)\n self._link = link\n self._title = title.replace('_', ' ')\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L246_C4", "label": "_match_pattern_tokenizer = compile()", "type": "assigned_variable", "loc": [246, 246], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L245_C0", "vector": [14, 1, 0.8454, 0.0034, 1, 0.15, 0.0, 824, 3, 1, 0, 0, 821, 10, 1], "semantic": {"name": "_match_pattern_tokenizer", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": " _match_pattern_tokenizer = re.compile('(\\*|\\?)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L248_C4", "label": "__init__", "type": "function", "loc": [248, 251], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L245_C0", "vector": [2, 1, 0.8574, 0.0137, 1, 0.15, 0.2, 555, 0, 4, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "pattern", "link", "title"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, pattern, link, title):\n self._regexp = self._get_match_regexp(pattern)\n self._link = link\n self._title = title.replace('_', ' ')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L249_C8", "label": "self._regexp = _get_match_regexp()", "type": "assigned_variable", "loc": [249, 249], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L248_C4", "vector": [14, 2, 0.8557, 0.0034, 2, 0.86, 0.0, 418, 3, 1, 0, 0, 421, 10, 1], "semantic": {"name": "self._regexp", "arg_names": [], "import_names": [], "rhs_call_name": "_get_match_regexp", "annotation": ""}, "snippet": " self._regexp = self._get_match_regexp(pattern)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L250_C8", "label": "self._link =", "type": "assigned_variable", "loc": [250, 250], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L248_C4", "vector": [14, 2, 0.8591, 0.0034, 2, 0.86, 0.5, 519, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._link", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._link = link"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L251_C8", "label": "self._title = replace()", "type": "assigned_variable", "loc": [251, 251], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L248_C4", "vector": [14, 2, 0.8625, 0.0034, 2, 0.86, 1.0, 209, 3, 2, 0, 0, 293, 10, 1], "semantic": {"name": "self._title", "arg_names": [], "import_names": [], "rhs_call_name": "replace", "annotation": ""}, "snippet": " self._title = title.replace('_', ' ')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L253_C4", "label": "matches", "type": "function", "loc": [253, 254], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L245_C0", "vector": [2, 1, 0.8711, 0.0069, 1, 0.15, 0.4, 684, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "matches", "arg_names": ["self", "tag"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def matches(self, tag):\n return self._regexp.match(tag) is not None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Return_L254_C8", "label": "return", "type": "return", "loc": [254, 254], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L253_C4", "vector": [13, 2, 0.8729, 0.0034, 2, 0.33, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._regexp.match(tag) is not None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L256_C4", "label": "get_link", "type": "function", "loc": [256, 261], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L245_C0", "vector": [2, 1, 0.8883, 0.0206, 1, 0.15, 0.6, 936, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "get_link", "arg_names": ["self", "tag"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_link(self, tag):\n match = self._regexp.match(tag)\n if not match:\n return None\n link, title = self._replace_groups(self._link, self._title, match)\n return link, title"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L257_C8", "label": "match = match()", "type": "assigned_variable", "loc": [257, 257], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L256_C4", "vector": [14, 2, 0.8832, 0.0034, 2, 0.47, 0.0, 36, 3, 1, 0, 0, 36, 10, 1], "semantic": {"name": "match", "arg_names": [], "import_names": [], "rhs_call_name": "match", "annotation": ""}, "snippet": " match = self._regexp.match(tag)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L258_C8", "label": "if", "type": "if", "loc": [258, 259], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L256_C4", "vector": [4, 2, 0.8883, 0.0069, 2, 0.47, 0.3333, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not match:\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Return_L259_C12", "label": "return", "type": "return", "loc": [259, 259], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L258_C8", "vector": [13, 3, 0.89, 0.0034, 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_99916:Assign_L260_C8", "label": "link, title = _replace_groups()", "type": "assigned_variable", "loc": [260, 260], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L256_C4", "vector": [14, 2, 0.8935, 0.0034, 2, 0.47, 0.6667, 939, 3, 3, 0, 0, 376, 10, 1], "semantic": {"name": "link, title", "arg_names": [], "import_names": [], "rhs_call_name": "_replace_groups", "annotation": ""}, "snippet": " link, title = self._replace_groups(self._link, self._title, match)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Return_L261_C8", "label": "return", "type": "return", "loc": [261, 261], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L256_C4", "vector": [13, 2, 0.8969, 0.0034, 2, 0.47, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return link, title"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L263_C4", "label": "_replace_groups", "type": "function", "loc": [263, 268], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L245_C0", "vector": [2, 1, 0.9124, 0.0206, 1, 0.15, 0.8, 376, 0, 4, 1, 0, 0, 0, 5], "semantic": {"name": "_replace_groups", "arg_names": ["self", "link", "title", "match"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _replace_groups(self, link, title, match):\n for index, group in enumerate(match.groups()):\n placefolder = '%' + str(index+1)\n link = link.replace(placefolder, group)\n title = title.replace(placefolder, group)\n return link, title"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:For_L264_C8", "label": "for index, group", "type": "for", "loc": [264, 267], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L263_C4", "vector": [6, 2, 0.9124, 0.0137, 2, 0.2, 0.0, 669, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "index, group", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for index, group in enumerate(match.groups()):\n placefolder = '%' + str(index+1)\n link = link.replace(placefolder, group)\n title = title.replace(placefolder, group)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L265_C12", "label": "placefolder =", "type": "assigned_variable", "loc": [265, 265], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:For_L264_C8", "vector": [14, 3, 0.9107, 0.0034, 3, 0.88, 0.0, 452, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "placefolder", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " placefolder = '%' + str(index+1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L266_C12", "label": "link = replace()", "type": "assigned_variable", "loc": [266, 266], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:For_L264_C8", "vector": [14, 3, 0.9141, 0.0034, 3, 0.88, 0.5, 880, 3, 2, 0, 0, 293, 10, 1], "semantic": {"name": "link", "arg_names": [], "import_names": [], "rhs_call_name": "replace", "annotation": ""}, "snippet": " link = link.replace(placefolder, group)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L267_C12", "label": "title = replace()", "type": "assigned_variable", "loc": [267, 267], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:For_L264_C8", "vector": [14, 3, 0.9175, 0.0034, 3, 0.88, 1.0, 48, 3, 2, 0, 0, 293, 10, 1], "semantic": {"name": "title", "arg_names": [], "import_names": [], "rhs_call_name": "replace", "annotation": ""}, "snippet": " title = title.replace(placefolder, group)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Return_L268_C8", "label": "return", "type": "return", "loc": [268, 268], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L263_C4", "vector": [13, 2, 0.921, 0.0034, 2, 0.2, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return link, title"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L270_C4", "label": "_get_match_regexp", "type": "function", "loc": [270, 291], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L245_C0", "vector": [2, 1, 0.9639, 0.0756, 1, 0.15, 1.0, 421, 0, 2, 1, 0, 0, 0, 10], "semantic": {"name": "_get_match_regexp", "arg_names": ["self", "pattern"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_match_regexp(self, pattern):\n regexp = []\n open_parenthesis = False\n for token in self._match_pattern_tokenizer.split(pattern):\n if token == '':\n continue\n if token == '?':\n if not open_parenthesis:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L271_C8", "label": "regexp =", "type": "assigned_variable", "loc": [271, 271], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L270_C4", "vector": [14, 2, 0.9313, 0.0034, 2, 0.77, 0.0, 982, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "regexp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " regexp = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L272_C8", "label": "open_parenthesis =", "type": "assigned_variable", "loc": [272, 272], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L270_C4", "vector": [14, 2, 0.9347, 0.0034, 2, 0.77, 0.25, 245, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "open_parenthesis", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " open_parenthesis = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:For_L273_C8", "label": "for token", "type": "for", "loc": [273, 288], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L270_C4", "vector": [6, 2, 0.9639, 0.055, 2, 0.77, 0.5, 129, 3, 0, 0, 0, 0, 0, 7], "semantic": {"name": "token", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for token in self._match_pattern_tokenizer.split(pattern):\n if token == '':\n continue\n if token == '?':\n if not open_parenthesis:\n regexp.append('(')\n open_parenthesis = True\n regexp.append('.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L274_C12", "label": "if", "type": "if", "loc": [274, 275], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:For_L273_C8", "vector": [4, 3, 0.9433, 0.0069, 3, 0.96, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if token == '':\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L276_C12", "label": "if", "type": "if", "loc": [276, 281], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:For_L273_C8", "vector": [4, 3, 0.957, 0.0206, 3, 0.96, 0.25, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if token == '?':\n if not open_parenthesis:\n regexp.append('(')\n open_parenthesis = True\n regexp.append('.')\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L277_C16", "label": "if", "type": "if", "loc": [277, 279], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L276_C12", "vector": [4, 4, 0.9553, 0.0103, 4, 0.64, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not open_parenthesis:\n regexp.append('(')\n open_parenthesis = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L278_C20", "label": "append()", "type": "expression", "loc": [278, 278], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L277_C16", "vector": [8, 5, 0.9553, 0.0034, 5, 0.31, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " regexp.append('(')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L279_C20", "label": "open_parenthesis =", "type": "assigned_variable", "loc": [279, 279], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L277_C16", "vector": [14, 5, 0.9588, 0.0034, 5, 0.31, 1.0, 245, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "open_parenthesis", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " open_parenthesis = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L280_C16", "label": "append()", "type": "expression", "loc": [280, 280], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L276_C12", "vector": [8, 4, 0.9622, 0.0034, 4, 0.64, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " regexp.append('.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L282_C12", "label": "if", "type": "if", "loc": [282, 284], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:For_L273_C8", "vector": [4, 3, 0.9725, 0.0103, 3, 0.96, 0.5, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if open_parenthesis:\n regexp.append(')')\n open_parenthesis = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L283_C16", "label": "append()", "type": "expression", "loc": [283, 283], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L282_C12", "vector": [8, 4, 0.9725, 0.0034, 4, 0.22, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " regexp.append(')')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L284_C16", "label": "open_parenthesis =", "type": "assigned_variable", "loc": [284, 284], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L282_C12", "vector": [14, 4, 0.9759, 0.0034, 4, 0.22, 1.0, 245, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "open_parenthesis", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " open_parenthesis = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L285_C12", "label": "if", "type": "if", "loc": [285, 287], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:For_L273_C8", "vector": [4, 3, 0.9828, 0.0103, 3, 0.96, 0.75, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if token == '*':\n regexp.append('(.*)')\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L286_C16", "label": "append()", "type": "expression", "loc": [286, 286], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L285_C12", "vector": [8, 4, 0.9828, 0.0034, 4, 0.31, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " regexp.append('(.*)')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L288_C12", "label": "append()", "type": "expression", "loc": [288, 288], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:For_L273_C8", "vector": [8, 3, 0.9897, 0.0034, 3, 0.96, 1.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " regexp.append(re.escape(token))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L289_C8", "label": "if", "type": "if", "loc": [289, 290], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L270_C4", "vector": [4, 2, 0.9948, 0.0069, 2, 0.77, 0.75, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if open_parenthesis:\n regexp.append(')')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L290_C12", "label": "append()", "type": "expression", "loc": [290, 290], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L289_C8", "vector": [8, 3, 0.9966, 0.0034, 3, 0.11, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " regexp.append(')')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99916:Return_L291_C8", "label": "return", "type": "return", "loc": [291, 291], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L270_C4", "vector": [13, 2, 1.0, 0.0034, 2, 0.77, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return re.compile('^%s$' % ''.join(regexp), re.IGNORECASE)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Return_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L39_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Return_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L70_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L67_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L78_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L79_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L78_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L87_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L78_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L91_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L78_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L95_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L96_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Return_L97_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L98_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L98_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Return_L99_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L100_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Return_L101_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Return_L102_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L78_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L104_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L108_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L109_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L108_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L111_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L112_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L113_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L108_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L116_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L117_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L120_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L122_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L122_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L123_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L122_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L124_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L122_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L125_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L122_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L126_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L122_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L127_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L122_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L128_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L120_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L130_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L130_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:For_L131_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:For_L131_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L132_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:For_L131_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L133_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:For_L131_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L134_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:For_L131_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L135_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L120_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L137_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L137_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:For_L138_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:For_L138_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L139_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:For_L138_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L140_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L140_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L141_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:For_L138_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L142_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L120_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L144_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L144_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L145_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L144_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L146_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L144_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L147_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L120_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L149_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L149_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L150_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L149_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L151_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L151_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:For_L152_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:For_L152_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L153_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L156_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L158_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L158_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L160_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L158_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L161_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L158_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L162_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L158_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L163_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L158_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L164_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L158_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L165_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L158_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L166_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L156_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L168_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L168_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L169_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L168_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L170_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L156_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L172_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L172_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:For_L173_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:For_L173_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L174_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:For_L173_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L176_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L176_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L177_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:For_L173_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L181_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L156_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L183_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L183_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L184_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L184_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Return_L185_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L183_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Return_L186_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L156_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L188_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L188_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:For_L189_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:For_L189_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L190_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:For_L189_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L191_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L191_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L192_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:For_L189_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L195_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L195_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L196_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L156_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L198_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L198_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L199_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L198_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:For_L200_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:For_L200_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L201_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L198_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L202_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L156_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L204_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L204_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:For_L205_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:For_L205_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L206_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L209_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L211_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L211_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L212_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L211_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L213_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L209_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L215_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L215_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L216_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L215_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L217_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L215_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L218_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L215_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L219_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L222_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L224_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L224_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L225_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L224_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L226_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L222_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L228_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L228_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Return_L229_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L222_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L231_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L231_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Return_L232_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L235_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L237_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L237_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L238_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L237_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L239_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L235_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L241_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L241_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Return_L242_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L245_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L246_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L245_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L248_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L249_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L250_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L248_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L251_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L245_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L253_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L253_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Return_L254_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L245_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L256_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L256_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L257_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L256_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L258_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L258_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Return_L259_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L256_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L260_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L256_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Return_L261_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L245_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L263_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L263_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:For_L264_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:For_L264_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L265_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:For_L264_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L266_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:For_L264_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L267_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L263_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Return_L268_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:ClassDef_L245_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L270_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L270_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L271_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L270_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L272_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L270_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:For_L273_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:For_L273_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L274_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:For_L273_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L276_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L276_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L277_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L277_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L278_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L277_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L279_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L276_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L280_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:For_L273_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L282_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L282_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L283_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L282_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Assign_L284_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:For_L273_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L285_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L285_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L286_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:For_L273_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L288_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L270_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L289_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:If_L289_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Expr_L290_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99916:FunctionDef_L270_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99916:Return_L291_C8"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from robot.errors import DataError
class BaseLibrary:
def get_handler(self, name):
try:
return self.handlers[name]
except KeyError:
raise DataError("No keyword handler with name '%s' found" % name)
def has_handler(self, name):
return self.handlers.has_key(name)
def __len__(self):
return len(self.handlers)
| ajibawa-2023/Python-Code-Large/train/row_99917 | 9 | 31 | 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_99917:ImportFrom_L16_C0", "label": "from robot.errors import DataError", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.5161, 0.0323, 0, 0.66, 0.0, 299, 0, 1, 0, 0, 299, 0, 0], "semantic": {"name": "robot.errors", "arg_names": [], "import_names": ["DataError"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot.errors import DataError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99917:ClassDef_L19_C0", "label": "BaseLibrary", "type": "class", "loc": [19, 31], "level": 0, "parent": null, "vector": [3, 0, 0.8065, 0.4194, 0, 0.66, 1.0, 411, 0, 3, 0, 0, 0, 0, 3], "semantic": {"name": "BaseLibrary", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class BaseLibrary:\n\n def get_handler(self, name):\n try:\n return self.handlers[name]\n except KeyError:\n raise DataError(\"No keyword handler with name '%s' found\" % name)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99917:FunctionDef_L21_C4", "label": "get_handler", "type": "function", "loc": [21, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99917:ClassDef_L19_C0", "vector": [2, 1, 0.7419, 0.1613, 1, 0.82, 0.0, 636, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "get_handler", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_handler(self, name):\n try:\n return self.handlers[name]\n except KeyError:\n raise DataError(\"No keyword handler with name '%s' found\" % name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99917:Try_L22_C8", "label": "try", "type": "try", "loc": [22, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99917:FunctionDef_L21_C4", "vector": [7, 2, 0.7581, 0.129, 2, 0.42, 0.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n return self.handlers[name]\n except KeyError:\n raise DataError(\"No keyword handler with name '%s' found\" % name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99917:Return_L23_C12", "label": "return", "type": "return", "loc": [23, 23], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99917:Try_L22_C8", "vector": [13, 3, 0.7419, 0.0323, 3, 0.9, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.handlers[name]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99917:FunctionDef_L27_C4", "label": "has_handler", "type": "function", "loc": [27, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99917:ClassDef_L19_C0", "vector": [2, 1, 0.8871, 0.0645, 1, 0.82, 0.5, 487, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "has_handler", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def has_handler(self, name):\n return self.handlers.has_key(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99917:Return_L28_C8", "label": "return", "type": "return", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99917:FunctionDef_L27_C4", "vector": [13, 2, 0.9032, 0.0323, 2, 0.52, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.handlers.has_key(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99917:FunctionDef_L30_C4", "label": "__len__", "type": "function", "loc": [30, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99917:ClassDef_L19_C0", "vector": [2, 1, 0.9839, 0.0645, 1, 0.82, 1.0, 76, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "__len__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __len__(self):\n return len(self.handlers)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99917:Return_L31_C8", "label": "return", "type": "return", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99917:FunctionDef_L30_C4", "vector": [13, 2, 1.0, 0.0323, 2, 0.45, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return len(self.handlers)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99917:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99917:FunctionDef_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99917:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99917:Try_L22_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99917:Try_L22_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99917:Return_L23_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99917:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99917:FunctionDef_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99917:FunctionDef_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99917:Return_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99917:ClassDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99917:FunctionDef_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99917:FunctionDef_L30_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99917:Return_L31_C8"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from model import BaseTestSuite, BaseTestCase
from keyword import BaseKeyword
from handlers import UserErrorHandler
from libraries import BaseLibrary
from statistics import Statistics
| ajibawa-2023/Python-Code-Large/train/row_99918 | 5 | 20 | 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_99918:ImportFrom_L16_C0", "label": "from model import BaseTestSuite, BaseTestCase", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.8, 0.05, 0, 0.66, 0.0, 722, 0, 2, 0, 0, 722, 0, 0], "semantic": {"name": "model", "arg_names": [], "import_names": ["BaseTestSuite", "BaseTestCase"], "rhs_call_name": "", "annotation": ""}, "snippet": "from model import BaseTestSuite, BaseTestCase"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99918:ImportFrom_L17_C0", "label": "from keyword import BaseKeyword", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.85, 0.05, 0, 0.66, 0.25, 454, 0, 1, 0, 0, 454, 0, 0], "semantic": {"name": "keyword", "arg_names": [], "import_names": ["BaseKeyword"], "rhs_call_name": "", "annotation": ""}, "snippet": "from keyword import BaseKeyword"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99918:ImportFrom_L18_C0", "label": "from handlers import UserErrorHandler", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.9, 0.05, 0, 0.66, 0.5, 183, 0, 1, 0, 0, 183, 0, 0], "semantic": {"name": "handlers", "arg_names": [], "import_names": ["UserErrorHandler"], "rhs_call_name": "", "annotation": ""}, "snippet": "from handlers import UserErrorHandler"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99918:ImportFrom_L19_C0", "label": "from libraries import BaseLibrary", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.95, 0.05, 0, 0.66, 0.75, 874, 0, 1, 0, 0, 874, 0, 0], "semantic": {"name": "libraries", "arg_names": [], "import_names": ["BaseLibrary"], "rhs_call_name": "", "annotation": ""}, "snippet": "from libraries import BaseLibrary"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99918:ImportFrom_L20_C0", "label": "from statistics import Statistics", "type": "import", "loc": [20, 20], "level": 0, "parent": null, "vector": [1, 0, 1.0, 0.05, 0, 0.66, 1.0, 35, 0, 1, 0, 0, 35, 0, 0], "semantic": {"name": "statistics", "arg_names": [], "import_names": ["Statistics"], "rhs_call_name": "", "annotation": ""}, "snippet": "from statistics import Statistics"}] | [] |
#!/usr/bin/env python
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""fixml.py -- A tool to fix broken Robot Framework output files
Usage: fixml.py inpath outpath
This tool can fix Robot Framework output files that are not properly finished
or are missing elements from the middle. It should be possible to generate
reports and logs from the fixed output afterwards with the `rebot` tool.
The tool uses BeautifulSoup module which must be installed separately.
See http://www.crummy.com/software/BeautifulSoup for more information.
Additionally, the tool is only compatible with Robot Framework 2.1.3 or newer.
"""
import sys
import os
try:
from BeautifulSoup import BeautifulStoneSoup
except ImportError:
raise ImportError('fixml.py requires BeautifulSoup to be installed: '
'http://www.crummy.com/software/BeautifulSoup/')
class Fixxxer(BeautifulStoneSoup):
NESTABLE_TAGS = {
'suite': ['robot','suite', 'statistics'],
'doc': ['suite', 'test', 'kw'],
'metadata': ['suite'],
'item': ['metadata'],
'status': ['suite', 'test', 'kw'],
'test': ['suite'],
'tags': ['test'],
'tag': ['tags'],
'kw': ['suite', 'test', 'kw'],
'msg': ['kw', 'errors'],
'arguments': ['kw'],
'arg': ['arguments'],
'statistics': ['robot'],
'errors': ['robot'],
}
__close_on_open = None
def unknown_starttag(self, name, attrs, selfClosing=0):
if name == 'robot':
attrs = [ (key, key == 'generator' and 'fixml.py' or value)
for key, value in attrs ]
if name == 'kw' and ('type', 'teardown') in attrs:
while self.tagStack[-1].name not in ['test', 'suite']:
self._popToTag(self.tagStack[-1].name)
if self.__close_on_open:
self._popToTag(self.__close_on_open)
self.__close_on_open = None
BeautifulStoneSoup.unknown_starttag(self, name, attrs, selfClosing)
def unknown_endtag(self, name):
BeautifulStoneSoup.unknown_endtag(self, name)
if name == 'status':
self.__close_on_open = self.tagStack[-1].name
else:
self.__close_on_open = None
def main(inpath, outpath):
outfile = open(outpath, 'w')
outfile.write(str(Fixxxer(open(inpath))))
outfile.close()
return outpath
if __name__ == '__main__':
try:
outpath = main(*sys.argv[1:])
except TypeError:
print __doc__
else:
print os.path.abspath(outpath)
| ajibawa-2023/Python-Code-Large/train/row_99919 | 33 | 92 | 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_99919:Expr_L18_C0", "label": "expression", "type": "expression", "loc": [18, 29], "level": 0, "parent": null, "vector": [8, 0, 0.2554, 0.1304, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"fixml.py -- A tool to fix broken Robot Framework output files\n\nUsage: fixml.py inpath outpath\n\nThis tool can fix Robot Framework output files that are not properly finished\nor are missing elements from the middle. It should be possible to generate\nreports and logs from the fixed output afterwards with the `rebot` tool.\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99919:Import_L31_C0", "label": "sys import sys", "type": "import", "loc": [31, 31], "level": 0, "parent": null, "vector": [1, 0, 0.337, 0.0109, 0, 0.66, 0.1667, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99919:Import_L32_C0", "label": "os import os", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.3478, 0.0109, 0, 0.66, 0.3333, 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_99919:Try_L33_C0", "label": "try", "type": "try", "loc": [33, 37], "level": 0, "parent": null, "vector": [7, 0, 0.3804, 0.0543, 0, 0.66, 0.5, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "try:\n from BeautifulSoup import BeautifulStoneSoup\nexcept ImportError:\n raise ImportError('fixml.py requires BeautifulSoup to be installed: '\n 'http://www.crummy.com/software/BeautifulSoup/')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99919:ImportFrom_L34_C4", "label": "from BeautifulSoup import BeautifulStoneSoup", "type": "import", "loc": [34, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99919:Try_L33_C0", "vector": [1, 1, 0.3696, 0.0109, 1, 0.96, 0.0, 878, 0, 1, 0, 0, 878, 0, 0], "semantic": {"name": "BeautifulSoup", "arg_names": [], "import_names": ["BeautifulStoneSoup"], "rhs_call_name": "", "annotation": ""}, "snippet": " from BeautifulSoup import BeautifulStoneSoup"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99919:ClassDef_L40_C0", "label": "Fixxxer", "type": "class", "loc": [40, 76], "level": 0, "parent": null, "vector": [3, 0, 0.6304, 0.4022, 0, 0.66, 0.6667, 450, 0, 2, 0, 0, 842, 0, 4], "semantic": {"name": "Fixxxer", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Fixxxer(BeautifulStoneSoup):\n NESTABLE_TAGS = {\n 'suite': ['robot','suite', 'statistics'],\n 'doc': ['suite', 'test', 'kw'],\n 'metadata': ['suite'],\n 'item': ['metadata'],\n 'status': ['suite', 'test', 'kw'],\n 'test': ['suite'],"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99919:Assign_L41_C4", "label": "NESTABLE_TAGS =", "type": "assigned_variable", "loc": [41, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99919:ClassDef_L40_C0", "vector": [14, 1, 0.5272, 0.1739, 1, 0.12, 0.0, 599, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "NESTABLE_TAGS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " NESTABLE_TAGS = {\n 'suite': ['robot','suite', 'statistics'],\n 'doc': ['suite', 'test', 'kw'],\n 'metadata': ['suite'],\n 'item': ['metadata'],\n 'status': ['suite', 'test', 'kw'],\n 'test': ['suite'],\n 'tags': ['test'],"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99919:Assign_L57_C4", "label": "__close_on_open =", "type": "assigned_variable", "loc": [57, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99919:ClassDef_L40_C0", "vector": [14, 1, 0.6196, 0.0109, 1, 0.12, 0.3333, 323, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "__close_on_open", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " __close_on_open = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99919:FunctionDef_L59_C4", "label": "unknown_starttag", "type": "function", "loc": [59, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99919:ClassDef_L40_C0", "vector": [2, 1, 0.6957, 0.1196, 1, 0.12, 0.6667, 568, 0, 4, 0, 0, 0, 0, 3], "semantic": {"name": "unknown_starttag", "arg_names": ["self", "name", "attrs", "selfClosing"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def unknown_starttag(self, name, attrs, selfClosing=0):\n if name == 'robot':\n attrs = [ (key, key == 'generator' and 'fixml.py' or value)\n for key, value in attrs ]\n if name == 'kw' and ('type', 'teardown') in attrs:\n while self.tagStack[-1].name not in ['test', 'suite']:\n self._popToTag(self.tagStack[-1].name)\n if self.__close_on_open:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99919:If_L60_C8", "label": "if", "type": "if", "loc": [60, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99919:FunctionDef_L59_C4", "vector": [4, 2, 0.663, 0.0326, 2, 0.81, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if name == 'robot':\n attrs = [ (key, key == 'generator' and 'fixml.py' or value)\n for key, value in attrs ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99919:Assign_L61_C12", "label": "attrs =", "type": "assigned_variable", "loc": [61, 62], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99919:If_L60_C8", "vector": [14, 3, 0.6685, 0.0217, 3, 0.8, 0.0, 251, 5, 0, 0, 0, 0, 0, 0], "semantic": {"name": "attrs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " attrs = [ (key, key == 'generator' and 'fixml.py' or value)\n for key, value in attrs ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99919:If_L63_C8", "label": "if", "type": "if", "loc": [63, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99919:FunctionDef_L59_C4", "vector": [4, 2, 0.6957, 0.0326, 2, 0.81, 0.3333, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if name == 'kw' and ('type', 'teardown') in attrs:\n while self.tagStack[-1].name not in ['test', 'suite']:\n self._popToTag(self.tagStack[-1].name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99919:While_L64_C12", "label": "while", "type": "while", "loc": [64, 65], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99919:If_L63_C8", "vector": [5, 3, 0.7011, 0.0217, 3, 0.94, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while self.tagStack[-1].name not in ['test', 'suite']:\n self._popToTag(self.tagStack[-1].name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99919:Expr_L65_C16", "label": "_popToTag()", "type": "expression", "loc": [65, 65], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99919:While_L64_C12", "vector": [8, 4, 0.7065, 0.0109, 4, 0.31, 0.0, 188, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_popToTag", "arg_names": [], "import_names": [], "rhs_call_name": "_popToTag", "annotation": ""}, "snippet": " self._popToTag(self.tagStack[-1].name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99919:If_L66_C8", "label": "if", "type": "if", "loc": [66, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99919:FunctionDef_L59_C4", "vector": [4, 2, 0.7283, 0.0326, 2, 0.81, 0.6667, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self.__close_on_open:\n self._popToTag(self.__close_on_open)\n self.__close_on_open = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99919:Expr_L67_C12", "label": "_popToTag()", "type": "expression", "loc": [67, 67], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99919:If_L66_C8", "vector": [8, 3, 0.7283, 0.0109, 3, 0.51, 0.0, 188, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_popToTag", "arg_names": [], "import_names": [], "rhs_call_name": "_popToTag", "annotation": ""}, "snippet": " self._popToTag(self.__close_on_open)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99919:Assign_L68_C12", "label": "self.__close_on_open =", "type": "assigned_variable", "loc": [68, 68], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99919:If_L66_C8", "vector": [14, 3, 0.7391, 0.0109, 3, 0.51, 1.0, 657, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.__close_on_open", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.__close_on_open = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99919:Expr_L69_C8", "label": "unknown_starttag()", "type": "expression", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99919:FunctionDef_L59_C4", "vector": [8, 2, 0.75, 0.0109, 2, 0.81, 1.0, 568, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "unknown_starttag", "arg_names": [], "import_names": [], "rhs_call_name": "unknown_starttag", "annotation": ""}, "snippet": " BeautifulStoneSoup.unknown_starttag(self, name, attrs, selfClosing)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99919:FunctionDef_L71_C4", "label": "unknown_endtag", "type": "function", "loc": [71, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99919:ClassDef_L40_C0", "vector": [2, 1, 0.7989, 0.0652, 1, 0.12, 1.0, 199, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "unknown_endtag", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def unknown_endtag(self, name):\n BeautifulStoneSoup.unknown_endtag(self, name)\n if name == 'status':\n self.__close_on_open = self.tagStack[-1].name\n else:\n self.__close_on_open = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99919:Expr_L72_C8", "label": "unknown_endtag()", "type": "expression", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99919:FunctionDef_L71_C4", "vector": [8, 2, 0.7826, 0.0109, 2, 0.65, 0.0, 199, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "unknown_endtag", "arg_names": [], "import_names": [], "rhs_call_name": "unknown_endtag", "annotation": ""}, "snippet": " BeautifulStoneSoup.unknown_endtag(self, name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99919:If_L73_C8", "label": "if", "type": "if", "loc": [73, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99919:FunctionDef_L71_C4", "vector": [4, 2, 0.8098, 0.0435, 2, 0.65, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if name == 'status':\n self.__close_on_open = self.tagStack[-1].name\n else:\n self.__close_on_open = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99919:Assign_L74_C12", "label": "self.__close_on_open =", "type": "assigned_variable", "loc": [74, 74], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99919:If_L73_C8", "vector": [14, 3, 0.8043, 0.0109, 3, 0.31, 0.0, 657, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.__close_on_open", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.__close_on_open = self.tagStack[-1].name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99919:Assign_L76_C12", "label": "self.__close_on_open =", "type": "assigned_variable", "loc": [76, 76], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99919:If_L73_C8", "vector": [14, 3, 0.8261, 0.0109, 3, 0.31, 1.0, 657, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self.__close_on_open", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.__close_on_open = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99919:FunctionDef_L79_C0", "label": "main", "type": "function", "loc": [79, 83], "level": 0, "parent": null, "vector": [2, 0, 0.8804, 0.0543, 0, 0.66, 0.8333, 624, 0, 2, 1, 0, 0, 0, 6], "semantic": {"name": "main", "arg_names": ["inpath", "outpath"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def main(inpath, outpath):\n outfile = open(outpath, 'w')\n outfile.write(str(Fixxxer(open(inpath))))\n outfile.close()\n return outpath"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99919:Assign_L80_C4", "label": "outfile = open()", "type": "assigned_variable", "loc": [80, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99919:FunctionDef_L79_C0", "vector": [14, 1, 0.8696, 0.0109, 1, 0.81, 0.0, 206, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "outfile", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": " outfile = open(outpath, 'w')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99919:Expr_L81_C4", "label": "write()", "type": "expression", "loc": [81, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99919:FunctionDef_L79_C0", "vector": [8, 1, 0.8804, 0.0109, 1, 0.81, 0.3333, 837, 3, 1, 0, 0, 0, 0, 4], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " outfile.write(str(Fixxxer(open(inpath))))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99919:Expr_L82_C4", "label": "close()", "type": "expression", "loc": [82, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99919:FunctionDef_L79_C0", "vector": [8, 1, 0.8913, 0.0109, 1, 0.81, 0.6667, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " outfile.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99919:Return_L83_C4", "label": "return", "type": "return", "loc": [83, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99919:FunctionDef_L79_C0", "vector": [13, 1, 0.9022, 0.0109, 1, 0.81, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return outpath"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99919:If_L86_C0", "label": "if", "type": "if", "loc": [86, 92], "level": 0, "parent": null, "vector": [4, 0, 0.9674, 0.0761, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n try:\n outpath = main(*sys.argv[1:])\n except TypeError:\n print(__doc__)\n else:\n print(os.path.abspath(outpath))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99919:Try_L87_C4", "label": "try", "type": "try", "loc": [87, 92], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99919:If_L86_C0", "vector": [7, 1, 0.9728, 0.0652, 1, 0.7, 0.0, 0, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n outpath = main(*sys.argv[1:])\n except TypeError:\n print(__doc__)\n else:\n print(os.path.abspath(outpath))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99919:Assign_L88_C8", "label": "outpath = main()", "type": "assigned_variable", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99919:Try_L87_C4", "vector": [14, 2, 0.9565, 0.0109, 2, 0.49, 0.0, 74, 3, 1, 0, 0, 624, 10, 1], "semantic": {"name": "outpath", "arg_names": [], "import_names": [], "rhs_call_name": "main", "annotation": ""}, "snippet": " outpath = main(*sys.argv[1:])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99919:Expr_L90_C8", "label": "print()", "type": "expression", "loc": [90, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99919:Try_L87_C4", "vector": [8, 2, 0.9783, 0.0109, 2, 0.49, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(__doc__)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99919:Expr_L92_C8", "label": "print()", "type": "expression", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99919:Try_L87_C4", "vector": [8, 2, 1.0, 0.0109, 2, 0.49, 1.0, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(os.path.abspath(outpath))"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99919:Try_L33_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99919:ImportFrom_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99919:ClassDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99919:Assign_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99919:ClassDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99919:Assign_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99919:ClassDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99919:FunctionDef_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99919:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99919:If_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99919:If_L60_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99919:Assign_L61_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99919:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99919:If_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99919:If_L63_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99919:While_L64_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99919:While_L64_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99919:Expr_L65_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99919:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99919:If_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99919:If_L66_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99919:Expr_L67_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99919:If_L66_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99919:Assign_L68_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99919:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99919:Expr_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99919:ClassDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99919:FunctionDef_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99919:FunctionDef_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99919:Expr_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99919:FunctionDef_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99919:If_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99919:If_L73_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99919:Assign_L74_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99919:If_L73_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99919:Assign_L76_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99919:FunctionDef_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99919:Assign_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99919:FunctionDef_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99919:Expr_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99919:FunctionDef_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99919:Expr_L82_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99919:FunctionDef_L79_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99919:Return_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99919:If_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99919:Try_L87_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99919:Try_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99919:Assign_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99919:Try_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99919:Expr_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99919:Try_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99919:Expr_L92_C8"}] |
#!/usr/bin/env python
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Robot Framework Start/End/Elapsed Time Reporter
Usage: times2csv.py input-xml [output-csv] [include-items]
This script reads start, end, and elapsed times from all suites, tests and/or
keywords from the given output file, and writes them into an file in
comma-separated-values (CSV) format. CSV files can then be further processed
with spreadsheet programs. If the CSV output file is not given, its name is
got from the input file by replacing the '.xml' extension with '.csv'.
'include-items' can be used for defining which items to process. Possible
values are 'suite', 'test' and 'keyword', and they can be combined to specify
multiple items e.g. like 'suite-test' or 'test-keyword'.
Examples:
$ times2csv.py output.xml
$ times2csv.py path/results.xml path2/times.csv
$ times2csv.py output.xml times.csv test
$ times2csv.py output.xml times.csv suite-test
"""
import sys
import os
import csv
from robot.output import TestSuite
from robot import utils
def process_file(inpath, outpath, items):
suite = TestSuite(inpath)
outfile = open(outpath, 'wb')
writer = csv.writer(outfile)
writer.writerow(['TYPE','NAME','STATUS','START','END','ELAPSED','ELAPSED SECS'])
process_suite(suite, writer, items.lower())
outfile.close()
def process_suite(suite, writer, items, level=0):
if 'suite' in items:
process_item(suite, writer, level, 'Suite')
if 'keyword' in items:
for kw in suite.setup, suite.teardown:
process_keyword(kw, writer, level+1)
for subsuite in suite.suites:
process_suite(subsuite, writer, items, level+1)
for test in suite.tests:
process_test(test, writer, items, level+1)
def process_test(test, writer, items, level):
if 'test' in items:
process_item(test, writer, level, 'Test', 'suite' not in items)
if 'keyword' in items:
for kw in [test.setup] + test.keywords + [test.teardown]:
process_keyword(kw, writer, level+1)
def process_keyword(kw, writer, level):
if kw is None:
return
if kw.type in ['kw', 'set', 'repeat']:
kw_type = 'Keyword'
else:
kw_type = kw.type.capitalize()
process_item(kw, writer, level, kw_type)
for subkw in kw.keywords:
process_keyword(subkw, writer, level+1)
def process_item(item, writer, level, item_type, long_name=False):
if level == 0:
indent = ''
else:
indent = '| ' * (level-1) + '|- '
if long_name:
name = item.longname
else:
name = item.name
writer.writerow([indent+item_type, name, item.status, item.starttime,
item.endtime, utils.elapsed_time_to_string(item.elapsedtime),
item.elapsedtime/1000.0])
if __name__ == '__main__':
if not (2 <= len(sys.argv) <= 4) or '--help' in sys.argv:
print __doc__
sys.exit(1)
inxml = sys.argv[1]
try:
outcsv = sys.argv[2]
except IndexError:
outcsv = os.path.splitext(inxml)[0] + '.csv'
try:
items = sys.argv[3]
except IndexError:
items = 'suite-test-keyword'
process_file(inxml, outcsv, items)
print os.path.abspath(outcsv)
| ajibawa-2023/Python-Code-Large/train/row_99920 | 59 | 112 | 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_99920:Expr_L18_C0", "label": "expression", "type": "expression", "loc": [18, 37], "level": 0, "parent": null, "vector": [8, 0, 0.2455, 0.1786, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"Robot Framework Start/End/Elapsed Time Reporter\n\nUsage: times2csv.py input-xml [output-csv] [include-items]\n\nThis script reads start, end, and elapsed times from all suites, tests and/or\nkeywords from the given output file, and writes them into an file in\ncomma-separated-values (CSV) format. CSV files can then be further processed\nwith spreadsheet programs. If the CSV output file is not given, its name is"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99920:Import_L39_C0", "label": "sys import sys", "type": "import", "loc": [39, 39], "level": 0, "parent": null, "vector": [1, 0, 0.3482, 0.0089, 0, 0.66, 0.0909, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99920:Import_L40_C0", "label": "os import os", "type": "import", "loc": [40, 40], "level": 0, "parent": null, "vector": [1, 0, 0.3571, 0.0089, 0, 0.66, 0.1818, 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_99920:Import_L41_C0", "label": "csv import csv", "type": "import", "loc": [41, 41], "level": 0, "parent": null, "vector": [1, 0, 0.3661, 0.0089, 0, 0.66, 0.2727, 312, 0, 1, 0, 0, 312, 0, 0], "semantic": {"name": "csv", "arg_names": [], "import_names": ["csv"], "rhs_call_name": "", "annotation": ""}, "snippet": "import csv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99920:ImportFrom_L43_C0", "label": "from robot.output import TestSuite", "type": "import", "loc": [43, 43], "level": 0, "parent": null, "vector": [1, 0, 0.3839, 0.0089, 0, 0.66, 0.3636, 596, 0, 1, 0, 0, 596, 0, 0], "semantic": {"name": "robot.output", "arg_names": [], "import_names": ["TestSuite"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot.output import TestSuite"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99920:ImportFrom_L44_C0", "label": "from robot import utils", "type": "import", "loc": [44, 44], "level": 0, "parent": null, "vector": [1, 0, 0.3929, 0.0089, 0, 0.66, 0.4545, 735, 0, 1, 0, 0, 735, 0, 0], "semantic": {"name": "robot", "arg_names": [], "import_names": ["utils"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot import utils"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99920:FunctionDef_L47_C0", "label": "process_file", "type": "function", "loc": [47, 53], "level": 0, "parent": null, "vector": [2, 0, 0.4464, 0.0625, 0, 0.66, 0.5455, 769, 0, 3, 0, 0, 0, 0, 7], "semantic": {"name": "process_file", "arg_names": ["inpath", "outpath", "items"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def process_file(inpath, outpath, items):\n suite = TestSuite(inpath)\n outfile = open(outpath, 'wb')\n writer = csv.writer(outfile)\n writer.writerow(['TYPE','NAME','STATUS','START','END','ELAPSED','ELAPSED SECS'])\n process_suite(suite, writer, items.lower())\n outfile.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99920:Assign_L48_C4", "label": "suite = TestSuite()", "type": "assigned_variable", "loc": [48, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99920:FunctionDef_L47_C0", "vector": [14, 1, 0.4286, 0.0089, 1, 0.89, 0.0, 425, 3, 1, 0, 0, 75, 10, 1], "semantic": {"name": "suite", "arg_names": [], "import_names": [], "rhs_call_name": "TestSuite", "annotation": ""}, "snippet": " suite = TestSuite(inpath)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99920:Assign_L49_C4", "label": "outfile = open()", "type": "assigned_variable", "loc": [49, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99920:FunctionDef_L47_C0", "vector": [14, 1, 0.4375, 0.0089, 1, 0.89, 0.2, 206, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "outfile", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": " outfile = open(outpath, 'wb')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99920:Assign_L50_C4", "label": "writer = writer()", "type": "assigned_variable", "loc": [50, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99920:FunctionDef_L47_C0", "vector": [14, 1, 0.4464, 0.0089, 1, 0.89, 0.4, 614, 3, 1, 0, 0, 614, 10, 1], "semantic": {"name": "writer", "arg_names": [], "import_names": [], "rhs_call_name": "writer", "annotation": ""}, "snippet": " writer = csv.writer(outfile)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99920:Expr_L51_C4", "label": "writerow()", "type": "expression", "loc": [51, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99920:FunctionDef_L47_C0", "vector": [8, 1, 0.4554, 0.0089, 1, 0.89, 0.6, 941, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "writerow", "arg_names": [], "import_names": [], "rhs_call_name": "writerow", "annotation": ""}, "snippet": " writer.writerow(['TYPE','NAME','STATUS','START','END','ELAPSED','ELAPSED SECS'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99920:Expr_L52_C4", "label": "process_suite()", "type": "expression", "loc": [52, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99920:FunctionDef_L47_C0", "vector": [8, 1, 0.4643, 0.0089, 1, 0.89, 0.8, 629, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "process_suite", "arg_names": [], "import_names": [], "rhs_call_name": "process_suite", "annotation": ""}, "snippet": " process_suite(suite, writer, items.lower())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99920:Expr_L53_C4", "label": "close()", "type": "expression", "loc": [53, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99920:FunctionDef_L47_C0", "vector": [8, 1, 0.4732, 0.0089, 1, 0.89, 1.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " outfile.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99920:FunctionDef_L55_C0", "label": "process_suite", "type": "function", "loc": [55, 64], "level": 0, "parent": null, "vector": [2, 0, 0.5312, 0.0893, 0, 0.66, 0.6364, 629, 0, 4, 0, 0, 0, 0, 4], "semantic": {"name": "process_suite", "arg_names": ["suite", "writer", "items", "level"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def process_suite(suite, writer, items, level=0):\n if 'suite' in items:\n process_item(suite, writer, level, 'Suite')\n if 'keyword' in items:\n for kw in suite.setup, suite.teardown:\n process_keyword(kw, writer, level+1)\n for subsuite in suite.suites:\n process_suite(subsuite, writer, items, level+1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99920:If_L56_C4", "label": "if", "type": "if", "loc": [56, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99920:FunctionDef_L55_C0", "vector": [4, 1, 0.5045, 0.0179, 1, 0.3, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'suite' in items:\n process_item(suite, writer, level, 'Suite')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99920:Expr_L57_C8", "label": "process_item()", "type": "expression", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99920:If_L56_C4", "vector": [8, 2, 0.5089, 0.0089, 2, 0.22, 0.0, 762, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "process_item", "arg_names": [], "import_names": [], "rhs_call_name": "process_item", "annotation": ""}, "snippet": " process_item(suite, writer, level, 'Suite')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99920:If_L58_C4", "label": "if", "type": "if", "loc": [58, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99920:FunctionDef_L55_C0", "vector": [4, 1, 0.5268, 0.0268, 1, 0.3, 0.3333, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'keyword' in items:\n for kw in suite.setup, suite.teardown:\n process_keyword(kw, writer, level+1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99920:For_L59_C8", "label": "for kw", "type": "for", "loc": [59, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99920:If_L58_C4", "vector": [6, 2, 0.5312, 0.0179, 2, 0.03, 0.0, 755, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "kw", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for kw in suite.setup, suite.teardown:\n process_keyword(kw, writer, level+1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99920:Expr_L60_C12", "label": "process_keyword()", "type": "expression", "loc": [60, 60], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99920:For_L59_C8", "vector": [8, 3, 0.5357, 0.0089, 3, 0.51, 0.0, 837, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "process_keyword", "arg_names": [], "import_names": [], "rhs_call_name": "process_keyword", "annotation": ""}, "snippet": " process_keyword(kw, writer, level+1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99920:For_L61_C4", "label": "for subsuite", "type": "for", "loc": [61, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99920:FunctionDef_L55_C0", "vector": [6, 1, 0.5491, 0.0179, 1, 0.3, 0.6667, 700, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "subsuite", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for subsuite in suite.suites:\n process_suite(subsuite, writer, items, level+1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99920:Expr_L62_C8", "label": "process_suite()", "type": "expression", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99920:For_L61_C4", "vector": [8, 2, 0.5536, 0.0089, 2, 0.42, 0.0, 629, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "process_suite", "arg_names": [], "import_names": [], "rhs_call_name": "process_suite", "annotation": ""}, "snippet": " process_suite(subsuite, writer, items, level+1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99920:For_L63_C4", "label": "for test", "type": "for", "loc": [63, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99920:FunctionDef_L55_C0", "vector": [6, 1, 0.567, 0.0179, 1, 0.3, 1.0, 224, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "test", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for test in suite.tests:\n process_test(test, writer, items, level+1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99920:Expr_L64_C8", "label": "process_test()", "type": "expression", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99920:For_L63_C4", "vector": [8, 2, 0.5714, 0.0089, 2, 0.99, 0.0, 871, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "process_test", "arg_names": [], "import_names": [], "rhs_call_name": "process_test", "annotation": ""}, "snippet": " process_test(test, writer, items, level+1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99920:FunctionDef_L66_C0", "label": "process_test", "type": "function", "loc": [66, 71], "level": 0, "parent": null, "vector": [2, 0, 0.6116, 0.0536, 0, 0.66, 0.7273, 871, 0, 4, 0, 0, 0, 0, 2], "semantic": {"name": "process_test", "arg_names": ["test", "writer", "items", "level"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def process_test(test, writer, items, level):\n if 'test' in items:\n process_item(test, writer, level, 'Test', 'suite' not in items)\n if 'keyword' in items:\n for kw in [test.setup] + test.keywords + [test.teardown]:\n process_keyword(kw, writer, level+1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99920:If_L67_C4", "label": "if", "type": "if", "loc": [67, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99920:FunctionDef_L66_C0", "vector": [4, 1, 0.6027, 0.0179, 1, 0.44, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'test' in items:\n process_item(test, writer, level, 'Test', 'suite' not in items)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99920:Expr_L68_C8", "label": "process_item()", "type": "expression", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99920:If_L67_C4", "vector": [8, 2, 0.6071, 0.0089, 2, 0.54, 0.0, 762, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "process_item", "arg_names": [], "import_names": [], "rhs_call_name": "process_item", "annotation": ""}, "snippet": " process_item(test, writer, level, 'Test', 'suite' not in items)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99920:If_L69_C4", "label": "if", "type": "if", "loc": [69, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99920:FunctionDef_L66_C0", "vector": [4, 1, 0.625, 0.0268, 1, 0.44, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'keyword' in items:\n for kw in [test.setup] + test.keywords + [test.teardown]:\n process_keyword(kw, writer, level+1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99920:For_L70_C8", "label": "for kw", "type": "for", "loc": [70, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99920:If_L69_C4", "vector": [6, 2, 0.6295, 0.0179, 2, 0.77, 0.0, 755, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "kw", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for kw in [test.setup] + test.keywords + [test.teardown]:\n process_keyword(kw, writer, level+1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99920:Expr_L71_C12", "label": "process_keyword()", "type": "expression", "loc": [71, 71], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99920:For_L70_C8", "vector": [8, 3, 0.6339, 0.0089, 3, 0.12, 0.0, 837, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "process_keyword", "arg_names": [], "import_names": [], "rhs_call_name": "process_keyword", "annotation": ""}, "snippet": " process_keyword(kw, writer, level+1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99920:FunctionDef_L73_C0", "label": "process_keyword", "type": "function", "loc": [73, 82], "level": 0, "parent": null, "vector": [2, 0, 0.692, 0.0893, 0, 0.66, 0.8182, 837, 0, 3, 0, 0, 0, 0, 3], "semantic": {"name": "process_keyword", "arg_names": ["kw", "writer", "level"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def process_keyword(kw, writer, level):\n if kw is None:\n return\n if kw.type in ['kw', 'set', 'repeat']:\n kw_type = 'Keyword'\n else:\n kw_type = kw.type.capitalize()\n process_item(kw, writer, level, kw_type)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99920:If_L74_C4", "label": "if", "type": "if", "loc": [74, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99920:FunctionDef_L73_C0", "vector": [4, 1, 0.6652, 0.0179, 1, 0.38, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if kw is None:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99920:Return_L75_C8", "label": "return", "type": "return", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99920:If_L74_C4", "vector": [13, 2, 0.6696, 0.0089, 2, 0.97, 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_99920:If_L76_C4", "label": "if", "type": "if", "loc": [76, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99920:FunctionDef_L73_C0", "vector": [4, 1, 0.692, 0.0357, 1, 0.38, 0.3333, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if kw.type in ['kw', 'set', 'repeat']:\n kw_type = 'Keyword'\n else:\n kw_type = kw.type.capitalize()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99920:Assign_L77_C8", "label": "kw_type =", "type": "assigned_variable", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99920:If_L76_C4", "vector": [14, 2, 0.6875, 0.0089, 2, 0.4, 0.0, 168, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "kw_type", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " kw_type = 'Keyword'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99920:Assign_L79_C8", "label": "kw_type = capitalize()", "type": "assigned_variable", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99920:If_L76_C4", "vector": [14, 2, 0.7054, 0.0089, 2, 0.4, 1.0, 168, 3, 0, 0, 0, 353, 10, 1], "semantic": {"name": "kw_type", "arg_names": [], "import_names": [], "rhs_call_name": "capitalize", "annotation": ""}, "snippet": " kw_type = kw.type.capitalize()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99920:Expr_L80_C4", "label": "process_item()", "type": "expression", "loc": [80, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99920:FunctionDef_L73_C0", "vector": [8, 1, 0.7143, 0.0089, 1, 0.38, 0.6667, 762, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "process_item", "arg_names": [], "import_names": [], "rhs_call_name": "process_item", "annotation": ""}, "snippet": " process_item(kw, writer, level, kw_type)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99920:For_L81_C4", "label": "for subkw", "type": "for", "loc": [81, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99920:FunctionDef_L73_C0", "vector": [6, 1, 0.7277, 0.0179, 1, 0.38, 1.0, 780, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "subkw", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for subkw in kw.keywords:\n process_keyword(subkw, writer, level+1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99920:Expr_L82_C8", "label": "process_keyword()", "type": "expression", "loc": [82, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99920:For_L81_C4", "vector": [8, 2, 0.7321, 0.0089, 2, 0.55, 0.0, 837, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "process_keyword", "arg_names": [], "import_names": [], "rhs_call_name": "process_keyword", "annotation": ""}, "snippet": " process_keyword(subkw, writer, level+1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99920:FunctionDef_L84_C0", "label": "process_item", "type": "function", "loc": [84, 95], "level": 0, "parent": null, "vector": [2, 0, 0.7991, 0.1071, 0, 0.66, 0.9091, 762, 0, 5, 0, 0, 0, 0, 2], "semantic": {"name": "process_item", "arg_names": ["item", "writer", "level", "item_type", "long_name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def process_item(item, writer, level, item_type, long_name=False):\n if level == 0:\n indent = ''\n else:\n indent = '| ' * (level-1) + '|- '\n if long_name:\n name = item.longname\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99920:If_L85_C4", "label": "if", "type": "if", "loc": [85, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99920:FunctionDef_L84_C0", "vector": [4, 1, 0.7723, 0.0357, 1, 0.76, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if level == 0:\n indent = ''\n else:\n indent = '| ' * (level-1) + '|- '"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99920:Assign_L86_C8", "label": "indent =", "type": "assigned_variable", "loc": [86, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99920:If_L85_C4", "vector": [14, 2, 0.7679, 0.0089, 2, 0.1, 0.0, 231, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "indent", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " indent = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99920:Assign_L88_C8", "label": "indent =", "type": "assigned_variable", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99920:If_L85_C4", "vector": [14, 2, 0.7857, 0.0089, 2, 0.1, 1.0, 231, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "indent", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " indent = '| ' * (level-1) + '|- '"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99920:If_L89_C4", "label": "if", "type": "if", "loc": [89, 92], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99920:FunctionDef_L84_C0", "vector": [4, 1, 0.808, 0.0357, 1, 0.76, 0.5, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if long_name:\n name = item.longname\n else:\n name = item.name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99920:Assign_L90_C8", "label": "name =", "type": "assigned_variable", "loc": [90, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99920:If_L89_C4", "vector": [14, 2, 0.8036, 0.0089, 2, 0.86, 0.0, 57, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " name = item.longname"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99920:Assign_L92_C8", "label": "name =", "type": "assigned_variable", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99920:If_L89_C4", "vector": [14, 2, 0.8214, 0.0089, 2, 0.86, 1.0, 57, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " name = item.name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99920:Expr_L93_C4", "label": "writerow()", "type": "expression", "loc": [93, 95], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99920:FunctionDef_L84_C0", "vector": [8, 1, 0.8393, 0.0268, 1, 0.76, 1.0, 941, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "writerow", "arg_names": [], "import_names": [], "rhs_call_name": "writerow", "annotation": ""}, "snippet": " writer.writerow([indent+item_type, name, item.status, item.starttime,\n item.endtime, utils.elapsed_time_to_string(item.elapsedtime), \n item.elapsedtime/1000.0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99920:If_L98_C0", "label": "if", "type": "if", "loc": [98, 112], "level": 0, "parent": null, "vector": [4, 0, 0.9375, 0.1339, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n if not (2 <= len(sys.argv) <= 4) or '--help' in sys.argv:\n print(__doc__)\n sys.exit(1)\n inxml = sys.argv[1]\n try:\n outcsv = sys.argv[2]\n except IndexError:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99920:If_L99_C4", "label": "if", "type": "if", "loc": [99, 101], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99920:If_L98_C0", "vector": [4, 1, 0.8929, 0.0268, 1, 0.34, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not (2 <= len(sys.argv) <= 4) or '--help' in sys.argv:\n print(__doc__)\n sys.exit(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99920:Expr_L100_C8", "label": "print()", "type": "expression", "loc": [100, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99920:If_L99_C4", "vector": [8, 2, 0.8929, 0.0089, 2, 0.51, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(__doc__)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99920:Expr_L101_C8", "label": "exit()", "type": "expression", "loc": [101, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99920:If_L99_C4", "vector": [8, 2, 0.9018, 0.0089, 2, 0.51, 1.0, 436, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "exit", "arg_names": [], "import_names": [], "rhs_call_name": "exit", "annotation": ""}, "snippet": " sys.exit(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99920:Assign_L102_C4", "label": "inxml =", "type": "assigned_variable", "loc": [102, 102], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99920:If_L98_C0", "vector": [14, 1, 0.9107, 0.0089, 1, 0.34, 0.2, 634, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "inxml", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " inxml = sys.argv[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99920:Try_L103_C4", "label": "try", "type": "try", "loc": [103, 106], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99920:If_L98_C0", "vector": [7, 1, 0.933, 0.0357, 1, 0.34, 0.4, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n outcsv = sys.argv[2]\n except IndexError:\n outcsv = os.path.splitext(inxml)[0] + '.csv'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99920:Assign_L104_C8", "label": "outcsv =", "type": "assigned_variable", "loc": [104, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99920:Try_L103_C4", "vector": [14, 2, 0.9286, 0.0089, 2, 0.35, 0.0, 270, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "outcsv", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " outcsv = sys.argv[2]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99920:Assign_L106_C8", "label": "outcsv =", "type": "assigned_variable", "loc": [106, 106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99920:Try_L103_C4", "vector": [14, 2, 0.9464, 0.0089, 2, 0.35, 0.0, 270, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "outcsv", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " outcsv = os.path.splitext(inxml)[0] + '.csv'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99920:Try_L107_C4", "label": "try", "type": "try", "loc": [107, 110], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99920:If_L98_C0", "vector": [7, 1, 0.9688, 0.0357, 1, 0.34, 0.6, 0, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n items = sys.argv[3] \n except IndexError:\n items = 'suite-test-keyword'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99920:Assign_L108_C8", "label": "items =", "type": "assigned_variable", "loc": [108, 108], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99920:Try_L107_C4", "vector": [14, 2, 0.9643, 0.0089, 2, 0.57, 0.0, 339, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "items", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " items = sys.argv[3] "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99920:Assign_L110_C8", "label": "items =", "type": "assigned_variable", "loc": [110, 110], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99920:Try_L107_C4", "vector": [14, 2, 0.9821, 0.0089, 2, 0.57, 0.0, 339, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "items", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " items = 'suite-test-keyword'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99920:Expr_L111_C4", "label": "process_file()", "type": "expression", "loc": [111, 111], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99920:If_L98_C0", "vector": [8, 1, 0.9911, 0.0089, 1, 0.34, 0.8, 769, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "process_file", "arg_names": [], "import_names": [], "rhs_call_name": "process_file", "annotation": ""}, "snippet": " process_file(inxml, outcsv, items)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99920:Expr_L112_C4", "label": "print()", "type": "expression", "loc": [112, 112], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99920:If_L98_C0", "vector": [8, 1, 1.0, 0.0089, 1, 0.34, 1.0, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(os.path.abspath(outcsv))"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99920:FunctionDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99920:Assign_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99920:FunctionDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99920:Assign_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99920:FunctionDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99920:Assign_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99920:FunctionDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99920:Expr_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99920:FunctionDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99920:Expr_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99920:FunctionDef_L47_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99920:Expr_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99920:FunctionDef_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99920:If_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99920:If_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99920:Expr_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99920:FunctionDef_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99920:If_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99920:If_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99920:For_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99920:For_L59_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99920:Expr_L60_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99920:FunctionDef_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99920:For_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99920:For_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99920:Expr_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99920:FunctionDef_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99920:For_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99920:For_L63_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99920:Expr_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99920:FunctionDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99920:If_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99920:If_L67_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99920:Expr_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99920:FunctionDef_L66_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99920:If_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99920:If_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99920:For_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99920:For_L70_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99920:Expr_L71_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99920:FunctionDef_L73_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99920:If_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99920:If_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99920:Return_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99920:FunctionDef_L73_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99920:If_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99920:If_L76_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99920:Assign_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99920:If_L76_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99920:Assign_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99920:FunctionDef_L73_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99920:Expr_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99920:FunctionDef_L73_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99920:For_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99920:For_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99920:Expr_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99920:FunctionDef_L84_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99920:If_L85_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99920:If_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99920:Assign_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99920:If_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99920:Assign_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99920:FunctionDef_L84_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99920:If_L89_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99920:If_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99920:Assign_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99920:If_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99920:Assign_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99920:FunctionDef_L84_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99920:Expr_L93_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99920:If_L98_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99920:If_L99_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99920:If_L99_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99920:Expr_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99920:If_L99_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99920:Expr_L101_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99920:If_L98_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99920:Assign_L102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99920:If_L98_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99920:Try_L103_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99920:Try_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99920:Assign_L104_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99920:Try_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99920:Assign_L106_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99920:If_L98_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99920:Try_L107_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99920:Try_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99920:Assign_L108_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99920:Try_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99920:Assign_L110_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99920:If_L98_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99920:Expr_L111_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99920:If_L98_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99920:Expr_L112_C4"}] |
#!/usr/bin/env python
# tool2html.py -- Creates HTML version of given tool documentation
#
# First part of this file is Pygments configuration and actual
# documentation generation follows it.
#
# Pygments configuration
#
# This code is from 'external/rst-directive.py' file included in Pygments 0.9
# distribution. For more details see http://pygments.org/docs/rstdirective/
#
"""
The Pygments MoinMoin Parser
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This fragment is a Docutils_ 0.4 directive that renders source code
(to HTML only, currently) via Pygments.
To use it, adjust the options below and copy the code into a module
that you import on initialization. The code then automatically
registers a ``sourcecode`` directive that you can use instead of
normal code blocks like this::
.. sourcecode:: python
My code goes here.
If you want to have different code styles, e.g. one with line numbers
and one without, add formatters with their names in the VARIANTS dict
below. You can invoke them instead of the DEFAULT one by using a
directive option::
.. sourcecode:: python
:linenos:
My code goes here.
Look at the `directive documentation`_ to get all the gory details.
.. _Docutils: http://docutils.sf.net/
.. _directive documentation:
http://docutils.sourceforge.net/docs/howto/rst-directives.html
:copyright: 2007 by Georg Brandl.
:license: BSD, see LICENSE for more details.
"""
# Options
# ~~~~~~~
# Set to True if you want inline CSS styles instead of classes
INLINESTYLES = False
from pygments.formatters import HtmlFormatter
# The default formatter
DEFAULT = HtmlFormatter(noclasses=INLINESTYLES)
# Add name -> formatter pairs for every variant you want to use
VARIANTS = {
# 'linenos': HtmlFormatter(noclasses=INLINESTYLES, linenos=True),
}
import os
from docutils import nodes
from docutils.parsers.rst import directives
from pygments import highlight
from pygments.lexers import get_lexer_by_name, TextLexer
def pygments_directive(name, arguments, options, content, lineno,
content_offset, block_text, state, state_machine):
try:
lexer = get_lexer_by_name(arguments[0])
except ValueError:
# no lexer found - use the text one instead of an exception
lexer = TextLexer()
# take an arbitrary option if more than one is given
formatter = options and VARIANTS[options.keys()[0]] or DEFAULT
filtered = [ line for line in content if line ]
if len(filtered)==1 and os.path.isfile(filtered[0]):
content = open(content[0]).read().splitlines()
parsed = highlight(u'\n'.join(content), lexer, formatter)
return [nodes.raw('', parsed, format='html')]
pygments_directive.arguments = (1, 0, 1)
pygments_directive.content = 1
pygments_directive.options = dict([(key, directives.flag) for key in VARIANTS])
directives.register_directive('sourcecode', pygments_directive)
#
# Creating the documentation
#
# This code is based on rst2html.py distributed with docutils
#
try:
import locale
locale.setlocale(locale.LC_ALL, '')
except:
pass
import sys
from docutils.core import publish_cmdline
def create_tooldoc(tool_name):
description = 'HTML generator for Robot Framework Tool Documentation.'
stylesheet_path = os.path.join(BASEDIR, '..', 'doc', 'userguide', 'src',
'userguide.css')
base_path = os.path.join(BASEDIR, tool_name, 'doc', tool_name)
arguments = [ '--time', '--stylesheet-path=%s' % stylesheet_path,
base_path+'.txt', base_path+'.html' ]
publish_cmdline(writer_name='html', description=description, argv=arguments)
print os.path.abspath(arguments[-1])
BASEDIR = os.path.dirname(os.path.abspath(__file__))
VALID_TOOLS = [ name for name in os.listdir(BASEDIR) if '.' not in name ]
VALID_TOOLS = [ n for n in VALID_TOOLS if os.path.isdir(os.path.join(BASEDIR, n, 'doc')) ]
if __name__ == '__main__':
try:
tool = sys.argv[1].lower()
if tool == 'all':
for name in sorted(VALID_TOOLS):
create_tooldoc(name)
elif tool in VALID_TOOLS:
create_tooldoc(tool)
else:
raise IndexError
except IndexError:
print 'Usage: tool2html.py [ tool | all ]\n\nTools:'
for tool in sorted(VALID_TOOLS):
print ' %s' % tool
| ajibawa-2023/Python-Code-Large/train/row_99921 | 50 | 142 | 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_99921:Expr_L15_C0", "label": "expression", "type": "expression", "loc": [15, 49], "level": 0, "parent": null, "vector": [8, 0, 0.2254, 0.2465, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"\n The Pygments MoinMoin Parser\n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n This fragment is a Docutils_ 0.4 directive that renders source code\n (to HTML only, currently) via Pygments.\n\n To use it, adjust the options below and copy the code into a module"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99921:Assign_L55_C0", "label": "INLINESTYLES =", "type": "assigned_variable", "loc": [55, 55], "level": 0, "parent": null, "vector": [14, 0, 0.3873, 0.007, 0, 0.66, 0.0455, 281, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "INLINESTYLES", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "INLINESTYLES = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99921:ImportFrom_L57_C0", "label": "from pygments.formatters import HtmlFormatter", "type": "import", "loc": [57, 57], "level": 0, "parent": null, "vector": [1, 0, 0.4014, 0.007, 0, 0.66, 0.0909, 443, 0, 1, 0, 0, 443, 0, 0], "semantic": {"name": "pygments.formatters", "arg_names": [], "import_names": ["HtmlFormatter"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pygments.formatters import HtmlFormatter"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99921:Assign_L60_C0", "label": "DEFAULT = HtmlFormatter()", "type": "assigned_variable", "loc": [60, 60], "level": 0, "parent": null, "vector": [14, 0, 0.4225, 0.007, 0, 0.66, 0.1364, 570, 3, 1, 0, 0, 75, 10, 1], "semantic": {"name": "DEFAULT", "arg_names": [], "import_names": [], "rhs_call_name": "HtmlFormatter", "annotation": ""}, "snippet": "DEFAULT = HtmlFormatter(noclasses=INLINESTYLES)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99921:Assign_L63_C0", "label": "VARIANTS =", "type": "assigned_variable", "loc": [63, 65], "level": 0, "parent": null, "vector": [14, 0, 0.4507, 0.0211, 0, 0.66, 0.1818, 186, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "VARIANTS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "VARIANTS = {\n # 'linenos': HtmlFormatter(noclasses=INLINESTYLES, linenos=True),\n}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99921:Import_L67_C0", "label": "os import os", "type": "import", "loc": [67, 67], "level": 0, "parent": null, "vector": [1, 0, 0.4718, 0.007, 0, 0.66, 0.2273, 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_99921:ImportFrom_L69_C0", "label": "from docutils import nodes", "type": "import", "loc": [69, 69], "level": 0, "parent": null, "vector": [1, 0, 0.4859, 0.007, 0, 0.66, 0.2727, 976, 0, 1, 0, 0, 976, 0, 0], "semantic": {"name": "docutils", "arg_names": [], "import_names": ["nodes"], "rhs_call_name": "", "annotation": ""}, "snippet": "from docutils import nodes"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99921:ImportFrom_L70_C0", "label": "from docutils.parsers.rst import directives", "type": "import", "loc": [70, 70], "level": 0, "parent": null, "vector": [1, 0, 0.493, 0.007, 0, 0.66, 0.3182, 299, 0, 1, 0, 0, 299, 0, 0], "semantic": {"name": "docutils.parsers.rst", "arg_names": [], "import_names": ["directives"], "rhs_call_name": "", "annotation": ""}, "snippet": "from docutils.parsers.rst import directives"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99921:ImportFrom_L72_C0", "label": "from pygments import highlight", "type": "import", "loc": [72, 72], "level": 0, "parent": null, "vector": [1, 0, 0.507, 0.007, 0, 0.66, 0.3636, 638, 0, 1, 0, 0, 638, 0, 0], "semantic": {"name": "pygments", "arg_names": [], "import_names": ["highlight"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pygments import highlight"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99921:ImportFrom_L73_C0", "label": "from pygments.lexers import get_lexer_by_name, TextLexer", "type": "import", "loc": [73, 73], "level": 0, "parent": null, "vector": [1, 0, 0.5141, 0.007, 0, 0.66, 0.4091, 18, 0, 2, 0, 0, 18, 0, 0], "semantic": {"name": "pygments.lexers", "arg_names": [], "import_names": ["get_lexer_by_name", "TextLexer"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pygments.lexers import get_lexer_by_name, TextLexer"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99921:FunctionDef_L75_C0", "label": "pygments_directive", "type": "function", "loc": [75, 88], "level": 0, "parent": null, "vector": [2, 0, 0.5739, 0.0986, 0, 0.66, 0.4545, 640, 0, 9, 1, 0, 0, 0, 11], "semantic": {"name": "pygments_directive", "arg_names": ["name", "arguments", "options", "content", "lineno", "content_offset", "block_text", "state", "state_machine"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def pygments_directive(name, arguments, options, content, lineno,\n content_offset, block_text, state, state_machine):\n try:\n lexer = get_lexer_by_name(arguments[0])\n except ValueError:\n # no lexer found - use the text one instead of an exception\n lexer = TextLexer()\n # take an arbitrary option if more than one is given"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99921:Try_L77_C4", "label": "try", "type": "try", "loc": [77, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99921:FunctionDef_L75_C0", "vector": [7, 1, 0.5563, 0.0352, 1, 0.01, 0.0, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n lexer = get_lexer_by_name(arguments[0])\n except ValueError:\n # no lexer found - use the text one instead of an exception\n lexer = TextLexer()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99921:Assign_L78_C8", "label": "lexer = get_lexer_by_name()", "type": "assigned_variable", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99921:Try_L77_C4", "vector": [14, 2, 0.5493, 0.007, 2, 0.64, 0.0, 672, 3, 1, 0, 0, 456, 10, 1], "semantic": {"name": "lexer", "arg_names": [], "import_names": [], "rhs_call_name": "get_lexer_by_name", "annotation": ""}, "snippet": " lexer = get_lexer_by_name(arguments[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99921:Assign_L81_C8", "label": "lexer = TextLexer()", "type": "assigned_variable", "loc": [81, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99921:Try_L77_C4", "vector": [14, 2, 0.5704, 0.007, 2, 0.64, 0.0, 672, 3, 0, 0, 0, 732, 10, 1], "semantic": {"name": "lexer", "arg_names": [], "import_names": [], "rhs_call_name": "TextLexer", "annotation": ""}, "snippet": " lexer = TextLexer()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99921:Assign_L83_C4", "label": "formatter =", "type": "assigned_variable", "loc": [83, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99921:FunctionDef_L75_C0", "vector": [14, 1, 0.5845, 0.007, 1, 0.01, 0.2, 791, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "formatter", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " formatter = options and VARIANTS[options.keys()[0]] or DEFAULT"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99921:Assign_L84_C4", "label": "filtered =", "type": "assigned_variable", "loc": [84, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99921:FunctionDef_L75_C0", "vector": [14, 1, 0.5915, 0.007, 1, 0.01, 0.4, 429, 5, 0, 0, 0, 0, 0, 0], "semantic": {"name": "filtered", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " filtered = [ line for line in content if line ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99921:If_L85_C4", "label": "if", "type": "if", "loc": [85, 86], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99921:FunctionDef_L75_C0", "vector": [4, 1, 0.6021, 0.0141, 1, 0.01, 0.6, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(filtered)==1 and os.path.isfile(filtered[0]):\n content = open(content[0]).read().splitlines()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99921:Assign_L86_C8", "label": "content = splitlines()", "type": "assigned_variable", "loc": [86, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99921:If_L85_C4", "vector": [14, 2, 0.6056, 0.007, 2, 0.0, 0.0, 273, 3, 0, 0, 0, 296, 10, 3], "semantic": {"name": "content", "arg_names": [], "import_names": [], "rhs_call_name": "splitlines", "annotation": ""}, "snippet": " content = open(content[0]).read().splitlines()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99921:Assign_L87_C4", "label": "parsed = highlight()", "type": "assigned_variable", "loc": [87, 87], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99921:FunctionDef_L75_C0", "vector": [14, 1, 0.6127, 0.007, 1, 0.01, 0.8, 313, 3, 3, 0, 0, 449, 10, 2], "semantic": {"name": "parsed", "arg_names": [], "import_names": [], "rhs_call_name": "highlight", "annotation": ""}, "snippet": " parsed = highlight(u'\\n'.join(content), lexer, formatter)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99921:Return_L88_C4", "label": "return", "type": "return", "loc": [88, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99921:FunctionDef_L75_C0", "vector": [13, 1, 0.6197, 0.007, 1, 0.01, 1.0, 0, 0, 0, 0, 0, 0, 5, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [nodes.raw('', parsed, format='html')]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99921:Assign_L90_C0", "label": "pygments_directive.arguments =", "type": "assigned_variable", "loc": [90, 90], "level": 0, "parent": null, "vector": [14, 0, 0.6338, 0.007, 0, 0.66, 0.5, 804, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "pygments_directive.arguments", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "pygments_directive.arguments = (1, 0, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99921:Assign_L91_C0", "label": "pygments_directive.content =", "type": "assigned_variable", "loc": [91, 91], "level": 0, "parent": null, "vector": [14, 0, 0.6408, 0.007, 0, 0.66, 0.5455, 44, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "pygments_directive.content", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "pygments_directive.content = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99921:Assign_L92_C0", "label": "pygments_directive.options = dict()", "type": "assigned_variable", "loc": [92, 92], "level": 0, "parent": null, "vector": [14, 0, 0.6479, 0.007, 0, 0.66, 0.5909, 160, 3, 1, 0, 0, 827, 10, 1], "semantic": {"name": "pygments_directive.options", "arg_names": [], "import_names": [], "rhs_call_name": "dict", "annotation": ""}, "snippet": "pygments_directive.options = dict([(key, directives.flag) for key in VARIANTS])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99921:Expr_L94_C0", "label": "register_directive()", "type": "expression", "loc": [94, 94], "level": 0, "parent": null, "vector": [8, 0, 0.662, 0.007, 0, 0.66, 0.6364, 78, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "register_directive", "arg_names": [], "import_names": [], "rhs_call_name": "register_directive", "annotation": ""}, "snippet": "directives.register_directive('sourcecode', pygments_directive)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99921:Try_L102_C0", "label": "try", "type": "try", "loc": [102, 106], "level": 0, "parent": null, "vector": [7, 0, 0.7324, 0.0352, 0, 0.66, 0.6818, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "try:\n import locale\n locale.setlocale(locale.LC_ALL, '')\nexcept:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99921:Import_L103_C4", "label": "locale import locale", "type": "import", "loc": [103, 103], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99921:Try_L102_C0", "vector": [1, 1, 0.7254, 0.007, 1, 0.05, 0.0, 884, 0, 1, 0, 0, 884, 0, 0], "semantic": {"name": "locale", "arg_names": [], "import_names": ["locale"], "rhs_call_name": "", "annotation": ""}, "snippet": " import locale"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99921:Expr_L104_C4", "label": "setlocale()", "type": "expression", "loc": [104, 104], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99921:Try_L102_C0", "vector": [8, 1, 0.7324, 0.007, 1, 0.05, 1.0, 735, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "setlocale", "arg_names": [], "import_names": [], "rhs_call_name": "setlocale", "annotation": ""}, "snippet": " locale.setlocale(locale.LC_ALL, '')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99921:Import_L108_C0", "label": "sys import sys", "type": "import", "loc": [108, 108], "level": 0, "parent": null, "vector": [1, 0, 0.7606, 0.007, 0, 0.66, 0.7273, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99921:ImportFrom_L109_C0", "label": "from docutils.core import publish_cmdline", "type": "import", "loc": [109, 109], "level": 0, "parent": null, "vector": [1, 0, 0.7676, 0.007, 0, 0.66, 0.7727, 219, 0, 1, 0, 0, 219, 0, 0], "semantic": {"name": "docutils.core", "arg_names": [], "import_names": ["publish_cmdline"], "rhs_call_name": "", "annotation": ""}, "snippet": "from docutils.core import publish_cmdline"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99921:FunctionDef_L112_C0", "label": "create_tooldoc", "type": "function", "loc": [112, 121], "level": 0, "parent": null, "vector": [2, 0, 0.8204, 0.0704, 0, 0.66, 0.8182, 949, 0, 1, 0, 0, 0, 0, 5], "semantic": {"name": "create_tooldoc", "arg_names": ["tool_name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def create_tooldoc(tool_name):\n description = 'HTML generator for Robot Framework Tool Documentation.'\n stylesheet_path = os.path.join(BASEDIR, '..', 'doc', 'userguide', 'src', \n 'userguide.css')\n base_path = os.path.join(BASEDIR, tool_name, 'doc', tool_name)\n arguments = [ '--time', '--stylesheet-path=%s' % stylesheet_path,\n base_path+'.txt', base_path+'.html' ]\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99921:Assign_L113_C4", "label": "description =", "type": "assigned_variable", "loc": [113, 113], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99921:FunctionDef_L112_C0", "vector": [14, 1, 0.7958, 0.007, 1, 0.6, 0.0, 306, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "description", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " description = 'HTML generator for Robot Framework Tool Documentation.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99921:Assign_L114_C4", "label": "stylesheet_path = join()", "type": "assigned_variable", "loc": [114, 115], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99921:FunctionDef_L112_C0", "vector": [14, 1, 0.8063, 0.0141, 1, 0.6, 0.2, 325, 3, 6, 0, 0, 933, 10, 1], "semantic": {"name": "stylesheet_path", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " stylesheet_path = os.path.join(BASEDIR, '..', 'doc', 'userguide', 'src', \n 'userguide.css')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99921:Assign_L116_C4", "label": "base_path = join()", "type": "assigned_variable", "loc": [116, 116], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99921:FunctionDef_L112_C0", "vector": [14, 1, 0.8169, 0.007, 1, 0.6, 0.4, 815, 3, 4, 0, 0, 933, 10, 1], "semantic": {"name": "base_path", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " base_path = os.path.join(BASEDIR, tool_name, 'doc', tool_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99921:Assign_L117_C4", "label": "arguments =", "type": "assigned_variable", "loc": [117, 118], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99921:FunctionDef_L112_C0", "vector": [14, 1, 0.8275, 0.0141, 1, 0.6, 0.6, 426, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "arguments", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " arguments = [ '--time', '--stylesheet-path=%s' % stylesheet_path,\n base_path+'.txt', base_path+'.html' ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99921:Expr_L120_C4", "label": "publish_cmdline()", "type": "expression", "loc": [120, 120], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99921:FunctionDef_L112_C0", "vector": [8, 1, 0.8451, 0.007, 1, 0.6, 0.8, 679, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "publish_cmdline", "arg_names": [], "import_names": [], "rhs_call_name": "publish_cmdline", "annotation": ""}, "snippet": " publish_cmdline(writer_name='html', description=description, argv=arguments)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99921:Expr_L121_C4", "label": "print()", "type": "expression", "loc": [121, 121], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99921:FunctionDef_L112_C0", "vector": [8, 1, 0.8521, 0.007, 1, 0.6, 1.0, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(os.path.abspath(arguments[-1]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99921:Assign_L124_C0", "label": "BASEDIR = dirname()", "type": "assigned_variable", "loc": [124, 124], "level": 0, "parent": null, "vector": [14, 0, 0.8732, 0.007, 0, 0.66, 0.8636, 914, 3, 1, 0, 0, 959, 10, 2], "semantic": {"name": "BASEDIR", "arg_names": [], "import_names": [], "rhs_call_name": "dirname", "annotation": ""}, "snippet": "BASEDIR = os.path.dirname(os.path.abspath(__file__))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99921:Assign_L125_C0", "label": "VALID_TOOLS =", "type": "assigned_variable", "loc": [125, 125], "level": 0, "parent": null, "vector": [14, 0, 0.8803, 0.007, 0, 0.66, 0.9091, 736, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "VALID_TOOLS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "VALID_TOOLS = [ name for name in os.listdir(BASEDIR) if '.' not in name ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99921:Assign_L126_C0", "label": "VALID_TOOLS =", "type": "assigned_variable", "loc": [126, 126], "level": 0, "parent": null, "vector": [14, 0, 0.8873, 0.007, 0, 0.66, 0.9545, 736, 5, 0, 0, 0, 0, 0, 2], "semantic": {"name": "VALID_TOOLS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "VALID_TOOLS = [ n for n in VALID_TOOLS if os.path.isdir(os.path.join(BASEDIR, n, 'doc')) ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99921:If_L129_C0", "label": "if", "type": "if", "loc": [129, 142], "level": 0, "parent": null, "vector": [4, 0, 0.9542, 0.0986, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n try:\n tool = sys.argv[1].lower()\n if tool == 'all':\n for name in sorted(VALID_TOOLS):\n create_tooldoc(name)\n elif tool in VALID_TOOLS:\n create_tooldoc(tool)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99921:Try_L130_C4", "label": "try", "type": "try", "loc": [130, 142], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99921:If_L129_C0", "vector": [7, 1, 0.9577, 0.0915, 1, 0.93, 0.0, 0, 0, 1, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n tool = sys.argv[1].lower()\n if tool == 'all':\n for name in sorted(VALID_TOOLS):\n create_tooldoc(name)\n elif tool in VALID_TOOLS:\n create_tooldoc(tool)\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99921:Assign_L131_C8", "label": "tool = lower()", "type": "assigned_variable", "loc": [131, 131], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99921:Try_L130_C4", "vector": [14, 2, 0.9225, 0.007, 2, 0.29, 0.0, 268, 3, 0, 0, 0, 432, 10, 1], "semantic": {"name": "tool", "arg_names": [], "import_names": [], "rhs_call_name": "lower", "annotation": ""}, "snippet": " tool = sys.argv[1].lower()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99921:If_L132_C8", "label": "if", "type": "if", "loc": [132, 138], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99921:Try_L130_C4", "vector": [4, 2, 0.9507, 0.0493, 2, 0.29, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if tool == 'all':\n for name in sorted(VALID_TOOLS):\n create_tooldoc(name)\n elif tool in VALID_TOOLS:\n create_tooldoc(tool)\n else:\n raise IndexError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99921:For_L133_C12", "label": "for name", "type": "for", "loc": [133, 134], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99921:If_L132_C8", "vector": [6, 3, 0.9401, 0.0141, 3, 0.14, 0.0, 57, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for name in sorted(VALID_TOOLS):\n create_tooldoc(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99921:Expr_L134_C16", "label": "create_tooldoc()", "type": "expression", "loc": [134, 134], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99921:For_L133_C12", "vector": [8, 4, 0.9437, 0.007, 4, 0.08, 0.0, 949, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "create_tooldoc", "arg_names": [], "import_names": [], "rhs_call_name": "create_tooldoc", "annotation": ""}, "snippet": " create_tooldoc(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99921:If_L135_C8", "label": "if", "type": "if", "loc": [135, 138], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99921:If_L132_C8", "vector": [4, 3, 0.9613, 0.0282, 3, 0.14, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif tool in VALID_TOOLS:\n create_tooldoc(tool)\n else:\n raise IndexError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99921:Expr_L136_C12", "label": "create_tooldoc()", "type": "expression", "loc": [136, 136], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99921:If_L135_C8", "vector": [8, 4, 0.9577, 0.007, 4, 0.03, 0.0, 949, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "create_tooldoc", "arg_names": [], "import_names": [], "rhs_call_name": "create_tooldoc", "annotation": ""}, "snippet": " create_tooldoc(tool)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99921:Expr_L140_C8", "label": "print()", "type": "expression", "loc": [140, 140], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99921:Try_L130_C4", "vector": [8, 2, 0.9859, 0.007, 2, 0.29, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Usage: tool2html.py [ tool | all ]\\n\\nTools:')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99921:For_L141_C8", "label": "for tool", "type": "for", "loc": [141, 142], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99921:Try_L130_C4", "vector": [6, 2, 0.9965, 0.0141, 2, 0.29, 1.0, 268, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "tool", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for tool in sorted(VALID_TOOLS):\n print(' %s' % tool)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99921:Expr_L142_C12", "label": "print()", "type": "expression", "loc": [142, 142], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99921:For_L141_C8", "vector": [8, 3, 1.0, 0.007, 3, 0.83, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(' %s' % tool)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99921:FunctionDef_L75_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99921:Try_L77_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99921:Try_L77_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99921:Assign_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99921:Try_L77_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99921:Assign_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99921:FunctionDef_L75_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99921:Assign_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99921:FunctionDef_L75_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99921:Assign_L84_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99921:FunctionDef_L75_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99921:If_L85_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99921:If_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99921:Assign_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99921:FunctionDef_L75_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99921:Assign_L87_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99921:FunctionDef_L75_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99921:Return_L88_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99921:Try_L102_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99921:Import_L103_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99921:Try_L102_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99921:Expr_L104_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99921:FunctionDef_L112_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99921:Assign_L113_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99921:FunctionDef_L112_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99921:Assign_L114_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99921:FunctionDef_L112_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99921:Assign_L116_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99921:FunctionDef_L112_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99921:Assign_L117_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99921:FunctionDef_L112_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99921:Expr_L120_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99921:FunctionDef_L112_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99921:Expr_L121_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99921:If_L129_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99921:Try_L130_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99921:Try_L130_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99921:Assign_L131_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99921:Try_L130_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99921:If_L132_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99921:If_L132_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99921:For_L133_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99921:For_L133_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99921:Expr_L134_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99921:If_L132_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99921:If_L135_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99921:If_L135_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99921:Expr_L136_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99921:Try_L130_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99921:Expr_L140_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99921:Try_L130_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99921:For_L141_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99921:For_L141_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99921:Expr_L142_C12"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import sys
import inspect
import traceback
from StringIO import StringIO
from SimpleXMLRPCServer import SimpleXMLRPCServer
try:
import signal
except ImportError:
signal = None
class RobotRemoteServer(SimpleXMLRPCServer):
allow_reuse_address = True
def __init__(self, library, host='localhost', port=8270, allow_stop=True):
SimpleXMLRPCServer.__init__(self, (host, int(port)), logRequests=False)
self._library = library
self._allow_stop = allow_stop
self._register_functions()
self._register_signal_handlers()
print 'Robot Framework remote server starting at %s:%s' % (host, port)
self.serve_forever()
def _register_functions(self):
self.register_function(self.get_keyword_names)
self.register_function(self.run_keyword)
self.register_function(self.get_keyword_arguments)
self.register_function(self.get_keyword_documentation)
self.register_function(self.stop_remote_server)
def _register_signal_handlers(self):
def stop_with_signal(signum, frame):
self._allow_stop = True
self.stop_remote_server()
if hasattr(signal, 'SIGHUP'):
signal.signal(signal.SIGHUP, stop_with_signal)
if hasattr(signal, 'SIGINT'):
signal.signal(signal.SIGINT, stop_with_signal)
def serve_forever(self):
self._shutdown = False
while not self._shutdown:
self.handle_request()
def stop_remote_server(self):
prefix = 'Robot Framework remote server at %s:%s ' % self.server_address
if self._allow_stop:
print prefix + 'stopping'
self._shutdown = True
else:
print '*WARN* ' + prefix + 'does not allow stopping'
return True
def get_keyword_names(self):
get_kw_names = getattr(self._library, 'get_keyword_names', None) or \
getattr(self._library, 'getKeywordNames', None)
if inspect.isroutine(get_kw_names):
names = get_kw_names()
else:
names = [attr for attr in dir(self._library) if attr[0] != '_'
and inspect.isroutine(getattr(self._library, attr))]
return names + ['stop_remote_server']
def run_keyword(self, name, args):
result = {'status': 'PASS', 'return': '', 'output': '',
'error': '', 'traceback': ''}
self._intercept_stdout()
try:
return_value = self._get_keyword(name)(*args)
except:
result['status'] = 'FAIL'
result['error'], result['traceback'] = self._get_error_details()
else:
result['return'] = self._handle_return_value(return_value)
result['output'] = self._restore_stdout()
return result
def get_keyword_arguments(self, name):
kw = self._get_keyword(name)
args, varargs, _, defaults = inspect.getargspec(kw)
if inspect.ismethod(kw):
args = args[1:] # drop 'self'
if defaults:
args, names = args[:-len(defaults)], args[-len(defaults):]
args += ['%s=%s' % (n, d) for n, d in zip(names, defaults)]
if varargs:
args.append('*%s' % varargs)
return args
def get_keyword_documentation(self, name):
return inspect.getdoc(self._get_keyword(name)) or ''
def _get_keyword(self, name):
if name == 'stop_remote_server':
return self.stop_remote_server
return getattr(self._library, name)
def _get_error_details(self):
exc_type, exc_value, exc_tb = sys.exc_info()
if exc_type in (SystemExit, KeyboardInterrupt):
self._restore_stdout()
raise
return (self._get_error_message(exc_type, exc_value),
self._get_error_traceback(exc_tb))
def _get_error_message(self, exc_type, exc_value):
name = exc_type.__name__
message = str(exc_value)
if not message:
return name
if name in ('AssertionError', 'RuntimeError', 'Exception'):
return message
return '%s: %s' % (name, message)
def _get_error_traceback(self, exc_tb):
# Latest entry originates from this class so it can be removed
entries = traceback.extract_tb(exc_tb)[1:]
trace = ''.join(traceback.format_list(entries))
return 'Traceback (most recent call last):\n' + trace
def _handle_return_value(self, ret):
if isinstance(ret, (basestring, int, long, float)):
return ret
if isinstance(ret, (tuple, list)):
return [ self._handle_return_value(item) for item in ret ]
if isinstance(ret, dict):
return dict([(self._str(key), self._handle_return_value(value))
for key, value in ret.items()])
return self._str(ret)
def _str(self, item):
if item is None:
return ''
return str(item)
def _intercept_stdout(self):
# TODO: What about stderr?
sys.stdout = StringIO()
def _restore_stdout(self):
output = sys.stdout.getvalue()
sys.stdout.close()
sys.stdout = sys.__stdout__
return output
| ajibawa-2023/Python-Code-Large/train/row_99922 | 111 | 158 | 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_99922:Import_L15_C0", "label": "sys import sys", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.0949, 0.0063, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Import_L16_C0", "label": "inspect import inspect", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.1013, 0.0063, 0, 0.66, 0.1667, 878, 0, 1, 0, 0, 878, 0, 0], "semantic": {"name": "inspect", "arg_names": [], "import_names": ["inspect"], "rhs_call_name": "", "annotation": ""}, "snippet": "import inspect"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Import_L17_C0", "label": "traceback import traceback", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.1076, 0.0063, 0, 0.66, 0.3333, 423, 0, 1, 0, 0, 423, 0, 0], "semantic": {"name": "traceback", "arg_names": [], "import_names": ["traceback"], "rhs_call_name": "", "annotation": ""}, "snippet": "import traceback"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:ImportFrom_L18_C0", "label": "from StringIO import StringIO", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.1139, 0.0063, 0, 0.66, 0.5, 609, 0, 1, 0, 0, 609, 0, 0], "semantic": {"name": "StringIO", "arg_names": [], "import_names": ["StringIO"], "rhs_call_name": "", "annotation": ""}, "snippet": "from StringIO import StringIO"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:ImportFrom_L19_C0", "label": "from SimpleXMLRPCServer import SimpleXMLRPCServer", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.1203, 0.0063, 0, 0.66, 0.6667, 73, 0, 1, 0, 0, 73, 0, 0], "semantic": {"name": "SimpleXMLRPCServer", "arg_names": [], "import_names": ["SimpleXMLRPCServer"], "rhs_call_name": "", "annotation": ""}, "snippet": "from SimpleXMLRPCServer import SimpleXMLRPCServer"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Try_L20_C0", "label": "try", "type": "try", "loc": [20, 23], "level": 0, "parent": null, "vector": [7, 0, 0.1361, 0.0253, 0, 0.66, 0.8333, 0, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "try:\n import signal\nexcept ImportError:\n signal = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Import_L21_C4", "label": "signal import signal", "type": "import", "loc": [21, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:Try_L20_C0", "vector": [1, 1, 0.1329, 0.0063, 1, 0.48, 0.0, 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_99922:Assign_L23_C4", "label": "signal =", "type": "assigned_variable", "loc": [23, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:Try_L20_C0", "vector": [14, 1, 0.1456, 0.0063, 1, 0.48, 0.0, 621, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "signal", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " signal = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:ClassDef_L26_C0", "label": "RobotRemoteServer", "type": "class", "loc": [26, 158], "level": 0, "parent": null, "vector": [3, 0, 0.5823, 0.8418, 0, 0.66, 1.0, 537, 0, 18, 0, 0, 73, 0, 63], "semantic": {"name": "RobotRemoteServer", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class RobotRemoteServer(SimpleXMLRPCServer):\n allow_reuse_address = True\n\n def __init__(self, library, host='localhost', port=8270, allow_stop=True):\n SimpleXMLRPCServer.__init__(self, (host, int(port)), logRequests=False)\n self._library = library\n self._allow_stop = allow_stop\n self._register_functions()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Assign_L27_C4", "label": "allow_reuse_address =", "type": "assigned_variable", "loc": [27, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:ClassDef_L26_C0", "vector": [14, 1, 0.1709, 0.0063, 1, 0.95, 0.0, 193, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "allow_reuse_address", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " allow_reuse_address = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L29_C4", "label": "__init__", "type": "function", "loc": [29, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:ClassDef_L26_C0", "vector": [2, 1, 0.2057, 0.0506, 1, 0.95, 0.0588, 555, 0, 5, 0, 0, 0, 0, 6], "semantic": {"name": "__init__", "arg_names": ["self", "library", "host", "port", "allow_stop"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, library, host='localhost', port=8270, allow_stop=True):\n SimpleXMLRPCServer.__init__(self, (host, int(port)), logRequests=False)\n self._library = library\n self._allow_stop = allow_stop\n self._register_functions()\n self._register_signal_handlers()\n print('Robot Framework remote server starting at %s:%s' % (host, port))\n self.serve_forever()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Expr_L30_C8", "label": "__init__()", "type": "expression", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L29_C4", "vector": [8, 2, 0.1899, 0.0063, 2, 0.49, 0.0, 555, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " SimpleXMLRPCServer.__init__(self, (host, int(port)), logRequests=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Assign_L31_C8", "label": "self._library =", "type": "assigned_variable", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L29_C4", "vector": [14, 2, 0.1962, 0.0063, 2, 0.49, 0.1667, 190, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._library", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._library = library"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Assign_L32_C8", "label": "self._allow_stop =", "type": "assigned_variable", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L29_C4", "vector": [14, 2, 0.2025, 0.0063, 2, 0.49, 0.3333, 357, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._allow_stop", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._allow_stop = allow_stop"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Expr_L33_C8", "label": "_register_functions()", "type": "expression", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L29_C4", "vector": [8, 2, 0.2089, 0.0063, 2, 0.49, 0.5, 152, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_register_functions", "arg_names": [], "import_names": [], "rhs_call_name": "_register_functions", "annotation": ""}, "snippet": " self._register_functions()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Expr_L34_C8", "label": "_register_signal_handlers()", "type": "expression", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L29_C4", "vector": [8, 2, 0.2152, 0.0063, 2, 0.49, 0.6667, 360, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_register_signal_handlers", "arg_names": [], "import_names": [], "rhs_call_name": "_register_signal_handlers", "annotation": ""}, "snippet": " self._register_signal_handlers()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Expr_L35_C8", "label": "print()", "type": "expression", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L29_C4", "vector": [8, 2, 0.2215, 0.0063, 2, 0.49, 0.8333, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Robot Framework remote server starting at %s:%s' % (host, port))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Expr_L36_C8", "label": "serve_forever()", "type": "expression", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L29_C4", "vector": [8, 2, 0.2278, 0.0063, 2, 0.49, 1.0, 993, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "serve_forever", "arg_names": [], "import_names": [], "rhs_call_name": "serve_forever", "annotation": ""}, "snippet": " self.serve_forever()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L38_C4", "label": "_register_functions", "type": "function", "loc": [38, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:ClassDef_L26_C0", "vector": [2, 1, 0.2563, 0.038, 1, 0.95, 0.1176, 152, 0, 1, 0, 0, 0, 0, 5], "semantic": {"name": "_register_functions", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _register_functions(self):\n self.register_function(self.get_keyword_names)\n self.register_function(self.run_keyword)\n self.register_function(self.get_keyword_arguments)\n self.register_function(self.get_keyword_documentation)\n self.register_function(self.stop_remote_server)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Expr_L39_C8", "label": "register_function()", "type": "expression", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L38_C4", "vector": [8, 2, 0.2468, 0.0063, 2, 0.86, 0.0, 885, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "register_function", "arg_names": [], "import_names": [], "rhs_call_name": "register_function", "annotation": ""}, "snippet": " self.register_function(self.get_keyword_names)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Expr_L40_C8", "label": "register_function()", "type": "expression", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L38_C4", "vector": [8, 2, 0.2532, 0.0063, 2, 0.86, 0.25, 885, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "register_function", "arg_names": [], "import_names": [], "rhs_call_name": "register_function", "annotation": ""}, "snippet": " self.register_function(self.run_keyword)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Expr_L41_C8", "label": "register_function()", "type": "expression", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L38_C4", "vector": [8, 2, 0.2595, 0.0063, 2, 0.86, 0.5, 885, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "register_function", "arg_names": [], "import_names": [], "rhs_call_name": "register_function", "annotation": ""}, "snippet": " self.register_function(self.get_keyword_arguments)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Expr_L42_C8", "label": "register_function()", "type": "expression", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L38_C4", "vector": [8, 2, 0.2658, 0.0063, 2, 0.86, 0.75, 885, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "register_function", "arg_names": [], "import_names": [], "rhs_call_name": "register_function", "annotation": ""}, "snippet": " self.register_function(self.get_keyword_documentation)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Expr_L43_C8", "label": "register_function()", "type": "expression", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L38_C4", "vector": [8, 2, 0.2722, 0.0063, 2, 0.86, 1.0, 885, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "register_function", "arg_names": [], "import_names": [], "rhs_call_name": "register_function", "annotation": ""}, "snippet": " self.register_function(self.stop_remote_server)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L45_C4", "label": "_register_signal_handlers", "type": "function", "loc": [45, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:ClassDef_L26_C0", "vector": [2, 1, 0.307, 0.0506, 1, 0.95, 0.1765, 360, 0, 1, 0, 0, 0, 0, 5], "semantic": {"name": "_register_signal_handlers", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _register_signal_handlers(self):\n def stop_with_signal(signum, frame):\n self._allow_stop = True\n self.stop_remote_server()\n if hasattr(signal, 'SIGHUP'):\n signal.signal(signal.SIGHUP, stop_with_signal)\n if hasattr(signal, 'SIGINT'):\n signal.signal(signal.SIGINT, stop_with_signal)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L46_C8", "label": "stop_with_signal", "type": "function", "loc": [46, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L45_C4", "vector": [2, 2, 0.2975, 0.019, 2, 0.77, 0.0, 46, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "stop_with_signal", "arg_names": ["signum", "frame"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def stop_with_signal(signum, frame):\n self._allow_stop = True\n self.stop_remote_server()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Assign_L47_C12", "label": "self._allow_stop =", "type": "assigned_variable", "loc": [47, 47], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L46_C8", "vector": [14, 3, 0.2975, 0.0063, 3, 0.0, 0.0, 357, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self._allow_stop", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._allow_stop = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Expr_L48_C12", "label": "stop_remote_server()", "type": "expression", "loc": [48, 48], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L46_C8", "vector": [8, 3, 0.3038, 0.0063, 3, 0.0, 1.0, 109, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop_remote_server", "arg_names": [], "import_names": [], "rhs_call_name": "stop_remote_server", "annotation": ""}, "snippet": " self.stop_remote_server()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:If_L49_C8", "label": "if", "type": "if", "loc": [49, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L45_C4", "vector": [4, 2, 0.3133, 0.0127, 2, 0.77, 0.5, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if hasattr(signal, 'SIGHUP'):\n signal.signal(signal.SIGHUP, stop_with_signal)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Expr_L50_C12", "label": "signal()", "type": "expression", "loc": [50, 50], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:If_L49_C8", "vector": [8, 3, 0.3165, 0.0063, 3, 0.85, 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.SIGHUP, stop_with_signal)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:If_L51_C8", "label": "if", "type": "if", "loc": [51, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L45_C4", "vector": [4, 2, 0.3259, 0.0127, 2, 0.77, 1.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if hasattr(signal, 'SIGINT'):\n signal.signal(signal.SIGINT, stop_with_signal)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Expr_L52_C12", "label": "signal()", "type": "expression", "loc": [52, 52], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:If_L51_C8", "vector": [8, 3, 0.3291, 0.0063, 3, 0.34, 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.SIGINT, stop_with_signal)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L54_C4", "label": "serve_forever", "type": "function", "loc": [54, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:ClassDef_L26_C0", "vector": [2, 1, 0.3513, 0.0253, 1, 0.95, 0.2353, 993, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "serve_forever", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def serve_forever(self):\n self._shutdown = False\n while not self._shutdown:\n self.handle_request()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Assign_L55_C8", "label": "self._shutdown =", "type": "assigned_variable", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L54_C4", "vector": [14, 2, 0.3481, 0.0063, 2, 0.7, 0.0, 695, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self._shutdown", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._shutdown = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:While_L56_C8", "label": "while", "type": "while", "loc": [56, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L54_C4", "vector": [5, 2, 0.3576, 0.0127, 2, 0.7, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not self._shutdown:\n self.handle_request()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Expr_L57_C12", "label": "handle_request()", "type": "expression", "loc": [57, 57], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:While_L56_C8", "vector": [8, 3, 0.3608, 0.0063, 3, 0.8, 0.0, 299, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "handle_request", "arg_names": [], "import_names": [], "rhs_call_name": "handle_request", "annotation": ""}, "snippet": " self.handle_request()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L59_C4", "label": "stop_remote_server", "type": "function", "loc": [59, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:ClassDef_L26_C0", "vector": [2, 1, 0.3956, 0.0506, 1, 0.95, 0.2941, 109, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "stop_remote_server", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def stop_remote_server(self):\n prefix = 'Robot Framework remote server at %s:%s ' % self.server_address\n if self._allow_stop:\n print(prefix + 'stopping')\n self._shutdown = True\n else:\n print('*WARN* ' + prefix + 'does not allow stopping')\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Assign_L60_C8", "label": "prefix =", "type": "assigned_variable", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L59_C4", "vector": [14, 2, 0.3797, 0.0063, 2, 0.88, 0.0, 284, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "prefix", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " prefix = 'Robot Framework remote server at %s:%s ' % self.server_address"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:If_L61_C8", "label": "if", "type": "if", "loc": [61, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L59_C4", "vector": [4, 2, 0.3987, 0.0316, 2, 0.88, 0.5, 0, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._allow_stop:\n print(prefix + 'stopping')\n self._shutdown = True\n else:\n print('*WARN* ' + prefix + 'does not allow stopping')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Expr_L62_C12", "label": "print()", "type": "expression", "loc": [62, 62], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:If_L61_C8", "vector": [8, 3, 0.3924, 0.0063, 3, 0.91, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(prefix + 'stopping')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Assign_L63_C12", "label": "self._shutdown =", "type": "assigned_variable", "loc": [63, 63], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:If_L61_C8", "vector": [14, 3, 0.3987, 0.0063, 3, 0.91, 0.5, 695, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self._shutdown", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._shutdown = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Expr_L65_C12", "label": "print()", "type": "expression", "loc": [65, 65], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:If_L61_C8", "vector": [8, 3, 0.4114, 0.0063, 3, 0.91, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('*WARN* ' + prefix + 'does not allow stopping')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Return_L66_C8", "label": "return", "type": "return", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L59_C4", "vector": [13, 2, 0.4177, 0.0063, 2, 0.88, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L68_C4", "label": "get_keyword_names", "type": "function", "loc": [68, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:ClassDef_L26_C0", "vector": [2, 1, 0.4557, 0.057, 1, 0.95, 0.3529, 768, 0, 1, 1, 0, 0, 0, 7], "semantic": {"name": "get_keyword_names", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_keyword_names(self):\n get_kw_names = getattr(self._library, 'get_keyword_names', None) or \\\n getattr(self._library, 'getKeywordNames', None)\n if inspect.isroutine(get_kw_names):\n names = get_kw_names()\n else:\n names = [attr for attr in dir(self._library) if attr[0] != '_'\n and inspect.isroutine(getattr(self._library, attr))]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Assign_L69_C8", "label": "get_kw_names =", "type": "assigned_variable", "loc": [69, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L68_C4", "vector": [14, 2, 0.4399, 0.0127, 2, 0.94, 0.0, 713, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "get_kw_names", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " get_kw_names = getattr(self._library, 'get_keyword_names', None) or \\\n getattr(self._library, 'getKeywordNames', None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:If_L71_C8", "label": "if", "type": "if", "loc": [71, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L68_C4", "vector": [4, 2, 0.462, 0.0316, 2, 0.94, 0.5, 0, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if inspect.isroutine(get_kw_names):\n names = get_kw_names()\n else:\n names = [attr for attr in dir(self._library) if attr[0] != '_'\n and inspect.isroutine(getattr(self._library, attr))]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Assign_L72_C12", "label": "names = get_kw_names()", "type": "assigned_variable", "loc": [72, 72], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:If_L71_C8", "vector": [14, 3, 0.4557, 0.0063, 3, 0.48, 0.0, 382, 3, 0, 0, 0, 713, 10, 1], "semantic": {"name": "names", "arg_names": [], "import_names": [], "rhs_call_name": "get_kw_names", "annotation": ""}, "snippet": " names = get_kw_names()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Assign_L74_C12", "label": "names =", "type": "assigned_variable", "loc": [74, 75], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:If_L71_C8", "vector": [14, 3, 0.4715, 0.0127, 3, 0.48, 1.0, 382, 5, 0, 0, 0, 0, 0, 3], "semantic": {"name": "names", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " names = [attr for attr in dir(self._library) if attr[0] != '_'\n and inspect.isroutine(getattr(self._library, attr))]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Return_L76_C8", "label": "return", "type": "return", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L68_C4", "vector": [13, 2, 0.481, 0.0063, 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 names + ['stop_remote_server']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L78_C4", "label": "run_keyword", "type": "function", "loc": [78, 90], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:ClassDef_L26_C0", "vector": [2, 1, 0.5316, 0.0823, 1, 0.95, 0.4118, 458, 0, 3, 1, 0, 0, 0, 6], "semantic": {"name": "run_keyword", "arg_names": ["self", "name", "args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def run_keyword(self, name, args):\n result = {'status': 'PASS', 'return': '', 'output': '',\n 'error': '', 'traceback': ''}\n self._intercept_stdout()\n try:\n return_value = self._get_keyword(name)(*args)\n except:\n result['status'] = 'FAIL'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Assign_L79_C8", "label": "result =", "type": "assigned_variable", "loc": [79, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L78_C4", "vector": [14, 2, 0.5032, 0.0127, 2, 0.64, 0.0, 51, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " result = {'status': 'PASS', 'return': '', 'output': '',\n 'error': '', 'traceback': ''}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Expr_L81_C8", "label": "_intercept_stdout()", "type": "expression", "loc": [81, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L78_C4", "vector": [8, 2, 0.5127, 0.0063, 2, 0.64, 0.25, 170, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_intercept_stdout", "arg_names": [], "import_names": [], "rhs_call_name": "_intercept_stdout", "annotation": ""}, "snippet": " self._intercept_stdout()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Try_L82_C8", "label": "try", "type": "try", "loc": [82, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L78_C4", "vector": [7, 2, 0.538, 0.0443, 2, 0.64, 0.5, 0, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n return_value = self._get_keyword(name)(*args)\n except:\n result['status'] = 'FAIL'\n result['error'], result['traceback'] = self._get_error_details()\n else:\n result['return'] = self._handle_return_value(return_value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Assign_L83_C12", "label": "return_value =", "type": "assigned_variable", "loc": [83, 83], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:Try_L82_C8", "vector": [14, 3, 0.5253, 0.0063, 3, 0.69, 0.0, 271, 3, 1, 0, 0, 0, 10, 2], "semantic": {"name": "return_value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return_value = self._get_keyword(name)(*args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Assign_L85_C12", "label": "assign", "type": "assigned_variable", "loc": [85, 85], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:Try_L82_C8", "vector": [14, 3, 0.538, 0.0063, 3, 0.69, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " result['status'] = 'FAIL'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Assign_L86_C12", "label": " = _get_error_details()", "type": "assigned_variable", "loc": [86, 86], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:Try_L82_C8", "vector": [14, 3, 0.5443, 0.0063, 3, 0.69, 1.0, 0, 3, 0, 0, 0, 697, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "_get_error_details", "annotation": ""}, "snippet": " result['error'], result['traceback'] = self._get_error_details()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Assign_L88_C12", "label": " = _handle_return_value()", "type": "assigned_variable", "loc": [88, 88], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:Try_L82_C8", "vector": [14, 3, 0.557, 0.0063, 3, 0.69, 1.0, 0, 3, 1, 0, 0, 826, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "_handle_return_value", "annotation": ""}, "snippet": " result['return'] = self._handle_return_value(return_value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Assign_L89_C8", "label": " = _restore_stdout()", "type": "assigned_variable", "loc": [89, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L78_C4", "vector": [14, 2, 0.5633, 0.0063, 2, 0.64, 0.75, 0, 3, 0, 0, 0, 743, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "_restore_stdout", "annotation": ""}, "snippet": " result['output'] = self._restore_stdout()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Return_L90_C8", "label": "return", "type": "return", "loc": [90, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L78_C4", "vector": [13, 2, 0.5696, 0.0063, 2, 0.64, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return result"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L92_C4", "label": "get_keyword_arguments", "type": "function", "loc": [92, 102], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:ClassDef_L26_C0", "vector": [2, 1, 0.6139, 0.0696, 1, 0.95, 0.4706, 234, 0, 2, 1, 0, 0, 0, 7], "semantic": {"name": "get_keyword_arguments", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_keyword_arguments(self, name):\n kw = self._get_keyword(name)\n args, varargs, _, defaults = inspect.getargspec(kw)\n if inspect.ismethod(kw):\n args = args[1:] # drop 'self'\n if defaults:\n args, names = args[:-len(defaults)], args[-len(defaults):]\n args += ['%s=%s' % (n, d) for n, d in zip(names, defaults)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Assign_L93_C8", "label": "kw = _get_keyword()", "type": "assigned_variable", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L92_C4", "vector": [14, 2, 0.5886, 0.0063, 2, 0.26, 0.0, 755, 3, 1, 0, 0, 279, 10, 1], "semantic": {"name": "kw", "arg_names": [], "import_names": [], "rhs_call_name": "_get_keyword", "annotation": ""}, "snippet": " kw = self._get_keyword(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Assign_L94_C8", "label": "args, varargs, _, defaults = getargspec()", "type": "assigned_variable", "loc": [94, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L92_C4", "vector": [14, 2, 0.5949, 0.0063, 2, 0.26, 0.2, 353, 3, 1, 0, 0, 179, 10, 1], "semantic": {"name": "args, varargs, _, defaults", "arg_names": [], "import_names": [], "rhs_call_name": "getargspec", "annotation": ""}, "snippet": " args, varargs, _, defaults = inspect.getargspec(kw)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:If_L95_C8", "label": "if", "type": "if", "loc": [95, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L92_C4", "vector": [4, 2, 0.6044, 0.0127, 2, 0.26, 0.4, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if inspect.ismethod(kw):\n args = args[1:] # drop 'self'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Assign_L96_C12", "label": "args =", "type": "assigned_variable", "loc": [96, 96], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:If_L95_C8", "vector": [14, 3, 0.6076, 0.0063, 3, 0.43, 0.0, 805, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "args", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " args = args[1:] # drop 'self'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:If_L97_C8", "label": "if", "type": "if", "loc": [97, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L92_C4", "vector": [4, 2, 0.6203, 0.019, 2, 0.26, 0.6, 0, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if defaults:\n args, names = args[:-len(defaults)], args[-len(defaults):]\n args += ['%s=%s' % (n, d) for n, d in zip(names, defaults)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Assign_L98_C12", "label": "args, names =", "type": "assigned_variable", "loc": [98, 98], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:If_L97_C8", "vector": [14, 3, 0.6203, 0.0063, 3, 0.44, 0.0, 930, 0, 0, 0, 0, 0, 8, 2], "semantic": {"name": "args, names", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " args, names = args[:-len(defaults)], args[-len(defaults):]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:If_L100_C8", "label": "if", "type": "if", "loc": [100, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L92_C4", "vector": [4, 2, 0.6361, 0.0127, 2, 0.26, 0.8, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if varargs:\n args.append('*%s' % varargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Expr_L101_C12", "label": "append()", "type": "expression", "loc": [101, 101], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:If_L100_C8", "vector": [8, 3, 0.6392, 0.0063, 3, 0.93, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " args.append('*%s' % varargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Return_L102_C8", "label": "return", "type": "return", "loc": [102, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L92_C4", "vector": [13, 2, 0.6456, 0.0063, 2, 0.26, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return args"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L104_C4", "label": "get_keyword_documentation", "type": "function", "loc": [104, 105], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:ClassDef_L26_C0", "vector": [2, 1, 0.6614, 0.0127, 1, 0.95, 0.5294, 886, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "get_keyword_documentation", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_keyword_documentation(self, name):\n return inspect.getdoc(self._get_keyword(name)) or ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Return_L105_C8", "label": "return", "type": "return", "loc": [105, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L104_C4", "vector": [13, 2, 0.6646, 0.0063, 2, 0.58, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return inspect.getdoc(self._get_keyword(name)) or ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L107_C4", "label": "_get_keyword", "type": "function", "loc": [107, 110], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:ClassDef_L26_C0", "vector": [2, 1, 0.6867, 0.0253, 1, 0.95, 0.5882, 279, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "_get_keyword", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_keyword(self, name):\n if name == 'stop_remote_server':\n return self.stop_remote_server\n return getattr(self._library, name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:If_L108_C8", "label": "if", "type": "if", "loc": [108, 109], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L107_C4", "vector": [4, 2, 0.6867, 0.0127, 2, 0.54, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if name == 'stop_remote_server':\n return self.stop_remote_server"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Return_L109_C12", "label": "return", "type": "return", "loc": [109, 109], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:If_L108_C8", "vector": [13, 3, 0.6899, 0.0063, 3, 0.53, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.stop_remote_server"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Return_L110_C8", "label": "return", "type": "return", "loc": [110, 110], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L107_C4", "vector": [13, 2, 0.6962, 0.0063, 2, 0.54, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return getattr(self._library, name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L112_C4", "label": "_get_error_details", "type": "function", "loc": [112, 118], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:ClassDef_L26_C0", "vector": [2, 1, 0.7278, 0.0443, 1, 0.95, 0.6471, 697, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "_get_error_details", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_error_details(self):\n exc_type, exc_value, exc_tb = sys.exc_info()\n if exc_type in (SystemExit, KeyboardInterrupt):\n self._restore_stdout()\n raise\n return (self._get_error_message(exc_type, exc_value),\n self._get_error_traceback(exc_tb))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Assign_L113_C8", "label": "exc_type, exc_value, exc_tb = exc_info()", "type": "assigned_variable", "loc": [113, 113], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L112_C4", "vector": [14, 2, 0.7152, 0.0063, 2, 0.29, 0.0, 723, 3, 0, 0, 0, 289, 10, 1], "semantic": {"name": "exc_type, exc_value, exc_tb", "arg_names": [], "import_names": [], "rhs_call_name": "exc_info", "annotation": ""}, "snippet": " exc_type, exc_value, exc_tb = sys.exc_info()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:If_L114_C8", "label": "if", "type": "if", "loc": [114, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L112_C4", "vector": [4, 2, 0.7278, 0.019, 2, 0.29, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if exc_type in (SystemExit, KeyboardInterrupt):\n self._restore_stdout()\n raise"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Expr_L115_C12", "label": "_restore_stdout()", "type": "expression", "loc": [115, 115], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:If_L114_C8", "vector": [8, 3, 0.7278, 0.0063, 3, 0.98, 0.0, 743, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_restore_stdout", "arg_names": [], "import_names": [], "rhs_call_name": "_restore_stdout", "annotation": ""}, "snippet": " self._restore_stdout()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Return_L117_C8", "label": "return", "type": "return", "loc": [117, 118], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L112_C4", "vector": [13, 2, 0.7437, 0.0127, 2, 0.29, 1.0, 0, 0, 0, 0, 0, 0, 8, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return (self._get_error_message(exc_type, exc_value),\n self._get_error_traceback(exc_tb))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L120_C4", "label": "_get_error_message", "type": "function", "loc": [120, 127], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:ClassDef_L26_C0", "vector": [2, 1, 0.7816, 0.0506, 1, 0.95, 0.7059, 978, 0, 3, 1, 0, 0, 0, 1], "semantic": {"name": "_get_error_message", "arg_names": ["self", "exc_type", "exc_value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_error_message(self, exc_type, exc_value):\n name = exc_type.__name__\n message = str(exc_value)\n if not message:\n return name\n if name in ('AssertionError', 'RuntimeError', 'Exception'):\n return message\n return '%s: %s' % (name, message)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Assign_L121_C8", "label": "name =", "type": "assigned_variable", "loc": [121, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L120_C4", "vector": [14, 2, 0.7658, 0.0063, 2, 0.54, 0.0, 57, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " name = exc_type.__name__"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Assign_L122_C8", "label": "message = str()", "type": "assigned_variable", "loc": [122, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L120_C4", "vector": [14, 2, 0.7722, 0.0063, 2, 0.54, 0.25, 635, 3, 1, 0, 0, 52, 10, 1], "semantic": {"name": "message", "arg_names": [], "import_names": [], "rhs_call_name": "str", "annotation": ""}, "snippet": " message = str(exc_value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:If_L123_C8", "label": "if", "type": "if", "loc": [123, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L120_C4", "vector": [4, 2, 0.7816, 0.0127, 2, 0.54, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not message:\n return name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Return_L124_C12", "label": "return", "type": "return", "loc": [124, 124], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:If_L123_C8", "vector": [13, 3, 0.7848, 0.0063, 3, 0.13, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:If_L125_C8", "label": "if", "type": "if", "loc": [125, 126], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L120_C4", "vector": [4, 2, 0.7943, 0.0127, 2, 0.54, 0.75, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if name in ('AssertionError', 'RuntimeError', 'Exception'):\n return message"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Return_L126_C12", "label": "return", "type": "return", "loc": [126, 126], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:If_L125_C8", "vector": [13, 3, 0.7975, 0.0063, 3, 0.18, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return message"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Return_L127_C8", "label": "return", "type": "return", "loc": [127, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L120_C4", "vector": [13, 2, 0.8038, 0.0063, 2, 0.54, 1.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '%s: %s' % (name, message)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L129_C4", "label": "_get_error_traceback", "type": "function", "loc": [129, 133], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:ClassDef_L26_C0", "vector": [2, 1, 0.8291, 0.0316, 1, 0.95, 0.7647, 565, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "_get_error_traceback", "arg_names": ["self", "exc_tb"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_error_traceback(self, exc_tb):\n # Latest entry originates from this class so it can be removed\n entries = traceback.extract_tb(exc_tb)[1:]\n trace = ''.join(traceback.format_list(entries))\n return 'Traceback (most recent call last):\\n' + trace"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Assign_L131_C8", "label": "entries =", "type": "assigned_variable", "loc": [131, 131], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L129_C4", "vector": [14, 2, 0.8291, 0.0063, 2, 0.69, 0.0, 764, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "entries", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " entries = traceback.extract_tb(exc_tb)[1:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Assign_L132_C8", "label": "trace = join()", "type": "assigned_variable", "loc": [132, 132], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L129_C4", "vector": [14, 2, 0.8354, 0.0063, 2, 0.69, 0.5, 211, 3, 1, 0, 0, 933, 10, 2], "semantic": {"name": "trace", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " trace = ''.join(traceback.format_list(entries))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Return_L133_C8", "label": "return", "type": "return", "loc": [133, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L129_C4", "vector": [13, 2, 0.8418, 0.0063, 2, 0.69, 1.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'Traceback (most recent call last):\\n' + trace"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L135_C4", "label": "_handle_return_value", "type": "function", "loc": [135, 143], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:ClassDef_L26_C0", "vector": [2, 1, 0.8797, 0.057, 1, 0.95, 0.8235, 826, 0, 2, 1, 0, 0, 0, 9], "semantic": {"name": "_handle_return_value", "arg_names": ["self", "ret"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _handle_return_value(self, ret):\n if isinstance(ret, (basestring, int, long, float)):\n return ret\n if isinstance(ret, (tuple, list)):\n return [ self._handle_return_value(item) for item in ret ]\n if isinstance(ret, dict):\n return dict([(self._str(key), self._handle_return_value(value))\n for key, value in ret.items()])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:If_L136_C8", "label": "if", "type": "if", "loc": [136, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L135_C4", "vector": [4, 2, 0.8639, 0.0127, 2, 0.23, 0.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(ret, (basestring, int, long, float)):\n return ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Return_L137_C12", "label": "return", "type": "return", "loc": [137, 137], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:If_L136_C8", "vector": [13, 3, 0.8671, 0.0063, 3, 0.13, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ret"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:If_L138_C8", "label": "if", "type": "if", "loc": [138, 139], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L135_C4", "vector": [4, 2, 0.8766, 0.0127, 2, 0.23, 0.3333, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(ret, (tuple, list)):\n return [ self._handle_return_value(item) for item in ret ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Return_L139_C12", "label": "return", "type": "return", "loc": [139, 139], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:If_L138_C8", "vector": [13, 3, 0.8797, 0.0063, 3, 0.42, 0.0, 0, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [ self._handle_return_value(item) for item in ret ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:If_L140_C8", "label": "if", "type": "if", "loc": [140, 142], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L135_C4", "vector": [4, 2, 0.8924, 0.019, 2, 0.23, 0.6667, 0, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if isinstance(ret, dict):\n return dict([(self._str(key), self._handle_return_value(value))\n for key, value in ret.items()])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Return_L141_C12", "label": "return", "type": "return", "loc": [141, 142], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:If_L140_C8", "vector": [13, 3, 0.8956, 0.0127, 3, 0.23, 0.0, 0, 3, 0, 0, 0, 0, 10, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return dict([(self._str(key), self._handle_return_value(value))\n for key, value in ret.items()])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Return_L143_C8", "label": "return", "type": "return", "loc": [143, 143], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L135_C4", "vector": [13, 2, 0.9051, 0.0063, 2, 0.23, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._str(ret)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L145_C4", "label": "_str", "type": "function", "loc": [145, 148], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:ClassDef_L26_C0", "vector": [2, 1, 0.9272, 0.0253, 1, 0.95, 0.8824, 828, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "_str", "arg_names": ["self", "item"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _str(self, item):\n if item is None:\n return ''\n return str(item)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:If_L146_C8", "label": "if", "type": "if", "loc": [146, 147], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L145_C4", "vector": [4, 2, 0.9272, 0.0127, 2, 0.46, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if item is None:\n return ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Return_L147_C12", "label": "return", "type": "return", "loc": [147, 147], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:If_L146_C8", "vector": [13, 3, 0.9304, 0.0063, 3, 0.9, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Return_L148_C8", "label": "return", "type": "return", "loc": [148, 148], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L145_C4", "vector": [13, 2, 0.9367, 0.0063, 2, 0.46, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return str(item)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L150_C4", "label": "_intercept_stdout", "type": "function", "loc": [150, 152], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:ClassDef_L26_C0", "vector": [2, 1, 0.9557, 0.019, 1, 0.95, 0.9412, 170, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_intercept_stdout", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _intercept_stdout(self):\n # TODO: What about stderr?\n sys.stdout = StringIO()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Assign_L152_C8", "label": "sys.stdout = StringIO()", "type": "assigned_variable", "loc": [152, 152], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L150_C4", "vector": [14, 2, 0.962, 0.0063, 2, 0.88, 0.0, 260, 3, 0, 0, 0, 609, 10, 1], "semantic": {"name": "sys.stdout", "arg_names": [], "import_names": [], "rhs_call_name": "StringIO", "annotation": ""}, "snippet": " sys.stdout = StringIO()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L154_C4", "label": "_restore_stdout", "type": "function", "loc": [154, 158], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:ClassDef_L26_C0", "vector": [2, 1, 0.9873, 0.0316, 1, 0.95, 1.0, 743, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "_restore_stdout", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _restore_stdout(self):\n output = sys.stdout.getvalue()\n sys.stdout.close()\n sys.stdout = sys.__stdout__\n return output"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Assign_L155_C8", "label": "output = getvalue()", "type": "assigned_variable", "loc": [155, 155], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L154_C4", "vector": [14, 2, 0.981, 0.0063, 2, 0.88, 0.0, 886, 3, 0, 0, 0, 626, 10, 1], "semantic": {"name": "output", "arg_names": [], "import_names": [], "rhs_call_name": "getvalue", "annotation": ""}, "snippet": " output = sys.stdout.getvalue()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Expr_L156_C8", "label": "close()", "type": "expression", "loc": [156, 156], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L154_C4", "vector": [8, 2, 0.9873, 0.0063, 2, 0.88, 0.3333, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " sys.stdout.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Assign_L157_C8", "label": "sys.stdout =", "type": "assigned_variable", "loc": [157, 157], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L154_C4", "vector": [14, 2, 0.9937, 0.0063, 2, 0.88, 0.6667, 260, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "sys.stdout", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sys.stdout = sys.__stdout__"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99922:Return_L158_C8", "label": "return", "type": "return", "loc": [158, 158], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L154_C4", "vector": [13, 2, 1.0, 0.0063, 2, 0.88, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return output"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99922:Try_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:Import_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:Try_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:Assign_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:Assign_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:Expr_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:Assign_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:Assign_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:Expr_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:Expr_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:Expr_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:Expr_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:Expr_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:Expr_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:Expr_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:Expr_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:Expr_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L46_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:Assign_L47_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L46_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:Expr_L48_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:If_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:If_L49_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:Expr_L50_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:If_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:If_L51_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:Expr_L52_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:Assign_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:While_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:While_L56_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:Expr_L57_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:Assign_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:If_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:If_L61_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:Expr_L62_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:If_L61_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:Assign_L63_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:If_L61_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:Expr_L65_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:Return_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:Assign_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:If_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:If_L71_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:Assign_L72_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:If_L71_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:Assign_L74_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:Return_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:Assign_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:Expr_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:Try_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:Try_L82_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:Assign_L83_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:Try_L82_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:Assign_L85_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:Try_L82_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:Assign_L86_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:Try_L82_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:Assign_L88_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:Assign_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L78_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:Return_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L92_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:Assign_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:Assign_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:If_L95_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:If_L95_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:Assign_L96_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:If_L97_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:If_L97_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:Assign_L98_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:If_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:If_L100_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:Expr_L101_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L92_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:Return_L102_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L104_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:Return_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L107_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:If_L108_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:If_L108_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:Return_L109_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:Return_L110_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L112_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L112_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:Assign_L113_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L112_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:If_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:If_L114_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:Expr_L115_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L112_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:Return_L117_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L120_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:Assign_L121_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:Assign_L122_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:If_L123_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:If_L123_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:Return_L124_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:If_L125_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:If_L125_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:Return_L126_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:Return_L127_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L129_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:Assign_L131_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:Assign_L132_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:Return_L133_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L135_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L135_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:If_L136_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:If_L136_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:Return_L137_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L135_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:If_L138_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:If_L138_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:Return_L139_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L135_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:If_L140_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:If_L140_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:Return_L141_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L135_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:Return_L143_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L145_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L145_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:If_L146_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:If_L146_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:Return_L147_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L145_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:Return_L148_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L150_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L150_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:Assign_L152_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:ClassDef_L26_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L154_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L154_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:Assign_L155_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L154_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:Expr_L156_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L154_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:Assign_L157_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99922:FunctionDef_L154_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99922:Return_L158_C8"}] |
#!/usr/bin/env python
import os
import sys
class ExampleRemoteLibrary:
def count_items_in_directory(self, path):
return len(i for i in os.listdir(path) if not i.startswith('.'))
def strings_should_be_equal(self, str1, str2):
print "Comparing '%s' to '%s'" % (str1, str2)
if str1 != str2:
raise AssertionError("Given strings are not equal")
if __name__ == '__main__':
from robotremoteserver import RobotRemoteServer
RobotRemoteServer(ExampleRemoteLibrary(), *sys.argv[1:])
| ajibawa-2023/Python-Code-Large/train/row_99923 | 11 | 20 | 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_99923:Import_L3_C0", "label": "os import os", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.15, 0.05, 0, 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_99923:Import_L4_C0", "label": "sys import sys", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.2, 0.05, 0, 0.66, 0.3333, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99923:ClassDef_L7_C0", "label": "ExampleRemoteLibrary", "type": "class", "loc": [7, 15], "level": 0, "parent": null, "vector": [3, 0, 0.55, 0.45, 0, 0.66, 0.6667, 357, 0, 2, 0, 0, 0, 0, 5], "semantic": {"name": "ExampleRemoteLibrary", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ExampleRemoteLibrary:\n\n def count_items_in_directory(self, path):\n return len(i for i in os.listdir(path) if not i.startswith('.'))\n\n def strings_should_be_equal(self, str1, str2):\n print(\"Comparing '%s' to '%s'\" % (str1, str2))\n if str1 != str2:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99923:FunctionDef_L9_C4", "label": "count_items_in_directory", "type": "function", "loc": [9, 10], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99923:ClassDef_L7_C0", "vector": [2, 1, 0.475, 0.1, 1, 0.01, 0.0, 617, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "count_items_in_directory", "arg_names": ["self", "path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def count_items_in_directory(self, path):\n return len(i for i in os.listdir(path) if not i.startswith('.'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99923:Return_L10_C8", "label": "return", "type": "return", "loc": [10, 10], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99923:FunctionDef_L9_C4", "vector": [13, 2, 0.5, 0.05, 2, 0.9, 0.0, 0, 3, 0, 0, 0, 0, 10, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return len(i for i in os.listdir(path) if not i.startswith('.'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99923:FunctionDef_L12_C4", "label": "strings_should_be_equal", "type": "function", "loc": [12, 15], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99923:ClassDef_L7_C0", "vector": [2, 1, 0.675, 0.2, 1, 0.01, 1.0, 479, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "strings_should_be_equal", "arg_names": ["self", "str1", "str2"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def strings_should_be_equal(self, str1, str2):\n print(\"Comparing '%s' to '%s'\" % (str1, str2))\n if str1 != str2:\n raise AssertionError(\"Given strings are not equal\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99923:Expr_L13_C8", "label": "print()", "type": "expression", "loc": [13, 13], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99923:FunctionDef_L12_C4", "vector": [8, 2, 0.65, 0.05, 2, 0.23, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Comparing '%s' to '%s'\" % (str1, str2))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99923:If_L14_C8", "label": "if", "type": "if", "loc": [14, 15], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99923:FunctionDef_L12_C4", "vector": [4, 2, 0.725, 0.1, 2, 0.23, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if str1 != str2:\n raise AssertionError(\"Given strings are not equal\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99923:If_L18_C0", "label": "if", "type": "if", "loc": [18, 20], "level": 0, "parent": null, "vector": [4, 0, 0.95, 0.15, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n from robotremoteserver import RobotRemoteServer\n RobotRemoteServer(ExampleRemoteLibrary(), *sys.argv[1:])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99923:ImportFrom_L19_C4", "label": "from robotremoteserver import RobotRemoteServer", "type": "import", "loc": [19, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99923:If_L18_C0", "vector": [1, 1, 0.95, 0.05, 1, 0.28, 0.0, 759, 0, 1, 0, 0, 759, 0, 0], "semantic": {"name": "robotremoteserver", "arg_names": [], "import_names": ["RobotRemoteServer"], "rhs_call_name": "", "annotation": ""}, "snippet": " from robotremoteserver import RobotRemoteServer"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99923:Expr_L20_C4", "label": "RobotRemoteServer()", "type": "expression", "loc": [20, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99923:If_L18_C0", "vector": [8, 1, 1.0, 0.05, 1, 0.28, 1.0, 537, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "RobotRemoteServer", "arg_names": [], "import_names": [], "rhs_call_name": "RobotRemoteServer", "annotation": ""}, "snippet": " RobotRemoteServer(ExampleRemoteLibrary(), *sys.argv[1:])"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99923:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99923:FunctionDef_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99923:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99923:Return_L10_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99923:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99923:FunctionDef_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99923:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99923:Expr_L13_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99923:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99923:If_L14_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99923:If_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99923:ImportFrom_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99923:If_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99923:Expr_L20_C4"}] |
import sys
from SimpleXMLRPCServer import SimpleXMLRPCServer
class SimpleLibrary(SimpleXMLRPCServer):
def __init__(self, port=8270):
SimpleXMLRPCServer.__init__(self, ('localhost', int(port)))
self.register_function(self.get_keyword_names)
self.register_function(self.run_keyword)
self.register_function(self.stop_remote_server)
self.serve_forever()
def serve_forever(self):
self._shutdown = False
while not self._shutdown:
self.handle_request()
def stop_remote_server(self):
self._shutdown = True
return True
def get_keyword_names(self):
return ['kw_1', 'kw_2', 'stop_remote_server']
def run_keyword(self, name, args):
if name == 'kw_1':
return {'status': 'PASS', 'return': ' '.join(args)}
elif name == 'kw_2':
return {'status': 'FAIL', 'error': ' '.join(args)}
else:
self.stop_remote_server()
return {'status': 'PASS'}
if __name__ == '__main__':
SimpleLibrary(*sys.argv[1:])
| ajibawa-2023/Python-Code-Large/train/row_99924 | 27 | 37 | 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_99924:Import_L1_C0", "label": "sys import sys", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.027, 0.027, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99924:ImportFrom_L2_C0", "label": "from SimpleXMLRPCServer import SimpleXMLRPCServer", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0541, 0.027, 0, 0.66, 0.3333, 73, 0, 1, 0, 0, 73, 0, 0], "semantic": {"name": "SimpleXMLRPCServer", "arg_names": [], "import_names": ["SimpleXMLRPCServer"], "rhs_call_name": "", "annotation": ""}, "snippet": "from SimpleXMLRPCServer import SimpleXMLRPCServer"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99924:ClassDef_L5_C0", "label": "SimpleLibrary", "type": "class", "loc": [5, 33], "level": 0, "parent": null, "vector": [3, 0, 0.5135, 0.7838, 0, 0.66, 0.6667, 652, 0, 5, 0, 0, 73, 0, 10], "semantic": {"name": "SimpleLibrary", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class SimpleLibrary(SimpleXMLRPCServer):\n\n def __init__(self, port=8270):\n SimpleXMLRPCServer.__init__(self, ('localhost', int(port)))\n self.register_function(self.get_keyword_names)\n self.register_function(self.run_keyword)\n self.register_function(self.stop_remote_server)\n self.serve_forever()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99924:FunctionDef_L7_C4", "label": "__init__", "type": "function", "loc": [7, 12], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99924:ClassDef_L5_C0", "vector": [2, 1, 0.2568, 0.1622, 1, 0.47, 0.0, 555, 0, 2, 0, 0, 0, 0, 6], "semantic": {"name": "__init__", "arg_names": ["self", "port"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, port=8270):\n SimpleXMLRPCServer.__init__(self, ('localhost', int(port)))\n self.register_function(self.get_keyword_names)\n self.register_function(self.run_keyword)\n self.register_function(self.stop_remote_server)\n self.serve_forever()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99924:Expr_L8_C8", "label": "__init__()", "type": "expression", "loc": [8, 8], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99924:FunctionDef_L7_C4", "vector": [8, 2, 0.2162, 0.027, 2, 0.85, 0.0, 555, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " SimpleXMLRPCServer.__init__(self, ('localhost', int(port)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99924:Expr_L9_C8", "label": "register_function()", "type": "expression", "loc": [9, 9], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99924:FunctionDef_L7_C4", "vector": [8, 2, 0.2432, 0.027, 2, 0.85, 0.25, 885, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "register_function", "arg_names": [], "import_names": [], "rhs_call_name": "register_function", "annotation": ""}, "snippet": " self.register_function(self.get_keyword_names)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99924:Expr_L10_C8", "label": "register_function()", "type": "expression", "loc": [10, 10], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99924:FunctionDef_L7_C4", "vector": [8, 2, 0.2703, 0.027, 2, 0.85, 0.5, 885, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "register_function", "arg_names": [], "import_names": [], "rhs_call_name": "register_function", "annotation": ""}, "snippet": " self.register_function(self.run_keyword)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99924:Expr_L11_C8", "label": "register_function()", "type": "expression", "loc": [11, 11], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99924:FunctionDef_L7_C4", "vector": [8, 2, 0.2973, 0.027, 2, 0.85, 0.75, 885, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "register_function", "arg_names": [], "import_names": [], "rhs_call_name": "register_function", "annotation": ""}, "snippet": " self.register_function(self.stop_remote_server)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99924:Expr_L12_C8", "label": "serve_forever()", "type": "expression", "loc": [12, 12], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99924:FunctionDef_L7_C4", "vector": [8, 2, 0.3243, 0.027, 2, 0.85, 1.0, 993, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "serve_forever", "arg_names": [], "import_names": [], "rhs_call_name": "serve_forever", "annotation": ""}, "snippet": " self.serve_forever()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99924:FunctionDef_L14_C4", "label": "serve_forever", "type": "function", "loc": [14, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99924:ClassDef_L5_C0", "vector": [2, 1, 0.4189, 0.1081, 1, 0.47, 0.25, 993, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "serve_forever", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def serve_forever(self):\n self._shutdown = False\n while not self._shutdown:\n self.handle_request()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99924:Assign_L15_C8", "label": "self._shutdown =", "type": "assigned_variable", "loc": [15, 15], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99924:FunctionDef_L14_C4", "vector": [14, 2, 0.4054, 0.027, 2, 0.35, 0.0, 695, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self._shutdown", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._shutdown = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99924:While_L16_C8", "label": "while", "type": "while", "loc": [16, 17], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99924:FunctionDef_L14_C4", "vector": [5, 2, 0.4459, 0.0541, 2, 0.35, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while not self._shutdown:\n self.handle_request()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99924:Expr_L17_C12", "label": "handle_request()", "type": "expression", "loc": [17, 17], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99924:While_L16_C8", "vector": [8, 3, 0.4595, 0.027, 3, 0.13, 0.0, 299, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "handle_request", "arg_names": [], "import_names": [], "rhs_call_name": "handle_request", "annotation": ""}, "snippet": " self.handle_request()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99924:FunctionDef_L19_C4", "label": "stop_remote_server", "type": "function", "loc": [19, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99924:ClassDef_L5_C0", "vector": [2, 1, 0.5405, 0.0811, 1, 0.47, 0.5, 109, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "stop_remote_server", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def stop_remote_server(self):\n self._shutdown = True\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99924:Assign_L20_C8", "label": "self._shutdown =", "type": "assigned_variable", "loc": [20, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99924:FunctionDef_L19_C4", "vector": [14, 2, 0.5405, 0.027, 2, 0.59, 0.0, 695, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self._shutdown", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._shutdown = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99924:Return_L21_C8", "label": "return", "type": "return", "loc": [21, 21], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99924:FunctionDef_L19_C4", "vector": [13, 2, 0.5676, 0.027, 2, 0.59, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99924:FunctionDef_L23_C4", "label": "get_keyword_names", "type": "function", "loc": [23, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99924:ClassDef_L5_C0", "vector": [2, 1, 0.6351, 0.0541, 1, 0.47, 0.75, 768, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "get_keyword_names", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_keyword_names(self):\n return ['kw_1', 'kw_2', 'stop_remote_server']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99924:Return_L24_C8", "label": "return", "type": "return", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99924:FunctionDef_L23_C4", "vector": [13, 2, 0.6486, 0.027, 2, 0.7, 0.0, 0, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ['kw_1', 'kw_2', 'stop_remote_server']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99924:FunctionDef_L26_C4", "label": "run_keyword", "type": "function", "loc": [26, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99924:ClassDef_L5_C0", "vector": [2, 1, 0.7973, 0.2162, 1, 0.47, 1.0, 458, 0, 3, 1, 0, 0, 0, 3], "semantic": {"name": "run_keyword", "arg_names": ["self", "name", "args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def run_keyword(self, name, args):\n if name == 'kw_1':\n return {'status': 'PASS', 'return': ' '.join(args)}\n elif name == 'kw_2':\n return {'status': 'FAIL', 'error': ' '.join(args)}\n else:\n self.stop_remote_server()\n return {'status': 'PASS'}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99924:If_L27_C8", "label": "if", "type": "if", "loc": [27, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99924:FunctionDef_L26_C4", "vector": [4, 2, 0.8108, 0.1892, 2, 0.0, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if name == 'kw_1':\n return {'status': 'PASS', 'return': ' '.join(args)}\n elif name == 'kw_2':\n return {'status': 'FAIL', 'error': ' '.join(args)}\n else:\n self.stop_remote_server()\n return {'status': 'PASS'}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99924:Return_L28_C12", "label": "return", "type": "return", "loc": [28, 28], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99924:If_L27_C8", "vector": [13, 3, 0.7568, 0.027, 3, 0.11, 0.0, 0, 0, 0, 0, 0, 0, 6, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return {'status': 'PASS', 'return': ' '.join(args)}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99924:If_L29_C8", "label": "if", "type": "if", "loc": [29, 33], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99924:If_L27_C8", "vector": [4, 3, 0.8378, 0.1351, 3, 0.11, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif name == 'kw_2':\n return {'status': 'FAIL', 'error': ' '.join(args)}\n else:\n self.stop_remote_server()\n return {'status': 'PASS'}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99924:Return_L30_C12", "label": "return", "type": "return", "loc": [30, 30], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99924:If_L29_C8", "vector": [13, 4, 0.8108, 0.027, 4, 0.64, 0.0, 0, 0, 0, 0, 0, 0, 6, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return {'status': 'FAIL', 'error': ' '.join(args)}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99924:Expr_L32_C12", "label": "stop_remote_server()", "type": "expression", "loc": [32, 32], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99924:If_L29_C8", "vector": [8, 4, 0.8649, 0.027, 4, 0.64, 0.5, 109, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop_remote_server", "arg_names": [], "import_names": [], "rhs_call_name": "stop_remote_server", "annotation": ""}, "snippet": " self.stop_remote_server()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99924:Return_L33_C12", "label": "return", "type": "return", "loc": [33, 33], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99924:If_L29_C8", "vector": [13, 4, 0.8919, 0.027, 4, 0.64, 1.0, 0, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return {'status': 'PASS'}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99924:If_L36_C0", "label": "if", "type": "if", "loc": [36, 37], "level": 0, "parent": null, "vector": [4, 0, 0.9865, 0.0541, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n SimpleLibrary(*sys.argv[1:])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99924:Expr_L37_C4", "label": "SimpleLibrary()", "type": "expression", "loc": [37, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99924:If_L36_C0", "vector": [8, 1, 1.0, 0.027, 1, 0.59, 0.0, 652, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "SimpleLibrary", "arg_names": [], "import_names": [], "rhs_call_name": "SimpleLibrary", "annotation": ""}, "snippet": " SimpleLibrary(*sys.argv[1:])"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99924:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99924:FunctionDef_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99924:FunctionDef_L7_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99924:Expr_L8_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99924:FunctionDef_L7_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99924:Expr_L9_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99924:FunctionDef_L7_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99924:Expr_L10_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99924:FunctionDef_L7_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99924:Expr_L11_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99924:FunctionDef_L7_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99924:Expr_L12_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99924:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99924:FunctionDef_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99924:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99924:Assign_L15_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99924:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99924:While_L16_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99924:While_L16_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99924:Expr_L17_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99924:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99924:FunctionDef_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99924:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99924:Assign_L20_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99924:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99924:Return_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99924:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99924:FunctionDef_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99924:FunctionDef_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99924:Return_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99924:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99924:FunctionDef_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99924:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99924:If_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99924:If_L27_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99924:Return_L28_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99924:If_L27_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99924:If_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99924:If_L29_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99924:Return_L30_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99924:If_L29_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99924:Expr_L32_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99924:If_L29_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99924:Return_L33_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99924:If_L36_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99924:Expr_L37_C4"}] |
# Can be used in the test data like ${MyObject()} or ${MyObject(1)}
class MyObject:
def __init__(self, index=''):
self.index = index
def __str__(self):
return '<MyObject%s>' % self.index
UNICODE = (u'Hyv\u00E4\u00E4 y\u00F6t\u00E4. '
u'\u0421\u043F\u0430\u0441\u0438\u0431\u043E!')
LIST_WITH_OBJECTS = [MyObject(1), MyObject(2)]
NESTED_LIST = [ [True, False], [[1, None, MyObject(), {}]] ]
NESTED_TUPLE = ( (True, False), [(1, None, MyObject(), {})] )
DICT_WITH_OBJECTS = {'As value': MyObject(1), MyObject(2): 'As key'}
NESTED_DICT = { 1: {None: False},
2: {'A': {'n': None},
'B': {'o': MyObject(), 'e': {}}} }
| ajibawa-2023/Python-Code-Large/train/row_99925 | 11 | 16 | 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_99925:ClassDef_L2_C0", "label": "MyObject", "type": "class", "loc": [2, 6], "level": 0, "parent": null, "vector": [3, 0, 0.25, 0.3125, 0, 0.66, 0.0, 605, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "MyObject", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class MyObject:\n def __init__(self, index=''):\n self.index = index\n def __str__(self):\n return '<MyObject%s>' % self.index"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99925:FunctionDef_L3_C4", "label": "__init__", "type": "function", "loc": [3, 4], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99925:ClassDef_L2_C0", "vector": [2, 1, 0.2188, 0.125, 1, 0.21, 0.0, 555, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "index"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, index=''):\n self.index = index"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99925:Assign_L4_C8", "label": "self.index =", "type": "assigned_variable", "loc": [4, 4], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99925:FunctionDef_L3_C4", "vector": [14, 2, 0.25, 0.0625, 2, 0.53, 0.0, 777, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.index", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.index = index"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99925:FunctionDef_L5_C4", "label": "__str__", "type": "function", "loc": [5, 6], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99925:ClassDef_L2_C0", "vector": [2, 1, 0.3438, 0.125, 1, 0.21, 1.0, 527, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "__str__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __str__(self):\n return '<MyObject%s>' % self.index"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99925:Return_L6_C8", "label": "return", "type": "return", "loc": [6, 6], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99925:FunctionDef_L5_C4", "vector": [13, 2, 0.375, 0.0625, 2, 0.27, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '<MyObject%s>' % self.index"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99925:Assign_L8_C0", "label": "UNICODE =", "type": "assigned_variable", "loc": [8, 9], "level": 0, "parent": null, "vector": [14, 0, 0.5312, 0.125, 0, 0.66, 0.1667, 207, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "UNICODE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "UNICODE = (u'Hyv\\u00E4\\u00E4 y\\u00F6t\\u00E4. '\n u'\\u0421\\u043F\\u0430\\u0441\\u0438\\u0431\\u043E!')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99925:Assign_L10_C0", "label": "LIST_WITH_OBJECTS =", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.625, 0.0625, 0, 0.66, 0.3333, 570, 0, 0, 0, 0, 0, 5, 2], "semantic": {"name": "LIST_WITH_OBJECTS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "LIST_WITH_OBJECTS = [MyObject(1), MyObject(2)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99925:Assign_L11_C0", "label": "NESTED_LIST =", "type": "assigned_variable", "loc": [11, 11], "level": 0, "parent": null, "vector": [14, 0, 0.6875, 0.0625, 0, 0.66, 0.5, 960, 0, 0, 0, 0, 0, 5, 1], "semantic": {"name": "NESTED_LIST", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "NESTED_LIST = [ [True, False], [[1, None, MyObject(), {}]] ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99925:Assign_L12_C0", "label": "NESTED_TUPLE =", "type": "assigned_variable", "loc": [12, 12], "level": 0, "parent": null, "vector": [14, 0, 0.75, 0.0625, 0, 0.66, 0.6667, 902, 0, 0, 0, 0, 0, 8, 1], "semantic": {"name": "NESTED_TUPLE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "NESTED_TUPLE = ( (True, False), [(1, None, MyObject(), {})] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99925:Assign_L13_C0", "label": "DICT_WITH_OBJECTS =", "type": "assigned_variable", "loc": [13, 13], "level": 0, "parent": null, "vector": [14, 0, 0.8125, 0.0625, 0, 0.66, 0.8333, 826, 0, 0, 0, 0, 0, 6, 2], "semantic": {"name": "DICT_WITH_OBJECTS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DICT_WITH_OBJECTS = {'As value': MyObject(1), MyObject(2): 'As key'}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99925:Assign_L14_C0", "label": "NESTED_DICT =", "type": "assigned_variable", "loc": [14, 16], "level": 0, "parent": null, "vector": [14, 0, 0.9375, 0.1875, 0, 0.66, 1.0, 228, 0, 0, 0, 0, 0, 6, 1], "semantic": {"name": "NESTED_DICT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "NESTED_DICT = { 1: {None: False},\n 2: {'A': {'n': None},\n 'B': {'o': MyObject(), 'e': {}}} }"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99925:ClassDef_L2_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99925:FunctionDef_L3_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99925:FunctionDef_L3_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99925:Assign_L4_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99925:ClassDef_L2_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99925:FunctionDef_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99925:FunctionDef_L5_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99925:Return_L6_C8"}] |
import sys
class RemoteTestLibrary:
_unicode = (u'Hyv\u00E4\u00E4 y\u00F6t\u00E4. '
u'\u0421\u043F\u0430\u0441\u0438\u0431\u043E!')
def get_server_language(self):
lang = sys.platform.startswith('java') and 'jython' or 'python'
return '%s%d%d' % (lang, sys.version_info[0], sys.version_info[1])
# Basic communication (and documenting keywords)
def passing(self):
"""This keyword passes.
See `Failing`, `Logging`, and `Returning` for other basic keywords.
"""
pass
def failing(self, message):
"""This keyword fails with provided `message`"""
raise AssertionError(message)
def logging(self, message, level='INFO'):
"""This keywords logs given `message` with given `level`
Example:
| Logging | Hello, world! | |
| Logging | Warning!!! | WARN |
"""
print '*%s* %s' % (level, message)
def returning(self):
"""This keyword returns a string 'returned string'."""
return 'returned string'
# Logging
def one_message_without_level(self):
print 'Hello, world!'
def multiple_messages_with_different_levels(self):
print 'Info message'
print '*DEBUG* Debug message'
print '*INFO* Second info'
print 'this time with two lines'
print '*INFO* Third info'
print '*TRACE* This is ignored'
print '*WARN* Warning'
def log_unicode(self):
print self._unicode
def logging_and_failing(self):
print '*INFO* This keyword will fail!'
print '*WARN* Run for your lives!!'
raise AssertionError('Too slow')
def logging_and_returning(self):
print 'Logged message'
return 'Returned value'
def log_control_char(self):
print '\x01'
# Failures
def base_exception(self):
raise Exception('My message')
def exception_without_message(self):
raise Exception
def assertion_error(self):
raise AssertionError('Failure message')
def runtime_error(self):
raise RuntimeError('Error message')
def name_error(self):
non_existing
def attribute_error(self):
self.non_existing
def index_error(self):
[][0]
def zero_division(self):
1/0
def custom_exception(self):
raise MyException('My message')
def failure_deeper(self, rounds=10):
if rounds == 1:
raise RuntimeError('Finally failing')
self.failure_deeper(rounds-1)
# Arguments counts
def no_arguments(self):
return 'no arguments'
def one_argument(self, arg):
return arg
def two_arguments(self, arg1, arg2):
return '%s %s' % (arg1, arg2)
def seven_arguments(self, arg1, arg2, arg3, arg4, arg5, arg6, arg7):
return ' '.join((arg1, arg2, arg3, arg4, arg5, arg6, arg7))
def arguments_with_default_values(self, arg1, arg2='2', arg3=3):
return '%s %s %s' % (arg1, arg2, arg3)
def variable_number_of_arguments(self, *args):
return ' '.join(args)
def required_defaults_and_varargs(self, req, default='world', *varargs):
return ' '.join((req, default) + varargs)
# Argument types
def string_as_argument(self, arg):
self._should_be_equal(arg, self.return_string())
def unicode_string_as_argument(self, arg):
self._should_be_equal(arg, self._unicode)
def empty_string_as_argument(self, arg):
self._should_be_equal(arg, '')
def integer_as_argument(self, arg):
self._should_be_equal(arg, self.return_integer())
def negative_integer_as_argument(self, arg):
self._should_be_equal(arg, self.return_negative_integer())
def float_as_argument(self, arg):
self._should_be_equal(arg, self.return_float())
def negative_float_as_argument(self, arg):
self._should_be_equal(arg, self.return_negative_float())
def zero_as_argument(self, arg):
self._should_be_equal(arg, 0)
def boolean_true_as_argument(self, arg):
self._should_be_equal(arg, True)
def boolean_false_as_argument(self, arg):
self._should_be_equal(arg, False)
def none_as_argument(self, arg):
self._should_be_equal(arg, '')
def object_as_argument(self, arg):
self._should_be_equal(arg, '<MyObject>')
def list_as_argument(self, arg):
self._should_be_equal(arg, self.return_list())
def empty_list_as_argument(self, arg):
self._should_be_equal(arg, [])
def list_containing_none_as_argument(self, arg):
self._should_be_equal(arg, [''])
def list_containing_objects_as_argument(self, arg):
self._should_be_equal(arg, ['<MyObject1>', '<MyObject2>'])
def nested_list_as_argument(self, arg):
exp = [ [True, False], [[1, '', '<MyObject>', {}]] ]
self._should_be_equal(arg, exp)
def dictionary_as_argument(self, arg):
self._should_be_equal(arg, self.return_dictionary())
def empty_dictionary_as_argument(self, arg):
self._should_be_equal(arg, {})
def dictionary_with_non_string_keys_as_argument(self, arg):
self._should_be_equal(arg, {'1': 2, '': True})
def dictionary_containing_none_as_argument(self, arg):
self._should_be_equal(arg, {'As value': '', '': 'As key'})
def dictionary_containing_objects_as_argument(self, arg):
self._should_be_equal(arg, {'As value': '<MyObject1>', '<MyObject2>': 'As key'})
def nested_dictionary_as_argument(self, arg):
exp = { '1': {'': False},
'2': {'A': {'n': ''}, 'B': {'o': '<MyObject>', 'e': {}}} }
self._should_be_equal(arg, exp)
def _should_be_equal(self, arg, exp):
if arg != exp:
raise AssertionError('%r != %r' % (arg, exp))
# Return values
def return_string(self):
return 'Hello, world!'
def return_unicode_string(self):
return self._unicode
def return_empty_string(self):
return ''
def return_integer(self):
return 42
def return_negative_integer(self):
return -1
def return_float(self):
return 3.14
def return_negative_float(self):
return -0.5
def return_zero(self):
return 0
def return_boolean_true(self):
return True
def return_boolean_false(self):
return False
def return_nothing(self):
pass
def return_object(self):
return MyObject()
def return_list(self):
return ['One', -2, False]
def return_empty_list(self):
return []
def return_list_containing_none(self):
return [None]
def return_list_containing_objects(self):
return [MyObject(1), MyObject(2)]
def return_nested_list(self):
return [ [True, False], [[1, None, MyObject(), {}]] ]
def return_tuple(self):
return (1, 'two', True)
def return_empty_tuple(self):
return ()
def return_nested_tuple(self):
return ( (True, False), [(1, None, MyObject(), {})] )
def return_dictionary(self):
return {'one': 1, 'spam': 'eggs'}
def return_empty_dictionary(self):
return {}
def return_dictionary_with_non_string_keys(self):
return {1: 2, None: True}
def return_dictionary_containing_none(self):
return {'As value': None, None: 'As key'}
def return_dictionary_containing_objects(self):
return {'As value': MyObject(1), MyObject(2): 'As key'}
def return_nested_dictionary(self):
return { 1: {None: False},
2: {'A': {'n': None}, 'B': {'o': MyObject(), 'e': {}}} }
def return_control_char(self):
return '\x01'
# Not keywords
def _private_method(self):
pass
def __private_method(self):
pass
attribute = 'Not a keyword'
class MyObject:
def __init__(self, index=''):
self.index = index
def __str__(self):
return '<MyObject%s>' % self.index
class MyException(Exception):
pass
if __name__ == '__main__':
import sys
from robotremoteserver import RobotRemoteServer
RobotRemoteServer(RemoteTestLibrary(), *sys.argv[1:])
| ajibawa-2023/Python-Code-Large/train/row_99927 | 182 | 312 | 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_99927:Import_L1_C0", "label": "sys import sys", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0032, 0.0032, 0, 0.66, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "label": "RemoteTestLibrary", "type": "class", "loc": [4, 295], "level": 0, "parent": null, "vector": [3, 0, 0.4792, 0.9359, 0, 0.66, 0.25, 637, 0, 81, 0, 0, 0, 0, 65], "semantic": {"name": "RemoteTestLibrary", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class RemoteTestLibrary:\n\n _unicode = (u'Hyv\\u00E4\\u00E4 y\\u00F6t\\u00E4. '\n u'\\u0421\\u043F\\u0430\\u0441\\u0438\\u0431\\u043E!')\n\n def get_server_language(self):\n lang = sys.platform.startswith('java') and 'jython' or 'python'\n return '%s%d%d' % (lang, sys.version_info[0], sys.version_info[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Assign_L6_C4", "label": "_unicode =", "type": "assigned_variable", "loc": [6, 7], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [14, 1, 0.0208, 0.0064, 1, 0.1, 0.0, 825, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "_unicode", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _unicode = (u'Hyv\\u00E4\\u00E4 y\\u00F6t\\u00E4. '\n u'\\u0421\\u043F\\u0430\\u0441\\u0438\\u0431\\u043E!')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L9_C4", "label": "get_server_language", "type": "function", "loc": [9, 11], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.0321, 0.0096, 1, 0.1, 0.0122, 713, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "get_server_language", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_server_language(self):\n lang = sys.platform.startswith('java') and 'jython' or 'python'\n return '%s%d%d' % (lang, sys.version_info[0], sys.version_info[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Assign_L10_C8", "label": "lang =", "type": "assigned_variable", "loc": [10, 10], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L9_C4", "vector": [14, 2, 0.0321, 0.0032, 2, 0.82, 0.0, 312, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "lang", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " lang = sys.platform.startswith('java') and 'jython' or 'python'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L11_C8", "label": "return", "type": "return", "loc": [11, 11], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L9_C4", "vector": [13, 2, 0.0353, 0.0032, 2, 0.82, 1.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '%s%d%d' % (lang, sys.version_info[0], sys.version_info[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L15_C4", "label": "passing", "type": "function", "loc": [15, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.0561, 0.0192, 1, 0.1, 0.0244, 50, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "passing", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def passing(self):\n \"\"\"This keyword passes.\n\n See `Failing`, `Logging`, and `Returning` for other basic keywords.\n \"\"\"\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L16_C8", "label": "expression", "type": "expression", "loc": [16, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L15_C4", "vector": [8, 2, 0.0561, 0.0128, 2, 0.18, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"This keyword passes.\n\n See `Failing`, `Logging`, and `Returning` for other basic keywords.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L22_C4", "label": "failing", "type": "function", "loc": [22, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.0737, 0.0096, 1, 0.1, 0.0366, 615, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "failing", "arg_names": ["self", "message"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def failing(self, message):\n \"\"\"This keyword fails with provided `message`\"\"\"\n raise AssertionError(message)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L23_C8", "label": "expression", "type": "expression", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L22_C4", "vector": [8, 2, 0.0737, 0.0032, 2, 0.51, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"This keyword fails with provided `message`\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L26_C4", "label": "logging", "type": "function", "loc": [26, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.0946, 0.0256, 1, 0.1, 0.0488, 715, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "logging", "arg_names": ["self", "message", "level"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def logging(self, message, level='INFO'):\n \"\"\"This keywords logs given `message` with given `level`\n\n Example:\n | Logging | Hello, world! | |\n | Logging | Warning!!! | WARN |\n \"\"\"\n print('*%s* %s' % (level, message))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L27_C8", "label": "expression", "type": "expression", "loc": [27, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L26_C4", "vector": [8, 2, 0.0946, 0.0192, 2, 0.9, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"This keywords logs given `message` with given `level`\n\n Example:\n | Logging | Hello, world! | |\n | Logging | Warning!!! | WARN |\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L33_C8", "label": "print()", "type": "expression", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L26_C4", "vector": [8, 2, 0.1058, 0.0032, 2, 0.9, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('*%s* %s' % (level, message))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L35_C4", "label": "returning", "type": "function", "loc": [35, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.1154, 0.0096, 1, 0.1, 0.061, 544, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "returning", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def returning(self):\n \"\"\"This keyword returns a string 'returned string'.\"\"\"\n return 'returned string'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L36_C8", "label": "expression", "type": "expression", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L35_C4", "vector": [8, 2, 0.1154, 0.0032, 2, 0.88, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"This keyword returns a string 'returned string'.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L37_C8", "label": "return", "type": "return", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L35_C4", "vector": [13, 2, 0.1186, 0.0032, 2, 0.88, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'returned string'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L41_C4", "label": "one_message_without_level", "type": "function", "loc": [41, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.133, 0.0064, 1, 0.1, 0.0732, 519, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "one_message_without_level", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def one_message_without_level(self):\n print('Hello, world!')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L42_C8", "label": "print()", "type": "expression", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L41_C4", "vector": [8, 2, 0.1346, 0.0032, 2, 0.68, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Hello, world!')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L44_C4", "label": "multiple_messages_with_different_levels", "type": "function", "loc": [44, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.1522, 0.0256, 1, 0.1, 0.0854, 297, 0, 1, 0, 0, 0, 0, 7], "semantic": {"name": "multiple_messages_with_different_levels", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def multiple_messages_with_different_levels(self):\n print('Info message')\n print('*DEBUG* Debug message')\n print('*INFO* Second info')\n print('this time with two lines')\n print('*INFO* Third info')\n print('*TRACE* This is ignored')\n print('*WARN* Warning')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L45_C8", "label": "print()", "type": "expression", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L44_C4", "vector": [8, 2, 0.1442, 0.0032, 2, 0.26, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Info message')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L46_C8", "label": "print()", "type": "expression", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L44_C4", "vector": [8, 2, 0.1474, 0.0032, 2, 0.26, 0.1667, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('*DEBUG* Debug message')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L47_C8", "label": "print()", "type": "expression", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L44_C4", "vector": [8, 2, 0.1506, 0.0032, 2, 0.26, 0.3333, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('*INFO* Second info')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L48_C8", "label": "print()", "type": "expression", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L44_C4", "vector": [8, 2, 0.1538, 0.0032, 2, 0.26, 0.5, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('this time with two lines')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L49_C8", "label": "print()", "type": "expression", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L44_C4", "vector": [8, 2, 0.1571, 0.0032, 2, 0.26, 0.6667, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('*INFO* Third info')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L50_C8", "label": "print()", "type": "expression", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L44_C4", "vector": [8, 2, 0.1603, 0.0032, 2, 0.26, 0.8333, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('*TRACE* This is ignored')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L51_C8", "label": "print()", "type": "expression", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L44_C4", "vector": [8, 2, 0.1635, 0.0032, 2, 0.26, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('*WARN* Warning')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L53_C4", "label": "log_unicode", "type": "function", "loc": [53, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.1715, 0.0064, 1, 0.1, 0.0976, 360, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "log_unicode", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def log_unicode(self):\n print(self._unicode)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L54_C8", "label": "print()", "type": "expression", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L53_C4", "vector": [8, 2, 0.1731, 0.0032, 2, 0.08, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(self._unicode)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L56_C4", "label": "logging_and_failing", "type": "function", "loc": [56, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.1843, 0.0128, 1, 0.1, 0.1098, 214, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "logging_and_failing", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def logging_and_failing(self):\n print('*INFO* This keyword will fail!')\n print('*WARN* Run for your lives!!')\n raise AssertionError('Too slow')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L57_C8", "label": "print()", "type": "expression", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L56_C4", "vector": [8, 2, 0.1827, 0.0032, 2, 0.84, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('*INFO* This keyword will fail!')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L58_C8", "label": "print()", "type": "expression", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L56_C4", "vector": [8, 2, 0.1859, 0.0032, 2, 0.84, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('*WARN* Run for your lives!!')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L61_C4", "label": "logging_and_returning", "type": "function", "loc": [61, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.1987, 0.0096, 1, 0.1, 0.122, 945, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "logging_and_returning", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def logging_and_returning(self):\n print('Logged message')\n return 'Returned value'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L62_C8", "label": "print()", "type": "expression", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L61_C4", "vector": [8, 2, 0.1987, 0.0032, 2, 0.78, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Logged message')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L63_C8", "label": "return", "type": "return", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L61_C4", "vector": [13, 2, 0.2019, 0.0032, 2, 0.78, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'Returned value'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L65_C4", "label": "log_control_char", "type": "function", "loc": [65, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.2099, 0.0064, 1, 0.1, 0.1341, 460, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "log_control_char", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def log_control_char(self):\n print('\\x01')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L66_C8", "label": "print()", "type": "expression", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L65_C4", "vector": [8, 2, 0.2115, 0.0032, 2, 0.06, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('\\x01')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L70_C4", "label": "base_exception", "type": "function", "loc": [70, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.226, 0.0064, 1, 0.1, 0.1463, 433, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "base_exception", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def base_exception(self):\n raise Exception('My message')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L73_C4", "label": "exception_without_message", "type": "function", "loc": [73, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.2356, 0.0064, 1, 0.1, 0.1585, 482, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "exception_without_message", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def exception_without_message(self):\n raise Exception"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L76_C4", "label": "assertion_error", "type": "function", "loc": [76, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.2452, 0.0064, 1, 0.1, 0.1707, 957, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "assertion_error", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def assertion_error(self):\n raise AssertionError('Failure message')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L79_C4", "label": "runtime_error", "type": "function", "loc": [79, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.2548, 0.0064, 1, 0.1, 0.1829, 958, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "runtime_error", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def runtime_error(self):\n raise RuntimeError('Error message')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L82_C4", "label": "name_error", "type": "function", "loc": [82, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.2644, 0.0064, 1, 0.1, 0.1951, 752, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "name_error", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def name_error(self):\n non_existing"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L83_C8", "label": "expression", "type": "expression", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L82_C4", "vector": [8, 2, 0.266, 0.0032, 2, 0.59, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " non_existing"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L85_C4", "label": "attribute_error", "type": "function", "loc": [85, 86], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.274, 0.0064, 1, 0.1, 0.2073, 262, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "attribute_error", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def attribute_error(self):\n self.non_existing"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L86_C8", "label": "expression", "type": "expression", "loc": [86, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L85_C4", "vector": [8, 2, 0.2756, 0.0032, 2, 0.04, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.non_existing"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L88_C4", "label": "index_error", "type": "function", "loc": [88, 89], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.2837, 0.0064, 1, 0.1, 0.2195, 312, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "index_error", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def index_error(self):\n [][0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L89_C8", "label": "expression", "type": "expression", "loc": [89, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L88_C4", "vector": [8, 2, 0.2853, 0.0032, 2, 0.01, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " [][0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L91_C4", "label": "zero_division", "type": "function", "loc": [91, 92], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.2933, 0.0064, 1, 0.1, 0.2317, 654, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "zero_division", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def zero_division(self):\n 1/0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L92_C8", "label": "expression", "type": "expression", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L91_C4", "vector": [8, 2, 0.2949, 0.0032, 2, 0.41, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " 1/0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L94_C4", "label": "custom_exception", "type": "function", "loc": [94, 95], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.3029, 0.0064, 1, 0.1, 0.2439, 944, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "custom_exception", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def custom_exception(self):\n raise MyException('My message')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L97_C4", "label": "failure_deeper", "type": "function", "loc": [97, 100], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.3157, 0.0128, 1, 0.1, 0.2561, 812, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "failure_deeper", "arg_names": ["self", "rounds"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def failure_deeper(self, rounds=10):\n if rounds == 1:\n raise RuntimeError('Finally failing')\n self.failure_deeper(rounds-1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:If_L98_C8", "label": "if", "type": "if", "loc": [98, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L97_C4", "vector": [4, 2, 0.3157, 0.0064, 2, 0.97, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if rounds == 1:\n raise RuntimeError('Finally failing')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L100_C8", "label": "failure_deeper()", "type": "expression", "loc": [100, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L97_C4", "vector": [8, 2, 0.3205, 0.0032, 2, 0.97, 1.0, 812, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "failure_deeper", "arg_names": [], "import_names": [], "rhs_call_name": "failure_deeper", "annotation": ""}, "snippet": " self.failure_deeper(rounds-1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L104_C4", "label": "no_arguments", "type": "function", "loc": [104, 105], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.3349, 0.0064, 1, 0.1, 0.2683, 187, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "no_arguments", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def no_arguments(self):\n return 'no arguments'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L105_C8", "label": "return", "type": "return", "loc": [105, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L104_C4", "vector": [13, 2, 0.3365, 0.0032, 2, 0.13, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'no arguments'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L107_C4", "label": "one_argument", "type": "function", "loc": [107, 108], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.3446, 0.0064, 1, 0.1, 0.2805, 935, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "one_argument", "arg_names": ["self", "arg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def one_argument(self, arg):\n return arg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L108_C8", "label": "return", "type": "return", "loc": [108, 108], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L107_C4", "vector": [13, 2, 0.3462, 0.0032, 2, 0.44, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return arg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L110_C4", "label": "two_arguments", "type": "function", "loc": [110, 111], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.3542, 0.0064, 1, 0.1, 0.2927, 925, 0, 3, 1, 0, 0, 0, 0], "semantic": {"name": "two_arguments", "arg_names": ["self", "arg1", "arg2"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def two_arguments(self, arg1, arg2):\n return '%s %s' % (arg1, arg2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L111_C8", "label": "return", "type": "return", "loc": [111, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L110_C4", "vector": [13, 2, 0.3558, 0.0032, 2, 0.88, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '%s %s' % (arg1, arg2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L113_C4", "label": "seven_arguments", "type": "function", "loc": [113, 114], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.3638, 0.0064, 1, 0.1, 0.3049, 804, 0, 8, 1, 0, 0, 0, 1], "semantic": {"name": "seven_arguments", "arg_names": ["self", "arg1", "arg2", "arg3", "arg4", "arg5", "arg6", "arg7"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def seven_arguments(self, arg1, arg2, arg3, arg4, arg5, arg6, arg7):\n return ' '.join((arg1, arg2, arg3, arg4, arg5, arg6, arg7))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L114_C8", "label": "return", "type": "return", "loc": [114, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L113_C4", "vector": [13, 2, 0.3654, 0.0032, 2, 0.85, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ' '.join((arg1, arg2, arg3, arg4, arg5, arg6, arg7))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L116_C4", "label": "arguments_with_default_values", "type": "function", "loc": [116, 117], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.3734, 0.0064, 1, 0.1, 0.3171, 146, 0, 4, 1, 0, 0, 0, 0], "semantic": {"name": "arguments_with_default_values", "arg_names": ["self", "arg1", "arg2", "arg3"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def arguments_with_default_values(self, arg1, arg2='2', arg3=3):\n return '%s %s %s' % (arg1, arg2, arg3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L117_C8", "label": "return", "type": "return", "loc": [117, 117], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L116_C4", "vector": [13, 2, 0.375, 0.0032, 2, 0.05, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '%s %s %s' % (arg1, arg2, arg3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L119_C4", "label": "variable_number_of_arguments", "type": "function", "loc": [119, 120], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.383, 0.0064, 1, 0.1, 0.3293, 718, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "variable_number_of_arguments", "arg_names": ["self", "args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def variable_number_of_arguments(self, *args):\n return ' '.join(args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L120_C8", "label": "return", "type": "return", "loc": [120, 120], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L119_C4", "vector": [13, 2, 0.3846, 0.0032, 2, 0.13, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ' '.join(args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L122_C4", "label": "required_defaults_and_varargs", "type": "function", "loc": [122, 123], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.3926, 0.0064, 1, 0.1, 0.3415, 961, 0, 4, 1, 0, 0, 0, 1], "semantic": {"name": "required_defaults_and_varargs", "arg_names": ["self", "req", "default", "varargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def required_defaults_and_varargs(self, req, default='world', *varargs):\n return ' '.join((req, default) + varargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L123_C8", "label": "return", "type": "return", "loc": [123, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L122_C4", "vector": [13, 2, 0.3942, 0.0032, 2, 0.29, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ' '.join((req, default) + varargs)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L127_C4", "label": "string_as_argument", "type": "function", "loc": [127, 128], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.4087, 0.0064, 1, 0.1, 0.3537, 975, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "string_as_argument", "arg_names": ["self", "arg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def string_as_argument(self, arg):\n self._should_be_equal(arg, self.return_string())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L128_C8", "label": "_should_be_equal()", "type": "expression", "loc": [128, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L127_C4", "vector": [8, 2, 0.4103, 0.0032, 2, 0.84, 0.0, 281, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "_should_be_equal", "arg_names": [], "import_names": [], "rhs_call_name": "_should_be_equal", "annotation": ""}, "snippet": " self._should_be_equal(arg, self.return_string())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L130_C4", "label": "unicode_string_as_argument", "type": "function", "loc": [130, 131], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.4183, 0.0064, 1, 0.1, 0.3659, 406, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "unicode_string_as_argument", "arg_names": ["self", "arg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def unicode_string_as_argument(self, arg):\n self._should_be_equal(arg, self._unicode)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L131_C8", "label": "_should_be_equal()", "type": "expression", "loc": [131, 131], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L130_C4", "vector": [8, 2, 0.4199, 0.0032, 2, 0.7, 0.0, 281, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_should_be_equal", "arg_names": [], "import_names": [], "rhs_call_name": "_should_be_equal", "annotation": ""}, "snippet": " self._should_be_equal(arg, self._unicode)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L133_C4", "label": "empty_string_as_argument", "type": "function", "loc": [133, 134], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.4279, 0.0064, 1, 0.1, 0.378, 853, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "empty_string_as_argument", "arg_names": ["self", "arg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def empty_string_as_argument(self, arg):\n self._should_be_equal(arg, '')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L134_C8", "label": "_should_be_equal()", "type": "expression", "loc": [134, 134], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L133_C4", "vector": [8, 2, 0.4295, 0.0032, 2, 0.78, 0.0, 281, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_should_be_equal", "arg_names": [], "import_names": [], "rhs_call_name": "_should_be_equal", "annotation": ""}, "snippet": " self._should_be_equal(arg, '')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L136_C4", "label": "integer_as_argument", "type": "function", "loc": [136, 137], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.4375, 0.0064, 1, 0.1, 0.3902, 196, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "integer_as_argument", "arg_names": ["self", "arg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def integer_as_argument(self, arg):\n self._should_be_equal(arg, self.return_integer())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L137_C8", "label": "_should_be_equal()", "type": "expression", "loc": [137, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L136_C4", "vector": [8, 2, 0.4391, 0.0032, 2, 0.29, 0.0, 281, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "_should_be_equal", "arg_names": [], "import_names": [], "rhs_call_name": "_should_be_equal", "annotation": ""}, "snippet": " self._should_be_equal(arg, self.return_integer())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L139_C4", "label": "negative_integer_as_argument", "type": "function", "loc": [139, 140], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.4471, 0.0064, 1, 0.1, 0.4024, 240, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "negative_integer_as_argument", "arg_names": ["self", "arg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def negative_integer_as_argument(self, arg):\n self._should_be_equal(arg, self.return_negative_integer())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L140_C8", "label": "_should_be_equal()", "type": "expression", "loc": [140, 140], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L139_C4", "vector": [8, 2, 0.4487, 0.0032, 2, 0.92, 0.0, 281, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "_should_be_equal", "arg_names": [], "import_names": [], "rhs_call_name": "_should_be_equal", "annotation": ""}, "snippet": " self._should_be_equal(arg, self.return_negative_integer())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L142_C4", "label": "float_as_argument", "type": "function", "loc": [142, 143], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.4567, 0.0064, 1, 0.1, 0.4146, 322, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "float_as_argument", "arg_names": ["self", "arg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def float_as_argument(self, arg):\n self._should_be_equal(arg, self.return_float())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L143_C8", "label": "_should_be_equal()", "type": "expression", "loc": [143, 143], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L142_C4", "vector": [8, 2, 0.4583, 0.0032, 2, 0.22, 0.0, 281, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "_should_be_equal", "arg_names": [], "import_names": [], "rhs_call_name": "_should_be_equal", "annotation": ""}, "snippet": " self._should_be_equal(arg, self.return_float())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L145_C4", "label": "negative_float_as_argument", "type": "function", "loc": [145, 146], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.4663, 0.0064, 1, 0.1, 0.4268, 988, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "negative_float_as_argument", "arg_names": ["self", "arg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def negative_float_as_argument(self, arg):\n self._should_be_equal(arg, self.return_negative_float())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L146_C8", "label": "_should_be_equal()", "type": "expression", "loc": [146, 146], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L145_C4", "vector": [8, 2, 0.4679, 0.0032, 2, 0.02, 0.0, 281, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "_should_be_equal", "arg_names": [], "import_names": [], "rhs_call_name": "_should_be_equal", "annotation": ""}, "snippet": " self._should_be_equal(arg, self.return_negative_float())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L148_C4", "label": "zero_as_argument", "type": "function", "loc": [148, 149], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.476, 0.0064, 1, 0.1, 0.439, 518, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "zero_as_argument", "arg_names": ["self", "arg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def zero_as_argument(self, arg):\n self._should_be_equal(arg, 0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L149_C8", "label": "_should_be_equal()", "type": "expression", "loc": [149, 149], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L148_C4", "vector": [8, 2, 0.4776, 0.0032, 2, 0.57, 0.0, 281, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_should_be_equal", "arg_names": [], "import_names": [], "rhs_call_name": "_should_be_equal", "annotation": ""}, "snippet": " self._should_be_equal(arg, 0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L151_C4", "label": "boolean_true_as_argument", "type": "function", "loc": [151, 152], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.4856, 0.0064, 1, 0.1, 0.4512, 832, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "boolean_true_as_argument", "arg_names": ["self", "arg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def boolean_true_as_argument(self, arg):\n self._should_be_equal(arg, True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L152_C8", "label": "_should_be_equal()", "type": "expression", "loc": [152, 152], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L151_C4", "vector": [8, 2, 0.4872, 0.0032, 2, 0.91, 0.0, 281, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_should_be_equal", "arg_names": [], "import_names": [], "rhs_call_name": "_should_be_equal", "annotation": ""}, "snippet": " self._should_be_equal(arg, True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L154_C4", "label": "boolean_false_as_argument", "type": "function", "loc": [154, 155], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.4952, 0.0064, 1, 0.1, 0.4634, 477, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "boolean_false_as_argument", "arg_names": ["self", "arg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def boolean_false_as_argument(self, arg):\n self._should_be_equal(arg, False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L155_C8", "label": "_should_be_equal()", "type": "expression", "loc": [155, 155], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L154_C4", "vector": [8, 2, 0.4968, 0.0032, 2, 0.96, 0.0, 281, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_should_be_equal", "arg_names": [], "import_names": [], "rhs_call_name": "_should_be_equal", "annotation": ""}, "snippet": " self._should_be_equal(arg, False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L157_C4", "label": "none_as_argument", "type": "function", "loc": [157, 158], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.5048, 0.0064, 1, 0.1, 0.4756, 239, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "none_as_argument", "arg_names": ["self", "arg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def none_as_argument(self, arg):\n self._should_be_equal(arg, '')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L158_C8", "label": "_should_be_equal()", "type": "expression", "loc": [158, 158], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L157_C4", "vector": [8, 2, 0.5064, 0.0032, 2, 0.71, 0.0, 281, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_should_be_equal", "arg_names": [], "import_names": [], "rhs_call_name": "_should_be_equal", "annotation": ""}, "snippet": " self._should_be_equal(arg, '')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L160_C4", "label": "object_as_argument", "type": "function", "loc": [160, 161], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.5144, 0.0064, 1, 0.1, 0.4878, 377, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "object_as_argument", "arg_names": ["self", "arg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def object_as_argument(self, arg):\n self._should_be_equal(arg, '<MyObject>')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L161_C8", "label": "_should_be_equal()", "type": "expression", "loc": [161, 161], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L160_C4", "vector": [8, 2, 0.516, 0.0032, 2, 0.51, 0.0, 281, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_should_be_equal", "arg_names": [], "import_names": [], "rhs_call_name": "_should_be_equal", "annotation": ""}, "snippet": " self._should_be_equal(arg, '<MyObject>')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L163_C4", "label": "list_as_argument", "type": "function", "loc": [163, 164], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.524, 0.0064, 1, 0.1, 0.5, 662, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "list_as_argument", "arg_names": ["self", "arg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def list_as_argument(self, arg):\n self._should_be_equal(arg, self.return_list())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L164_C8", "label": "_should_be_equal()", "type": "expression", "loc": [164, 164], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L163_C4", "vector": [8, 2, 0.5256, 0.0032, 2, 0.96, 0.0, 281, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "_should_be_equal", "arg_names": [], "import_names": [], "rhs_call_name": "_should_be_equal", "annotation": ""}, "snippet": " self._should_be_equal(arg, self.return_list())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L166_C4", "label": "empty_list_as_argument", "type": "function", "loc": [166, 167], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.5337, 0.0064, 1, 0.1, 0.5122, 4, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "empty_list_as_argument", "arg_names": ["self", "arg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def empty_list_as_argument(self, arg):\n self._should_be_equal(arg, [])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L167_C8", "label": "_should_be_equal()", "type": "expression", "loc": [167, 167], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L166_C4", "vector": [8, 2, 0.5353, 0.0032, 2, 0.86, 0.0, 281, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_should_be_equal", "arg_names": [], "import_names": [], "rhs_call_name": "_should_be_equal", "annotation": ""}, "snippet": " self._should_be_equal(arg, [])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L169_C4", "label": "list_containing_none_as_argument", "type": "function", "loc": [169, 170], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.5433, 0.0064, 1, 0.1, 0.5244, 904, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "list_containing_none_as_argument", "arg_names": ["self", "arg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def list_containing_none_as_argument(self, arg):\n self._should_be_equal(arg, [''])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L170_C8", "label": "_should_be_equal()", "type": "expression", "loc": [170, 170], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L169_C4", "vector": [8, 2, 0.5449, 0.0032, 2, 0.13, 0.0, 281, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_should_be_equal", "arg_names": [], "import_names": [], "rhs_call_name": "_should_be_equal", "annotation": ""}, "snippet": " self._should_be_equal(arg, [''])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L172_C4", "label": "list_containing_objects_as_argument", "type": "function", "loc": [172, 173], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.5529, 0.0064, 1, 0.1, 0.5366, 278, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "list_containing_objects_as_argument", "arg_names": ["self", "arg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def list_containing_objects_as_argument(self, arg):\n self._should_be_equal(arg, ['<MyObject1>', '<MyObject2>'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L173_C8", "label": "_should_be_equal()", "type": "expression", "loc": [173, 173], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L172_C4", "vector": [8, 2, 0.5545, 0.0032, 2, 0.86, 0.0, 281, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_should_be_equal", "arg_names": [], "import_names": [], "rhs_call_name": "_should_be_equal", "annotation": ""}, "snippet": " self._should_be_equal(arg, ['<MyObject1>', '<MyObject2>'])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L175_C4", "label": "nested_list_as_argument", "type": "function", "loc": [175, 177], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.5641, 0.0096, 1, 0.1, 0.5488, 130, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "nested_list_as_argument", "arg_names": ["self", "arg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def nested_list_as_argument(self, arg):\n exp = [ [True, False], [[1, '', '<MyObject>', {}]] ]\n self._should_be_equal(arg, exp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Assign_L176_C8", "label": "exp =", "type": "assigned_variable", "loc": [176, 176], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L175_C4", "vector": [14, 2, 0.5641, 0.0032, 2, 0.99, 0.0, 971, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "exp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " exp = [ [True, False], [[1, '', '<MyObject>', {}]] ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L177_C8", "label": "_should_be_equal()", "type": "expression", "loc": [177, 177], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L175_C4", "vector": [8, 2, 0.5673, 0.0032, 2, 0.99, 1.0, 281, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_should_be_equal", "arg_names": [], "import_names": [], "rhs_call_name": "_should_be_equal", "annotation": ""}, "snippet": " self._should_be_equal(arg, exp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L179_C4", "label": "dictionary_as_argument", "type": "function", "loc": [179, 180], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.5753, 0.0064, 1, 0.1, 0.561, 131, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "dictionary_as_argument", "arg_names": ["self", "arg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def dictionary_as_argument(self, arg):\n self._should_be_equal(arg, self.return_dictionary())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L180_C8", "label": "_should_be_equal()", "type": "expression", "loc": [180, 180], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L179_C4", "vector": [8, 2, 0.5769, 0.0032, 2, 0.12, 0.0, 281, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "_should_be_equal", "arg_names": [], "import_names": [], "rhs_call_name": "_should_be_equal", "annotation": ""}, "snippet": " self._should_be_equal(arg, self.return_dictionary())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L182_C4", "label": "empty_dictionary_as_argument", "type": "function", "loc": [182, 183], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.5849, 0.0064, 1, 0.1, 0.5732, 296, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "empty_dictionary_as_argument", "arg_names": ["self", "arg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def empty_dictionary_as_argument(self, arg):\n self._should_be_equal(arg, {})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L183_C8", "label": "_should_be_equal()", "type": "expression", "loc": [183, 183], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L182_C4", "vector": [8, 2, 0.5865, 0.0032, 2, 0.19, 0.0, 281, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_should_be_equal", "arg_names": [], "import_names": [], "rhs_call_name": "_should_be_equal", "annotation": ""}, "snippet": " self._should_be_equal(arg, {})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L185_C4", "label": "dictionary_with_non_string_keys_as_argument", "type": "function", "loc": [185, 186], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.5946, 0.0064, 1, 0.1, 0.5854, 197, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "dictionary_with_non_string_keys_as_argument", "arg_names": ["self", "arg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def dictionary_with_non_string_keys_as_argument(self, arg):\n self._should_be_equal(arg, {'1': 2, '': True})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L186_C8", "label": "_should_be_equal()", "type": "expression", "loc": [186, 186], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L185_C4", "vector": [8, 2, 0.5962, 0.0032, 2, 0.69, 0.0, 281, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_should_be_equal", "arg_names": [], "import_names": [], "rhs_call_name": "_should_be_equal", "annotation": ""}, "snippet": " self._should_be_equal(arg, {'1': 2, '': True})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L188_C4", "label": "dictionary_containing_none_as_argument", "type": "function", "loc": [188, 189], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.6042, 0.0064, 1, 0.1, 0.5976, 982, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "dictionary_containing_none_as_argument", "arg_names": ["self", "arg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def dictionary_containing_none_as_argument(self, arg):\n self._should_be_equal(arg, {'As value': '', '': 'As key'})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L189_C8", "label": "_should_be_equal()", "type": "expression", "loc": [189, 189], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L188_C4", "vector": [8, 2, 0.6058, 0.0032, 2, 0.52, 0.0, 281, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_should_be_equal", "arg_names": [], "import_names": [], "rhs_call_name": "_should_be_equal", "annotation": ""}, "snippet": " self._should_be_equal(arg, {'As value': '', '': 'As key'})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L191_C4", "label": "dictionary_containing_objects_as_argument", "type": "function", "loc": [191, 192], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.6138, 0.0064, 1, 0.1, 0.6098, 622, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "dictionary_containing_objects_as_argument", "arg_names": ["self", "arg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def dictionary_containing_objects_as_argument(self, arg):\n self._should_be_equal(arg, {'As value': '<MyObject1>', '<MyObject2>': 'As key'})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L192_C8", "label": "_should_be_equal()", "type": "expression", "loc": [192, 192], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L191_C4", "vector": [8, 2, 0.6154, 0.0032, 2, 0.16, 0.0, 281, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_should_be_equal", "arg_names": [], "import_names": [], "rhs_call_name": "_should_be_equal", "annotation": ""}, "snippet": " self._should_be_equal(arg, {'As value': '<MyObject1>', '<MyObject2>': 'As key'})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L194_C4", "label": "nested_dictionary_as_argument", "type": "function", "loc": [194, 197], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.6266, 0.0128, 1, 0.1, 0.622, 949, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "nested_dictionary_as_argument", "arg_names": ["self", "arg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def nested_dictionary_as_argument(self, arg):\n exp = { '1': {'': False},\n '2': {'A': {'n': ''}, 'B': {'o': '<MyObject>', 'e': {}}} }\n self._should_be_equal(arg, exp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Assign_L195_C8", "label": "exp =", "type": "assigned_variable", "loc": [195, 196], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L194_C4", "vector": [14, 2, 0.6266, 0.0064, 2, 0.62, 0.0, 971, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "exp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " exp = { '1': {'': False},\n '2': {'A': {'n': ''}, 'B': {'o': '<MyObject>', 'e': {}}} }"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L197_C8", "label": "_should_be_equal()", "type": "expression", "loc": [197, 197], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L194_C4", "vector": [8, 2, 0.6314, 0.0032, 2, 0.62, 1.0, 281, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_should_be_equal", "arg_names": [], "import_names": [], "rhs_call_name": "_should_be_equal", "annotation": ""}, "snippet": " self._should_be_equal(arg, exp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L199_C4", "label": "_should_be_equal", "type": "function", "loc": [199, 201], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.641, 0.0096, 1, 0.1, 0.6341, 281, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "_should_be_equal", "arg_names": ["self", "arg", "exp"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _should_be_equal(self, arg, exp):\n if arg != exp:\n raise AssertionError('%r != %r' % (arg, exp))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:If_L200_C8", "label": "if", "type": "if", "loc": [200, 201], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L199_C4", "vector": [4, 2, 0.6426, 0.0064, 2, 0.04, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if arg != exp:\n raise AssertionError('%r != %r' % (arg, exp))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L205_C4", "label": "return_string", "type": "function", "loc": [205, 206], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.6587, 0.0064, 1, 0.1, 0.6463, 479, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "return_string", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def return_string(self):\n return 'Hello, world!'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L206_C8", "label": "return", "type": "return", "loc": [206, 206], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L205_C4", "vector": [13, 2, 0.6603, 0.0032, 2, 0.08, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'Hello, world!'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L208_C4", "label": "return_unicode_string", "type": "function", "loc": [208, 209], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.6683, 0.0064, 1, 0.1, 0.6585, 358, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "return_unicode_string", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def return_unicode_string(self):\n return self._unicode"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L209_C8", "label": "return", "type": "return", "loc": [209, 209], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L208_C4", "vector": [13, 2, 0.6699, 0.0032, 2, 0.88, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._unicode"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L211_C4", "label": "return_empty_string", "type": "function", "loc": [211, 212], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.6779, 0.0064, 1, 0.1, 0.6707, 866, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "return_empty_string", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def return_empty_string(self):\n return ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L212_C8", "label": "return", "type": "return", "loc": [212, 212], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L211_C4", "vector": [13, 2, 0.6795, 0.0032, 2, 0.19, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L214_C4", "label": "return_integer", "type": "function", "loc": [214, 215], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.6875, 0.0064, 1, 0.1, 0.6829, 777, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "return_integer", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def return_integer(self):\n return 42"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L215_C8", "label": "return", "type": "return", "loc": [215, 215], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L214_C4", "vector": [13, 2, 0.6891, 0.0032, 2, 0.75, 0.0, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 42"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L217_C4", "label": "return_negative_integer", "type": "function", "loc": [217, 218], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.6971, 0.0064, 1, 0.1, 0.6951, 270, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "return_negative_integer", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def return_negative_integer(self):\n return -1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L218_C8", "label": "return", "type": "return", "loc": [218, 218], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L217_C4", "vector": [13, 2, 0.6987, 0.0032, 2, 0.48, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return -1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L220_C4", "label": "return_float", "type": "function", "loc": [220, 221], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.7067, 0.0064, 1, 0.1, 0.7073, 952, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "return_float", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def return_float(self):\n return 3.14"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L221_C8", "label": "return", "type": "return", "loc": [221, 221], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L220_C4", "vector": [13, 2, 0.7083, 0.0032, 2, 0.01, 0.0, 0, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 3.14"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L223_C4", "label": "return_negative_float", "type": "function", "loc": [223, 224], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.7163, 0.0064, 1, 0.1, 0.7195, 294, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "return_negative_float", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def return_negative_float(self):\n return -0.5"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L224_C8", "label": "return", "type": "return", "loc": [224, 224], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L223_C4", "vector": [13, 2, 0.7179, 0.0032, 2, 0.52, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return -0.5"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L226_C4", "label": "return_zero", "type": "function", "loc": [226, 227], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.726, 0.0064, 1, 0.1, 0.7317, 900, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "return_zero", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def return_zero(self):\n return 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L227_C8", "label": "return", "type": "return", "loc": [227, 227], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L226_C4", "vector": [13, 2, 0.7276, 0.0032, 2, 0.22, 0.0, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L229_C4", "label": "return_boolean_true", "type": "function", "loc": [229, 230], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.7356, 0.0064, 1, 0.1, 0.7439, 483, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "return_boolean_true", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def return_boolean_true(self):\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L230_C8", "label": "return", "type": "return", "loc": [230, 230], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L229_C4", "vector": [13, 2, 0.7372, 0.0032, 2, 0.55, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L232_C4", "label": "return_boolean_false", "type": "function", "loc": [232, 233], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.7452, 0.0064, 1, 0.1, 0.7561, 905, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "return_boolean_false", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def return_boolean_false(self):\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L233_C8", "label": "return", "type": "return", "loc": [233, 233], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L232_C4", "vector": [13, 2, 0.7468, 0.0032, 2, 0.32, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L235_C4", "label": "return_nothing", "type": "function", "loc": [235, 236], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.7548, 0.0064, 1, 0.1, 0.7683, 623, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "return_nothing", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def return_nothing(self):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L238_C4", "label": "return_object", "type": "function", "loc": [238, 239], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.7644, 0.0064, 1, 0.1, 0.7805, 308, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "return_object", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def return_object(self):\n return MyObject()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L239_C8", "label": "return", "type": "return", "loc": [239, 239], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L238_C4", "vector": [13, 2, 0.766, 0.0032, 2, 0.3, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return MyObject()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L241_C4", "label": "return_list", "type": "function", "loc": [241, 242], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.774, 0.0064, 1, 0.1, 0.7927, 103, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "return_list", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def return_list(self):\n return ['One', -2, False]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L242_C8", "label": "return", "type": "return", "loc": [242, 242], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L241_C4", "vector": [13, 2, 0.7756, 0.0032, 2, 0.52, 0.0, 0, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ['One', -2, False]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L244_C4", "label": "return_empty_list", "type": "function", "loc": [244, 245], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.7837, 0.0064, 1, 0.1, 0.8049, 180, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "return_empty_list", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def return_empty_list(self):\n return []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L245_C8", "label": "return", "type": "return", "loc": [245, 245], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L244_C4", "vector": [13, 2, 0.7853, 0.0032, 2, 0.06, 0.0, 0, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L247_C4", "label": "return_list_containing_none", "type": "function", "loc": [247, 248], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.7933, 0.0064, 1, 0.1, 0.8171, 874, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "return_list_containing_none", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def return_list_containing_none(self):\n return [None]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L248_C8", "label": "return", "type": "return", "loc": [248, 248], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L247_C4", "vector": [13, 2, 0.7949, 0.0032, 2, 0.81, 0.0, 0, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [None]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L250_C4", "label": "return_list_containing_objects", "type": "function", "loc": [250, 251], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.8029, 0.0064, 1, 0.1, 0.8293, 547, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "return_list_containing_objects", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def return_list_containing_objects(self):\n return [MyObject(1), MyObject(2)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L251_C8", "label": "return", "type": "return", "loc": [251, 251], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L250_C4", "vector": [13, 2, 0.8045, 0.0032, 2, 0.54, 0.0, 0, 0, 0, 0, 0, 0, 5, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [MyObject(1), MyObject(2)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L253_C4", "label": "return_nested_list", "type": "function", "loc": [253, 254], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.8125, 0.0064, 1, 0.1, 0.8415, 676, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "return_nested_list", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def return_nested_list(self):\n return [ [True, False], [[1, None, MyObject(), {}]] ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L254_C8", "label": "return", "type": "return", "loc": [254, 254], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L253_C4", "vector": [13, 2, 0.8141, 0.0032, 2, 0.23, 0.0, 0, 0, 0, 0, 0, 0, 5, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [ [True, False], [[1, None, MyObject(), {}]] ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L256_C4", "label": "return_tuple", "type": "function", "loc": [256, 257], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.8221, 0.0064, 1, 0.1, 0.8537, 780, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "return_tuple", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def return_tuple(self):\n return (1, 'two', True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L257_C8", "label": "return", "type": "return", "loc": [257, 257], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L256_C4", "vector": [13, 2, 0.8237, 0.0032, 2, 0.92, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return (1, 'two', True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L259_C4", "label": "return_empty_tuple", "type": "function", "loc": [259, 260], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.8317, 0.0064, 1, 0.1, 0.8659, 177, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "return_empty_tuple", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def return_empty_tuple(self):\n return ()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L260_C8", "label": "return", "type": "return", "loc": [260, 260], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L259_C4", "vector": [13, 2, 0.8333, 0.0032, 2, 0.45, 0.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L262_C4", "label": "return_nested_tuple", "type": "function", "loc": [262, 263], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.8413, 0.0064, 1, 0.1, 0.878, 124, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "return_nested_tuple", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def return_nested_tuple(self):\n return ( (True, False), [(1, None, MyObject(), {})] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L263_C8", "label": "return", "type": "return", "loc": [263, 263], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L262_C4", "vector": [13, 2, 0.8429, 0.0032, 2, 0.24, 0.0, 0, 0, 0, 0, 0, 0, 8, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ( (True, False), [(1, None, MyObject(), {})] )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L265_C4", "label": "return_dictionary", "type": "function", "loc": [265, 266], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.851, 0.0064, 1, 0.1, 0.8902, 126, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "return_dictionary", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def return_dictionary(self):\n return {'one': 1, 'spam': 'eggs'}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L266_C8", "label": "return", "type": "return", "loc": [266, 266], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L265_C4", "vector": [13, 2, 0.8526, 0.0032, 2, 0.78, 0.0, 0, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return {'one': 1, 'spam': 'eggs'}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L268_C4", "label": "return_empty_dictionary", "type": "function", "loc": [268, 269], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.8606, 0.0064, 1, 0.1, 0.9024, 340, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "return_empty_dictionary", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def return_empty_dictionary(self):\n return {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L269_C8", "label": "return", "type": "return", "loc": [269, 269], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L268_C4", "vector": [13, 2, 0.8622, 0.0032, 2, 0.15, 0.0, 0, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L271_C4", "label": "return_dictionary_with_non_string_keys", "type": "function", "loc": [271, 272], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.8702, 0.0064, 1, 0.1, 0.9146, 467, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "return_dictionary_with_non_string_keys", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def return_dictionary_with_non_string_keys(self):\n return {1: 2, None: True}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L272_C8", "label": "return", "type": "return", "loc": [272, 272], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L271_C4", "vector": [13, 2, 0.8718, 0.0032, 2, 0.68, 0.0, 0, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return {1: 2, None: True}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L274_C4", "label": "return_dictionary_containing_none", "type": "function", "loc": [274, 275], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.8798, 0.0064, 1, 0.1, 0.9268, 542, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "return_dictionary_containing_none", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def return_dictionary_containing_none(self):\n return {'As value': None, None: 'As key'}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L275_C8", "label": "return", "type": "return", "loc": [275, 275], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L274_C4", "vector": [13, 2, 0.8814, 0.0032, 2, 0.64, 0.0, 0, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return {'As value': None, None: 'As key'}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L277_C4", "label": "return_dictionary_containing_objects", "type": "function", "loc": [277, 278], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.8894, 0.0064, 1, 0.1, 0.939, 959, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "return_dictionary_containing_objects", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def return_dictionary_containing_objects(self):\n return {'As value': MyObject(1), MyObject(2): 'As key'}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L278_C8", "label": "return", "type": "return", "loc": [278, 278], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L277_C4", "vector": [13, 2, 0.891, 0.0032, 2, 0.37, 0.0, 0, 0, 0, 0, 0, 0, 6, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return {'As value': MyObject(1), MyObject(2): 'As key'}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L280_C4", "label": "return_nested_dictionary", "type": "function", "loc": [280, 282], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.9006, 0.0096, 1, 0.1, 0.9512, 882, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "return_nested_dictionary", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def return_nested_dictionary(self):\n return { 1: {None: False},\n 2: {'A': {'n': None}, 'B': {'o': MyObject(), 'e': {}}} }"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L281_C8", "label": "return", "type": "return", "loc": [281, 282], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L280_C4", "vector": [13, 2, 0.9022, 0.0064, 2, 0.3, 0.0, 0, 0, 0, 0, 0, 0, 6, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return { 1: {None: False},\n 2: {'A': {'n': None}, 'B': {'o': MyObject(), 'e': {}}} }"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L284_C4", "label": "return_control_char", "type": "function", "loc": [284, 285], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.9119, 0.0064, 1, 0.1, 0.9634, 106, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "return_control_char", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def return_control_char(self):\n return '\\x01'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L285_C8", "label": "return", "type": "return", "loc": [285, 285], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L284_C4", "vector": [13, 2, 0.9135, 0.0032, 2, 0.36, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '\\x01'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L289_C4", "label": "_private_method", "type": "function", "loc": [289, 290], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.9279, 0.0064, 1, 0.1, 0.9756, 344, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "_private_method", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _private_method(self):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L292_C4", "label": "__private_method", "type": "function", "loc": [292, 293], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [2, 1, 0.9375, 0.0064, 1, 0.1, 0.9878, 900, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "__private_method", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __private_method(self):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Assign_L295_C4", "label": "attribute =", "type": "assigned_variable", "loc": [295, 295], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "vector": [14, 1, 0.9455, 0.0032, 1, 0.1, 1.0, 355, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "attribute", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " attribute = 'Not a keyword'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L298_C0", "label": "MyObject", "type": "class", "loc": [298, 302], "level": 0, "parent": null, "vector": [3, 0, 0.9615, 0.016, 0, 0.66, 0.5, 605, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "MyObject", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class MyObject:\n def __init__(self, index=''):\n self.index = index\n def __str__(self):\n return '<MyObject%s>' % self.index"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L299_C4", "label": "__init__", "type": "function", "loc": [299, 300], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L298_C0", "vector": [2, 1, 0.9599, 0.0064, 1, 0.48, 0.0, 555, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "index"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, index=''):\n self.index = index"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Assign_L300_C8", "label": "self.index =", "type": "assigned_variable", "loc": [300, 300], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L299_C4", "vector": [14, 2, 0.9615, 0.0032, 2, 0.17, 0.0, 777, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.index", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.index = index"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L301_C4", "label": "__str__", "type": "function", "loc": [301, 302], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L298_C0", "vector": [2, 1, 0.9663, 0.0064, 1, 0.48, 1.0, 527, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "__str__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __str__(self):\n return '<MyObject%s>' % self.index"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L302_C8", "label": "return", "type": "return", "loc": [302, 302], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L301_C4", "vector": [13, 2, 0.9679, 0.0032, 2, 0.86, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '<MyObject%s>' % self.index"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L304_C0", "label": "MyException", "type": "class", "loc": [304, 305], "level": 0, "parent": null, "vector": [3, 0, 0.976, 0.0064, 0, 0.66, 0.75, 738, 0, 0, 0, 0, 645, 0, 0], "semantic": {"name": "MyException", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class MyException(Exception):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:If_L308_C0", "label": "if", "type": "if", "loc": [308, 312], "level": 0, "parent": null, "vector": [4, 0, 0.9936, 0.016, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n import sys\n from robotremoteserver import RobotRemoteServer\n\n RobotRemoteServer(RemoteTestLibrary(), *sys.argv[1:])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Import_L309_C4", "label": "sys import sys", "type": "import", "loc": [309, 309], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:If_L308_C0", "vector": [1, 1, 0.9904, 0.0032, 1, 0.49, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": " import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:ImportFrom_L310_C4", "label": "from robotremoteserver import RobotRemoteServer", "type": "import", "loc": [310, 310], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:If_L308_C0", "vector": [1, 1, 0.9936, 0.0032, 1, 0.49, 0.5, 759, 0, 1, 0, 0, 759, 0, 0], "semantic": {"name": "robotremoteserver", "arg_names": [], "import_names": ["RobotRemoteServer"], "rhs_call_name": "", "annotation": ""}, "snippet": " from robotremoteserver import RobotRemoteServer"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L312_C4", "label": "RobotRemoteServer()", "type": "expression", "loc": [312, 312], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99927:If_L308_C0", "vector": [8, 1, 1.0, 0.0032, 1, 0.49, 1.0, 537, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "RobotRemoteServer", "arg_names": [], "import_names": [], "rhs_call_name": "RobotRemoteServer", "annotation": ""}, "snippet": " RobotRemoteServer(RemoteTestLibrary(), *sys.argv[1:])"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Assign_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Assign_L10_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L11_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L16_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L41_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L65_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L79_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L82_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L85_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L88_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L88_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L91_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L94_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L97_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:If_L98_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L104_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L107_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L108_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L110_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L110_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L111_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L113_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L113_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L116_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L117_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L119_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L119_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L120_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L122_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L122_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L123_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L127_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L127_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L128_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L130_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L130_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L131_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L133_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L133_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L134_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L136_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L136_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L137_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L139_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L139_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L140_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L142_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L142_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L143_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L145_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L145_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L146_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L148_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L148_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L149_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L151_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L151_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L152_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L154_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L154_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L155_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L157_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L157_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L158_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L160_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L160_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L161_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L163_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L163_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L164_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L166_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L166_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L167_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L169_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L169_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L170_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L172_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L172_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L173_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L175_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L175_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Assign_L176_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L175_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L177_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L179_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L179_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L180_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L182_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L182_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L183_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L185_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L185_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L186_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L188_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L188_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L189_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L191_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L191_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L192_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L194_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L194_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Assign_L195_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L194_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L197_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L199_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L199_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:If_L200_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L205_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L205_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L206_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L208_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L208_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L209_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L211_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L211_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L212_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L214_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L214_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L215_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L217_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L217_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L218_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L220_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L220_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L221_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L223_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L223_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L224_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L226_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L226_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L227_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L229_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L229_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L230_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L232_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L232_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L233_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L235_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L238_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L238_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L239_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L241_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L241_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L242_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L244_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L244_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L245_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L247_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L247_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L248_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L250_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L250_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L251_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L253_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L253_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L254_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L256_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L256_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L257_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L259_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L259_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L260_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L262_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L262_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L263_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L265_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L265_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L266_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L268_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L268_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L269_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L271_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L271_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L272_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L274_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L274_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L275_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L277_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L277_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L278_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L280_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L280_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L281_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L284_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L284_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L285_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L289_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L292_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Assign_L295_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L298_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L299_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L299_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Assign_L300_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:ClassDef_L298_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L301_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:FunctionDef_L301_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Return_L302_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:If_L308_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Import_L309_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:If_L308_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:ImportFrom_L310_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99927:If_L308_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99927:Expr_L312_C4"}] |
class regular:
ROBOT_LIBRARY_SCOPE = 'TEST SUITE'
"""This is a very regular test library"""
def __init__(self, arg1='hello', arg2='world'):
"""Constructs a new regular test library
See `keyword`
Examples:
| regular | foo | bar |
| regular | | # default values are used |
"""
self.arg1 = arg1
self.arg2 = arg2
def keyword(self):
"""A "keyword" & it contains 'stuff' to <escape>
See `get hello` for details"""
pass
def get_hello(self):
"""Get the intialization variables
See `importing` for explanation of arguments
and `introduction` for introduction"""
return self.arg1, self.arg2
| ajibawa-2023/Python-Code-Large/train/row_99929 | 12 | 30 | 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_99929:ClassDef_L1_C0", "label": "regular", "type": "class", "loc": [1, 30], "level": 0, "parent": null, "vector": [3, 0, 0.5167, 1.0, 0, 0.66, 0.0, 2, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "regular", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class regular:\n ROBOT_LIBRARY_SCOPE = 'TEST SUITE'\n\n \"\"\"This is a very regular test library\"\"\"\n\n def __init__(self, arg1='hello', arg2='world'):\n \"\"\"Constructs a new regular test library\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99929:Assign_L2_C4", "label": "ROBOT_LIBRARY_SCOPE =", "type": "assigned_variable", "loc": [2, 2], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99929:ClassDef_L1_C0", "vector": [14, 1, 0.0667, 0.0333, 1, 0.2, 0.0, 305, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ROBOT_LIBRARY_SCOPE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " ROBOT_LIBRARY_SCOPE = 'TEST SUITE'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99929:Expr_L4_C4", "label": "expression", "type": "expression", "loc": [4, 4], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99929:ClassDef_L1_C0", "vector": [8, 1, 0.1333, 0.0333, 1, 0.2, 0.25, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"This is a very regular test library\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99929:FunctionDef_L6_C4", "label": "__init__", "type": "function", "loc": [6, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99929:ClassDef_L1_C0", "vector": [2, 1, 0.3833, 0.4, 1, 0.2, 0.5, 555, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "arg1", "arg2"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, arg1='hello', arg2='world'):\n \"\"\"Constructs a new regular test library\n\n See `keyword`\n\n Examples:\n \n | regular | foo | bar |"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99929:Expr_L7_C8", "label": "expression", "type": "expression", "loc": [7, 15], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99929:FunctionDef_L6_C4", "vector": [8, 2, 0.3667, 0.3, 2, 0.24, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Constructs a new regular test library\n\n See `keyword`\n\n Examples:\n \n | regular | foo | bar |\n | regular | | # default values are used |"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99929:Assign_L16_C8", "label": "self.arg1 =", "type": "assigned_variable", "loc": [16, 16], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99929:FunctionDef_L6_C4", "vector": [14, 2, 0.5333, 0.0333, 2, 0.24, 0.5, 572, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.arg1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.arg1 = arg1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99929:Assign_L17_C8", "label": "self.arg2 =", "type": "assigned_variable", "loc": [17, 17], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99929:FunctionDef_L6_C4", "vector": [14, 2, 0.5667, 0.0333, 2, 0.24, 1.0, 552, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.arg2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.arg2 = arg2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99929:FunctionDef_L19_C4", "label": "keyword", "type": "function", "loc": [19, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99929:ClassDef_L1_C0", "vector": [2, 1, 0.7, 0.1667, 1, 0.2, 0.75, 454, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "keyword", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def keyword(self):\n \"\"\"A \"keyword\" & it contains 'stuff' to <escape> \n\n See `get hello` for details\"\"\"\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99929:Expr_L20_C8", "label": "expression", "type": "expression", "loc": [20, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99929:FunctionDef_L19_C4", "vector": [8, 2, 0.7, 0.1, 2, 0.09, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"A \"keyword\" & it contains 'stuff' to <escape> \n\n See `get hello` for details\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99929:FunctionDef_L25_C4", "label": "get_hello", "type": "function", "loc": [25, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99929:ClassDef_L1_C0", "vector": [2, 1, 0.9167, 0.2, 1, 0.2, 1.0, 116, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "get_hello", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_hello(self):\n \"\"\"Get the intialization variables\n\n See `importing` for explanation of arguments\n and `introduction` for introduction\"\"\"\n return self.arg1, self.arg2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99929:Expr_L26_C8", "label": "expression", "type": "expression", "loc": [26, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99929:FunctionDef_L25_C4", "vector": [8, 2, 0.9167, 0.1333, 2, 0.94, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Get the intialization variables\n\n See `importing` for explanation of arguments\n and `introduction` for introduction\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99929:Return_L30_C8", "label": "return", "type": "return", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99929:FunctionDef_L25_C4", "vector": [13, 2, 1.0, 0.0333, 2, 0.94, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.arg1, self.arg2"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99929:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99929:Assign_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99929:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99929:Expr_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99929:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99929:FunctionDef_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99929:FunctionDef_L6_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99929:Expr_L7_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99929:FunctionDef_L6_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99929:Assign_L16_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99929:FunctionDef_L6_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99929:Assign_L17_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99929:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99929:FunctionDef_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99929:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99929:Expr_L20_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99929:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99929:FunctionDef_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99929:FunctionDef_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99929:Expr_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99929:FunctionDef_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99929:Return_L30_C8"}] |
class RequiredArgs:
def __init__(self, required, arguments, default="value"):
"""This library always needs two arguments and has one default.
Keyword names are got from the given arguments.
"""
self.__dict__[required] = lambda: None
self.__dict__[arguments] = lambda arg: None
self.__dict__[default] = lambda arg1, arg2: None
| ajibawa-2023/Python-Code-Large/train/row_99930 | 6 | 11 | 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_99930:ClassDef_L1_C0", "label": "RequiredArgs", "type": "class", "loc": [1, 10], "level": 0, "parent": null, "vector": [3, 0, 0.5, 0.9091, 0, 0.66, 0.0, 764, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "RequiredArgs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class RequiredArgs:\n\n def __init__(self, required, arguments, default=\"value\"):\n \"\"\"This library always needs two arguments and has one default.\n\n Keyword names are got from the given arguments.\n \"\"\"\n self.__dict__[required] = lambda: None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99930:FunctionDef_L3_C4", "label": "__init__", "type": "function", "loc": [3, 10], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99930:ClassDef_L1_C0", "vector": [2, 1, 0.5909, 0.7273, 1, 0.09, 0.0, 555, 0, 4, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "required", "arguments", "default"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, required, arguments, default=\"value\"):\n \"\"\"This library always needs two arguments and has one default.\n\n Keyword names are got from the given arguments.\n \"\"\"\n self.__dict__[required] = lambda: None\n self.__dict__[arguments] = lambda arg: None\n self.__dict__[default] = lambda arg1, arg2: None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99930:Expr_L4_C8", "label": "expression", "type": "expression", "loc": [4, 7], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99930:FunctionDef_L3_C4", "vector": [8, 2, 0.5, 0.3636, 2, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"This library always needs two arguments and has one default.\n\n Keyword names are got from the given arguments.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99930:Assign_L8_C8", "label": "assign", "type": "assigned_variable", "loc": [8, 8], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99930:FunctionDef_L3_C4", "vector": [14, 2, 0.7273, 0.0909, 2, 0.66, 0.3333, 0, 9, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.__dict__[required] = lambda: None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99930:Assign_L9_C8", "label": "assign", "type": "assigned_variable", "loc": [9, 9], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99930:FunctionDef_L3_C4", "vector": [14, 2, 0.8182, 0.0909, 2, 0.66, 0.6667, 0, 9, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.__dict__[arguments] = lambda arg: None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99930:Assign_L10_C8", "label": "assign", "type": "assigned_variable", "loc": [10, 10], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99930:FunctionDef_L3_C4", "vector": [14, 2, 0.9091, 0.0909, 2, 0.66, 1.0, 0, 9, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.__dict__[default] = lambda arg1, arg2: None"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99930:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99930:FunctionDef_L3_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99930:FunctionDef_L3_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99930:Expr_L4_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99930:FunctionDef_L3_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99930:Assign_L8_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99930:FunctionDef_L3_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99930:Assign_L9_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99930:FunctionDef_L3_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99930:Assign_L10_C8"}] |
class new_style_no_init(object):
"""No __init__ on this one."""
def kw(self):
"""The only lonely keyword."""
| ajibawa-2023/Python-Code-Large/train/row_99931 | 4 | 6 | 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_99931:ClassDef_L1_C0", "label": "new_style_no_init", "type": "class", "loc": [1, 6], "level": 0, "parent": null, "vector": [3, 0, 0.5833, 1.0, 0, 0.66, 0.0, 886, 0, 1, 0, 0, 186, 0, 0], "semantic": {"name": "new_style_no_init", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class new_style_no_init(object):\n\n \"\"\"No __init__ on this one.\"\"\"\n\n def kw(self):\n \"\"\"The only lonely keyword.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99931:Expr_L3_C4", "label": "expression", "type": "expression", "loc": [3, 3], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99931:ClassDef_L1_C0", "vector": [8, 1, 0.5, 0.1667, 1, 0.69, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"No __init__ on this one.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99931:FunctionDef_L5_C4", "label": "kw", "type": "function", "loc": [5, 6], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99931:ClassDef_L1_C0", "vector": [2, 1, 0.9167, 0.3333, 1, 0.69, 1.0, 755, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "kw", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def kw(self):\n \"\"\"The only lonely keyword.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99931:Expr_L6_C8", "label": "expression", "type": "expression", "loc": [6, 6], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99931:FunctionDef_L5_C4", "vector": [8, 2, 1.0, 0.1667, 2, 0.02, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"The only lonely keyword.\"\"\""}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99931:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99931:Expr_L3_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99931:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99931:FunctionDef_L5_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99931:FunctionDef_L5_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99931:Expr_L6_C8"}] |
class no_arg_init:
def __init__(self):
"""This doc not shown because there are no arguments."""
def keyword(self):
"""A keyword.
See `get hello` for details and *never* run this keyword.
"""
1/0
def get_hello(self, arg):
"""Returns 'Hello `arg`!'.
See `importing` for explanation of arguments and `introduction`
for introduction. Neither of them really exist, though.
"""
return 'Hello %s' % arg
| ajibawa-2023/Python-Code-Large/train/row_99932 | 9 | 20 | 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_99932:ClassDef_L1_C0", "label": "no_arg_init", "type": "class", "loc": [1, 19], "level": 0, "parent": null, "vector": [3, 0, 0.5, 0.95, 0, 0.66, 0.0, 941, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "no_arg_init", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class no_arg_init:\n\n def __init__(self):\n \"\"\"This doc not shown because there are no arguments.\"\"\"\n\n def keyword(self):\n \"\"\"A keyword.\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99932:FunctionDef_L3_C4", "label": "__init__", "type": "function", "loc": [3, 4], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99932:ClassDef_L1_C0", "vector": [2, 1, 0.175, 0.1, 1, 0.11, 0.0, 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 \"\"\"This doc not shown because there are no arguments.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99932:Expr_L4_C8", "label": "expression", "type": "expression", "loc": [4, 4], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99932:FunctionDef_L3_C4", "vector": [8, 2, 0.2, 0.05, 2, 0.78, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"This doc not shown because there are no arguments.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99932:FunctionDef_L6_C4", "label": "keyword", "type": "function", "loc": [6, 11], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99932:ClassDef_L1_C0", "vector": [2, 1, 0.425, 0.3, 1, 0.11, 0.5, 454, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "keyword", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def keyword(self):\n \"\"\"A keyword.\n\n See `get hello` for details and *never* run this keyword.\n \"\"\"\n 1/0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99932:Expr_L7_C8", "label": "expression", "type": "expression", "loc": [7, 10], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99932:FunctionDef_L6_C4", "vector": [8, 2, 0.425, 0.2, 2, 0.28, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"A keyword.\n\n See `get hello` for details and *never* run this keyword.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99932:Expr_L11_C8", "label": "expression", "type": "expression", "loc": [11, 11], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99932:FunctionDef_L6_C4", "vector": [8, 2, 0.55, 0.05, 2, 0.28, 1.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " 1/0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99932:FunctionDef_L13_C4", "label": "get_hello", "type": "function", "loc": [13, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99932:ClassDef_L1_C0", "vector": [2, 1, 0.8, 0.35, 1, 0.11, 1.0, 116, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "get_hello", "arg_names": ["self", "arg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_hello(self, arg):\n \"\"\"Returns 'Hello `arg`!'.\n\n See `importing` for explanation of arguments and `introduction`\n for introduction. Neither of them really exist, though.\n \"\"\"\n return 'Hello %s' % arg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99932:Expr_L14_C8", "label": "expression", "type": "expression", "loc": [14, 18], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99932:FunctionDef_L13_C4", "vector": [8, 2, 0.8, 0.25, 2, 0.6, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Returns 'Hello `arg`!'.\n\n See `importing` for explanation of arguments and `introduction`\n for introduction. Neither of them really exist, though.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99932:Return_L19_C8", "label": "return", "type": "return", "loc": [19, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99932:FunctionDef_L13_C4", "vector": [13, 2, 0.95, 0.05, 2, 0.6, 1.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'Hello %s' % arg"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99932:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99932:FunctionDef_L3_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99932:FunctionDef_L3_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99932:Expr_L4_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99932:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99932:FunctionDef_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99932:FunctionDef_L6_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99932:Expr_L7_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99932:FunctionDef_L6_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99932:Expr_L11_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99932:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99932:FunctionDef_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99932:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99932:Expr_L14_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99932:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99932:Return_L19_C8"}] |
class dynamic:
def get_keyword_names(self):
return ['Keyword 1', 'KW 2']
def run_keyword(self, name, args):
print name, args
def get_keyword_arguments(self, name):
return [ 'arg%d' % (i+1) for i in range(int(name[-1])) ]
def get_keyword_documentation(self, name):
return '''Dummy documentation for `%s`.
Neither `Keyword 1` or `KW 2` do anything really interesting.
They do, however, accept some `arguments`.
Examples:
| Keyword 1 | arg |
| KW 1 | arg | arg 2 |
| KW 2 | arg | arg 2 |
-------
http://robotframework.org
''' % name
| ajibawa-2023/Python-Code-Large/train/row_99933 | 9 | 26 | 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_99933:ClassDef_L1_C0", "label": "dynamic", "type": "class", "loc": [1, 26], "level": 0, "parent": null, "vector": [3, 0, 0.5192, 1.0, 0, 0.66, 0.0, 670, 0, 4, 0, 0, 0, 0, 3], "semantic": {"name": "dynamic", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class dynamic:\n\n def get_keyword_names(self):\n return ['Keyword 1', 'KW 2']\n\n def run_keyword(self, name, args):\n print(name, args)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99933:FunctionDef_L3_C4", "label": "get_keyword_names", "type": "function", "loc": [3, 4], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99933:ClassDef_L1_C0", "vector": [2, 1, 0.1346, 0.0769, 1, 0.03, 0.0, 768, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "get_keyword_names", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_keyword_names(self):\n return ['Keyword 1', 'KW 2']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99933:Return_L4_C8", "label": "return", "type": "return", "loc": [4, 4], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99933:FunctionDef_L3_C4", "vector": [13, 2, 0.1538, 0.0385, 2, 0.66, 0.0, 0, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ['Keyword 1', 'KW 2']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99933:FunctionDef_L6_C4", "label": "run_keyword", "type": "function", "loc": [6, 7], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99933:ClassDef_L1_C0", "vector": [2, 1, 0.25, 0.0769, 1, 0.03, 0.3333, 458, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "run_keyword", "arg_names": ["self", "name", "args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def run_keyword(self, name, args):\n print(name, args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99933:Expr_L7_C8", "label": "print()", "type": "expression", "loc": [7, 7], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99933:FunctionDef_L6_C4", "vector": [8, 2, 0.2692, 0.0385, 2, 0.13, 0.0, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(name, args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99933:FunctionDef_L9_C4", "label": "get_keyword_arguments", "type": "function", "loc": [9, 10], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99933:ClassDef_L1_C0", "vector": [2, 1, 0.3654, 0.0769, 1, 0.03, 0.6667, 234, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "get_keyword_arguments", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_keyword_arguments(self, name):\n return [ 'arg%d' % (i+1) for i in range(int(name[-1])) ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99933:Return_L10_C8", "label": "return", "type": "return", "loc": [10, 10], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99933:FunctionDef_L9_C4", "vector": [13, 2, 0.3846, 0.0385, 2, 0.57, 0.0, 0, 5, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [ 'arg%d' % (i+1) for i in range(int(name[-1])) ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99933:FunctionDef_L12_C4", "label": "get_keyword_documentation", "type": "function", "loc": [12, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99933:ClassDef_L1_C0", "vector": [2, 1, 0.7308, 0.5769, 1, 0.03, 1.0, 886, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "get_keyword_documentation", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_keyword_documentation(self, name):\n return '''Dummy documentation for `%s`.\n\nNeither `Keyword 1` or `KW 2` do anything really interesting.\nThey do, however, accept some `arguments`.\n\nExamples:\n| Keyword 1 | arg |"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99933:Return_L13_C8", "label": "return", "type": "return", "loc": [13, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99933:FunctionDef_L12_C4", "vector": [13, 2, 0.75, 0.5385, 2, 0.42, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '''Dummy documentation for `%s`.\n\nNeither `Keyword 1` or `KW 2` do anything really interesting.\nThey do, however, accept some `arguments`.\n\nExamples:\n| Keyword 1 | arg |\n| KW 1 | arg | arg 2 |"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99933:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99933:FunctionDef_L3_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99933:FunctionDef_L3_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99933:Return_L4_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99933:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99933:FunctionDef_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99933:FunctionDef_L6_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99933:Expr_L7_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99933:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99933:FunctionDef_L9_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99933:FunctionDef_L9_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99933:Return_L10_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99933:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99933:FunctionDef_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99933:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99933:Return_L13_C8"}] |
u"""Module test library.
With some non-ascii stuff:
Hyv\u00E4\u00E4 y\u00F6t\u00E4.
\u0421\u043F\u0430\u0441\u0438\u0431\u043E!
"""
ROBOT_LIBRARY_VERSION = '0.1-alpha'
def keyword():
"""A keyword
See `get hello` for details"""
pass
def get_hello():
"""Get the intialization variables
See `importing` for explanation of arguments
and `introduction` for introduction"""
return 'foo'
| ajibawa-2023/Python-Code-Large/train/row_99934 | 7 | 23 | 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_99934:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 7], "level": 0, "parent": null, "vector": [8, 0, 0.1739, 0.3043, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "u\"\"\"Module test library.\n\nWith some non-ascii stuff:\n\nHyv\\u00E4\\u00E4 y\\u00F6t\\u00E4.\n\\u0421\\u043F\\u0430\\u0441\\u0438\\u0431\\u043E!\n\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99934:Assign_L9_C0", "label": "ROBOT_LIBRARY_VERSION =", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.3913, 0.0435, 0, 0.66, 0.3333, 466, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ROBOT_LIBRARY_VERSION", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "ROBOT_LIBRARY_VERSION = '0.1-alpha'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99934:FunctionDef_L12_C0", "label": "keyword", "type": "function", "loc": [12, 16], "level": 0, "parent": null, "vector": [2, 0, 0.6087, 0.2174, 0, 0.66, 0.6667, 454, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "keyword", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def keyword():\n \"\"\"A keyword\n\n See `get hello` for details\"\"\"\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99934:Expr_L13_C4", "label": "expression", "type": "expression", "loc": [13, 15], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99934:FunctionDef_L12_C0", "vector": [8, 1, 0.6087, 0.1304, 1, 0.17, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"A keyword\n\n See `get hello` for details\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99934:FunctionDef_L18_C0", "label": "get_hello", "type": "function", "loc": [18, 23], "level": 0, "parent": null, "vector": [2, 0, 0.8913, 0.2609, 0, 0.66, 1.0, 116, 0, 0, 1, 0, 0, 0, 0], "semantic": {"name": "get_hello", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def get_hello():\n \"\"\"Get the intialization variables\n\n See `importing` for explanation of arguments\n and `introduction` for introduction\"\"\"\n return 'foo'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99934:Expr_L19_C4", "label": "expression", "type": "expression", "loc": [19, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99934:FunctionDef_L18_C0", "vector": [8, 1, 0.8913, 0.1739, 1, 0.63, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Get the intialization variables\n\n See `importing` for explanation of arguments\n and `introduction` for introduction\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99934:Return_L23_C4", "label": "return", "type": "return", "loc": [23, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99934:FunctionDef_L18_C0", "vector": [13, 1, 1.0, 0.0435, 1, 0.63, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'foo'"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99934:FunctionDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99934:Expr_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99934:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99934:Expr_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99934:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99934:Return_L23_C4"}] |
#!/usr/bin/env python
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Robot Framework Debugfile Viewer
Usage: fileviever.py [path]
This tool is mainly targeted for viewing Robot Framework debug files set
with '--debugfile' command line option when running test. The idea is to
provide a tool that has similar functionality as 'tail -f' command in
unixy systems.
The tool has a simple GUI which is updated every time the file opened into
it is updated. File can be given from command line or opened using 'Open'
button in the GUI.
"""
import os
import sys
import time
from FileDialog import LoadFileDialog
import Tkinter as Tk
class FileViewer:
def __init__(self, path=None):
self._path = path is not None and os.path.abspath(path) or None
self._file = self._open_file(path)
self._root = self._create_root()
self._create_components(self._root)
self._last_update_cmd = None
self._update()
def mainloop(self):
self._root.mainloop()
def _create_root(self):
root = Tk.Tk()
root.title('Debug file viewer, v0.1')
root.geometry('750x500+100+100')
return root
def _create_components(self, root):
self._create_toolbar(root)
self._create_statusbar(root)
self._text_area = self._create_scrollable_text_area(root)
def _create_statusbar(self, root):
statusbar = Tk.Frame(root)
self._statusbar_left = Tk.Label(statusbar)
self._statusbar_left.pack(side=Tk.LEFT)
self._statusbar_right = Tk.Label(statusbar)
self._statusbar_right.pack(side=Tk.RIGHT)
statusbar.pack(side=Tk.BOTTOM, fill=Tk.X)
def _create_toolbar(self, root):
toolbar = Tk.Frame(root, width=65)
self._create_button(toolbar, 'Open', self._open_file_dialog)
self._create_button(toolbar, 'Clear', self._clear_text)
self._create_button(toolbar, 'Exit', self._root.destroy)
self._pause_cont_button = self._create_button(toolbar, 'Pause',
self._pause_or_cont, 25)
toolbar.pack_propagate(0)
toolbar.pack(side=Tk.RIGHT, fill=Tk.Y)
def _create_button(self, parent, label, command, pady=2):
button = Tk.Button(parent, text=label, command=command)
button.pack(side=Tk.TOP, padx=2, pady=pady, fill=Tk.X)
return button
def _create_scrollable_text_area(self, root):
scrollbar = Tk.Scrollbar(root)
text = Tk.Text(root, yscrollcommand=scrollbar.set, font=("Courier", 9))
scrollbar.config(command=text.yview)
scrollbar.pack(side=Tk.RIGHT, fill=Tk.Y)
text.pack(fill=Tk.BOTH, expand=1)
return text
def _pause_or_cont(self):
if self._pause_cont_button['text'] == 'Pause':
if self._last_update_cmd is not None:
self._root.after_cancel(self._last_update_cmd)
self._pause_cont_button.configure(text='Continue')
else:
self._pause_cont_button.configure(text='Pause')
self._root.after(50, self._update)
def _update(self):
if self._file is None:
self._file = self._open_file(self._path)
if self._file is not None:
try:
if os.stat(self._path).st_size < self._last_file_size:
self._file.seek(0)
self._clear_text()
self._text_area.insert(Tk.END, self._file.read())
self._last_file_size = self._file.tell()
except (OSError, IOError):
self._file = None
self._clear_text()
self._text_area.yview('moveto', '1.0')
self._set_status_bar_text()
self._last_update_cmd = self._root.after(50, self._update)
def _clear_text(self):
self._text_area.delete(1.0, Tk.END)
def _set_status_bar_text(self):
left, right = self._path, ''
if self._path is None:
left = 'No file opened'
elif self._file is None:
right = 'File does not exist'
else:
timetuple = time.localtime(os.stat(self._path).st_mtime)
timestamp = '%d%02d%02d %02d:%02d:%02d' % timetuple[:6]
right = 'File last modified: %s' % timestamp
self._statusbar_left.configure(text=left)
self._statusbar_right.configure(text=right)
def _open_file(self, path):
if path is not None and os.path.exists(path):
self._last_file_size = os.stat(path).st_size
return open(path)
return None
def _open_file_dialog(self):
dialog = LoadFileDialog(self._root, title='Choose file to view')
fname = dialog.go()
if fname is None:
return
self._path = os.path.abspath(fname)
if self._last_update_cmd is not None:
self._root.after_cancel(self._last_update_cmd)
if self._file is not None:
self._file.close()
self._file = self._open_file(self._path)
self._clear_text()
if self._pause_cont_button['text'] == 'Continue':
self._pause_or_cont()
else:
self._update()
if __name__ == '__main__':
if len(sys.argv) > 2 or '--help' in sys.argv:
print __doc__
sys.exit(1)
app = FileViewer(*sys.argv[1:])
app.mainloop()
| ajibawa-2023/Python-Code-Large/train/row_99935 | 112 | 166 | 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_99935:Expr_L18_C0", "label": "expression", "type": "expression", "loc": [18, 30], "level": 0, "parent": null, "vector": [8, 0, 0.1446, 0.0783, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"Robot Framework Debugfile Viewer\n\nUsage: fileviever.py [path]\n\nThis tool is mainly targeted for viewing Robot Framework debug files set\nwith '--debugfile' command line option when running test. The idea is to\nprovide a tool that has similar functionality as 'tail -f' command in \nunixy systems."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Import_L32_C0", "label": "os import os", "type": "import", "loc": [32, 32], "level": 0, "parent": null, "vector": [1, 0, 0.1928, 0.006, 0, 0.66, 0.1429, 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_99935:Import_L33_C0", "label": "sys import sys", "type": "import", "loc": [33, 33], "level": 0, "parent": null, "vector": [1, 0, 0.1988, 0.006, 0, 0.66, 0.2857, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Import_L34_C0", "label": "time import time", "type": "import", "loc": [34, 34], "level": 0, "parent": null, "vector": [1, 0, 0.2048, 0.006, 0, 0.66, 0.4286, 654, 0, 1, 0, 0, 654, 0, 0], "semantic": {"name": "time", "arg_names": [], "import_names": ["time"], "rhs_call_name": "", "annotation": ""}, "snippet": "import time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:ImportFrom_L36_C0", "label": "from FileDialog import LoadFileDialog", "type": "import", "loc": [36, 36], "level": 0, "parent": null, "vector": [1, 0, 0.2169, 0.006, 0, 0.66, 0.5714, 281, 0, 1, 0, 0, 281, 0, 0], "semantic": {"name": "FileDialog", "arg_names": [], "import_names": ["LoadFileDialog"], "rhs_call_name": "", "annotation": ""}, "snippet": "from FileDialog import LoadFileDialog"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Import_L37_C0", "label": "Tkinter import Tk", "type": "import", "loc": [37, 37], "level": 0, "parent": null, "vector": [1, 0, 0.2229, 0.006, 0, 0.66, 0.7143, 368, 0, 1, 0, 0, 368, 0, 0], "semantic": {"name": "Tkinter", "arg_names": [], "import_names": ["Tk"], "rhs_call_name": "", "annotation": ""}, "snippet": "import Tkinter as Tk"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:ClassDef_L40_C0", "label": "FileViewer", "type": "class", "loc": [40, 158], "level": 0, "parent": null, "vector": [3, 0, 0.5964, 0.7169, 0, 0.66, 0.8571, 476, 0, 14, 0, 0, 0, 0, 64], "semantic": {"name": "FileViewer", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class FileViewer:\n \n def __init__(self, path=None):\n self._path = path is not None and os.path.abspath(path) or None\n self._file = self._open_file(path)\n self._root = self._create_root()\n self._create_components(self._root)\n self._last_update_cmd = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L42_C4", "label": "__init__", "type": "function", "loc": [42, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:ClassDef_L40_C0", "vector": [2, 1, 0.2711, 0.0422, 1, 0.43, 0.0, 555, 0, 2, 0, 0, 0, 0, 5], "semantic": {"name": "__init__", "arg_names": ["self", "path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, path=None):\n self._path = path is not None and os.path.abspath(path) or None\n self._file = self._open_file(path)\n self._root = self._create_root()\n self._create_components(self._root)\n self._last_update_cmd = None\n self._update()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Assign_L43_C8", "label": "self._path =", "type": "assigned_variable", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L42_C4", "vector": [14, 2, 0.259, 0.006, 2, 0.46, 0.0, 249, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self._path", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._path = path is not None and os.path.abspath(path) or None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Assign_L44_C8", "label": "self._file = _open_file()", "type": "assigned_variable", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L42_C4", "vector": [14, 2, 0.2651, 0.006, 2, 0.46, 0.2, 852, 3, 1, 0, 0, 924, 10, 1], "semantic": {"name": "self._file", "arg_names": [], "import_names": [], "rhs_call_name": "_open_file", "annotation": ""}, "snippet": " self._file = self._open_file(path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Assign_L45_C8", "label": "self._root = _create_root()", "type": "assigned_variable", "loc": [45, 45], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L42_C4", "vector": [14, 2, 0.2711, 0.006, 2, 0.46, 0.4, 600, 3, 0, 0, 0, 578, 10, 1], "semantic": {"name": "self._root", "arg_names": [], "import_names": [], "rhs_call_name": "_create_root", "annotation": ""}, "snippet": " self._root = self._create_root()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L46_C8", "label": "_create_components()", "type": "expression", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L42_C4", "vector": [8, 2, 0.2771, 0.006, 2, 0.46, 0.6, 423, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_create_components", "arg_names": [], "import_names": [], "rhs_call_name": "_create_components", "annotation": ""}, "snippet": " self._create_components(self._root)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Assign_L47_C8", "label": "self._last_update_cmd =", "type": "assigned_variable", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L42_C4", "vector": [14, 2, 0.2831, 0.006, 2, 0.46, 0.8, 84, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self._last_update_cmd", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._last_update_cmd = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L48_C8", "label": "_update()", "type": "expression", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L42_C4", "vector": [8, 2, 0.2892, 0.006, 2, 0.46, 1.0, 417, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_update", "arg_names": [], "import_names": [], "rhs_call_name": "_update", "annotation": ""}, "snippet": " self._update()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L50_C4", "label": "mainloop", "type": "function", "loc": [50, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:ClassDef_L40_C0", "vector": [2, 1, 0.3042, 0.012, 1, 0.43, 0.0769, 192, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "mainloop", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def mainloop(self):\n self._root.mainloop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L51_C8", "label": "mainloop()", "type": "expression", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L50_C4", "vector": [8, 2, 0.3072, 0.006, 2, 0.72, 0.0, 192, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "mainloop", "arg_names": [], "import_names": [], "rhs_call_name": "mainloop", "annotation": ""}, "snippet": " self._root.mainloop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L53_C4", "label": "_create_root", "type": "function", "loc": [53, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:ClassDef_L40_C0", "vector": [2, 1, 0.3313, 0.0301, 1, 0.43, 0.1538, 578, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "_create_root", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _create_root(self):\n root = Tk.Tk()\n root.title('Debug file viewer, v0.1')\n root.geometry('750x500+100+100')\n return root"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Assign_L54_C8", "label": "root = Tk()", "type": "assigned_variable", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L53_C4", "vector": [14, 2, 0.3253, 0.006, 2, 0.43, 0.0, 696, 3, 0, 0, 0, 309, 10, 1], "semantic": {"name": "root", "arg_names": [], "import_names": [], "rhs_call_name": "Tk", "annotation": ""}, "snippet": " root = Tk.Tk()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L55_C8", "label": "title()", "type": "expression", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L53_C4", "vector": [8, 2, 0.3313, 0.006, 2, 0.43, 0.3333, 48, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "title", "arg_names": [], "import_names": [], "rhs_call_name": "title", "annotation": ""}, "snippet": " root.title('Debug file viewer, v0.1')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L56_C8", "label": "geometry()", "type": "expression", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L53_C4", "vector": [8, 2, 0.3373, 0.006, 2, 0.43, 0.6667, 486, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "geometry", "arg_names": [], "import_names": [], "rhs_call_name": "geometry", "annotation": ""}, "snippet": " root.geometry('750x500+100+100')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Return_L57_C8", "label": "return", "type": "return", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L53_C4", "vector": [13, 2, 0.3434, 0.006, 2, 0.43, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return root"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L59_C4", "label": "_create_components", "type": "function", "loc": [59, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:ClassDef_L40_C0", "vector": [2, 1, 0.3645, 0.0241, 1, 0.43, 0.2308, 423, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "_create_components", "arg_names": ["self", "root"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _create_components(self, root):\n self._create_toolbar(root)\n self._create_statusbar(root)\n self._text_area = self._create_scrollable_text_area(root)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L60_C8", "label": "_create_toolbar()", "type": "expression", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L59_C4", "vector": [8, 2, 0.3614, 0.006, 2, 0.93, 0.0, 678, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_create_toolbar", "arg_names": [], "import_names": [], "rhs_call_name": "_create_toolbar", "annotation": ""}, "snippet": " self._create_toolbar(root)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L61_C8", "label": "_create_statusbar()", "type": "expression", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L59_C4", "vector": [8, 2, 0.3675, 0.006, 2, 0.93, 0.5, 126, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_create_statusbar", "arg_names": [], "import_names": [], "rhs_call_name": "_create_statusbar", "annotation": ""}, "snippet": " self._create_statusbar(root)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Assign_L62_C8", "label": "self._text_area = _create_scrollable_text_area()", "type": "assigned_variable", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L59_C4", "vector": [14, 2, 0.3735, 0.006, 2, 0.93, 1.0, 926, 3, 1, 0, 0, 929, 10, 1], "semantic": {"name": "self._text_area", "arg_names": [], "import_names": [], "rhs_call_name": "_create_scrollable_text_area", "annotation": ""}, "snippet": " self._text_area = self._create_scrollable_text_area(root)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L64_C4", "label": "_create_statusbar", "type": "function", "loc": [64, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:ClassDef_L40_C0", "vector": [2, 1, 0.4036, 0.0422, 1, 0.43, 0.3077, 126, 0, 2, 0, 0, 0, 0, 6], "semantic": {"name": "_create_statusbar", "arg_names": ["self", "root"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _create_statusbar(self, root):\n statusbar = Tk.Frame(root)\n self._statusbar_left = Tk.Label(statusbar)\n self._statusbar_left.pack(side=Tk.LEFT)\n self._statusbar_right = Tk.Label(statusbar)\n self._statusbar_right.pack(side=Tk.RIGHT)\n statusbar.pack(side=Tk.BOTTOM, fill=Tk.X)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Assign_L65_C8", "label": "statusbar = Frame()", "type": "assigned_variable", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L64_C4", "vector": [14, 2, 0.3916, 0.006, 2, 0.35, 0.0, 375, 3, 1, 0, 0, 342, 10, 1], "semantic": {"name": "statusbar", "arg_names": [], "import_names": [], "rhs_call_name": "Frame", "annotation": ""}, "snippet": " statusbar = Tk.Frame(root)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Assign_L66_C8", "label": "self._statusbar_left = Label()", "type": "assigned_variable", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L64_C4", "vector": [14, 2, 0.3976, 0.006, 2, 0.35, 0.2, 455, 3, 1, 0, 0, 413, 10, 1], "semantic": {"name": "self._statusbar_left", "arg_names": [], "import_names": [], "rhs_call_name": "Label", "annotation": ""}, "snippet": " self._statusbar_left = Tk.Label(statusbar)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L67_C8", "label": "pack()", "type": "expression", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L64_C4", "vector": [8, 2, 0.4036, 0.006, 2, 0.35, 0.4, 742, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "pack", "arg_names": [], "import_names": [], "rhs_call_name": "pack", "annotation": ""}, "snippet": " self._statusbar_left.pack(side=Tk.LEFT)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Assign_L68_C8", "label": "self._statusbar_right = Label()", "type": "assigned_variable", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L64_C4", "vector": [14, 2, 0.4096, 0.006, 2, 0.35, 0.6, 83, 3, 1, 0, 0, 413, 10, 1], "semantic": {"name": "self._statusbar_right", "arg_names": [], "import_names": [], "rhs_call_name": "Label", "annotation": ""}, "snippet": " self._statusbar_right = Tk.Label(statusbar)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L69_C8", "label": "pack()", "type": "expression", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L64_C4", "vector": [8, 2, 0.4157, 0.006, 2, 0.35, 0.8, 742, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "pack", "arg_names": [], "import_names": [], "rhs_call_name": "pack", "annotation": ""}, "snippet": " self._statusbar_right.pack(side=Tk.RIGHT)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L70_C8", "label": "pack()", "type": "expression", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L64_C4", "vector": [8, 2, 0.4217, 0.006, 2, 0.35, 1.0, 742, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "pack", "arg_names": [], "import_names": [], "rhs_call_name": "pack", "annotation": ""}, "snippet": " statusbar.pack(side=Tk.BOTTOM, fill=Tk.X)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L72_C4", "label": "_create_toolbar", "type": "function", "loc": [72, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:ClassDef_L40_C0", "vector": [2, 1, 0.4578, 0.0542, 1, 0.43, 0.3846, 678, 0, 2, 0, 0, 0, 0, 7], "semantic": {"name": "_create_toolbar", "arg_names": ["self", "root"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _create_toolbar(self, root):\n toolbar = Tk.Frame(root, width=65)\n self._create_button(toolbar, 'Open', self._open_file_dialog)\n self._create_button(toolbar, 'Clear', self._clear_text)\n self._create_button(toolbar, 'Exit', self._root.destroy)\n self._pause_cont_button = self._create_button(toolbar, 'Pause', \n self._pause_or_cont, 25)\n toolbar.pack_propagate(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Assign_L73_C8", "label": "toolbar = Frame()", "type": "assigned_variable", "loc": [73, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L72_C4", "vector": [14, 2, 0.4398, 0.006, 2, 0.51, 0.0, 746, 3, 2, 0, 0, 342, 10, 1], "semantic": {"name": "toolbar", "arg_names": [], "import_names": [], "rhs_call_name": "Frame", "annotation": ""}, "snippet": " toolbar = Tk.Frame(root, width=65)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L74_C8", "label": "_create_button()", "type": "expression", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L72_C4", "vector": [8, 2, 0.4458, 0.006, 2, 0.51, 0.1667, 597, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "_create_button", "arg_names": [], "import_names": [], "rhs_call_name": "_create_button", "annotation": ""}, "snippet": " self._create_button(toolbar, 'Open', self._open_file_dialog)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L75_C8", "label": "_create_button()", "type": "expression", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L72_C4", "vector": [8, 2, 0.4518, 0.006, 2, 0.51, 0.3333, 597, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "_create_button", "arg_names": [], "import_names": [], "rhs_call_name": "_create_button", "annotation": ""}, "snippet": " self._create_button(toolbar, 'Clear', self._clear_text)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L76_C8", "label": "_create_button()", "type": "expression", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L72_C4", "vector": [8, 2, 0.4578, 0.006, 2, 0.51, 0.5, 597, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "_create_button", "arg_names": [], "import_names": [], "rhs_call_name": "_create_button", "annotation": ""}, "snippet": " self._create_button(toolbar, 'Exit', self._root.destroy)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Assign_L77_C8", "label": "self._pause_cont_button = _create_button()", "type": "assigned_variable", "loc": [77, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L72_C4", "vector": [14, 2, 0.4669, 0.012, 2, 0.51, 0.6667, 164, 3, 4, 0, 0, 597, 10, 1], "semantic": {"name": "self._pause_cont_button", "arg_names": [], "import_names": [], "rhs_call_name": "_create_button", "annotation": ""}, "snippet": " self._pause_cont_button = self._create_button(toolbar, 'Pause', \n self._pause_or_cont, 25)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L79_C8", "label": "pack_propagate()", "type": "expression", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L72_C4", "vector": [8, 2, 0.4759, 0.006, 2, 0.51, 0.8333, 621, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "pack_propagate", "arg_names": [], "import_names": [], "rhs_call_name": "pack_propagate", "annotation": ""}, "snippet": " toolbar.pack_propagate(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L80_C8", "label": "pack()", "type": "expression", "loc": [80, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L72_C4", "vector": [8, 2, 0.4819, 0.006, 2, 0.51, 1.0, 742, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "pack", "arg_names": [], "import_names": [], "rhs_call_name": "pack", "annotation": ""}, "snippet": " toolbar.pack(side=Tk.RIGHT, fill=Tk.Y)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L82_C4", "label": "_create_button", "type": "function", "loc": [82, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:ClassDef_L40_C0", "vector": [2, 1, 0.503, 0.0241, 1, 0.43, 0.4615, 597, 0, 5, 1, 0, 0, 0, 2], "semantic": {"name": "_create_button", "arg_names": ["self", "parent", "label", "command", "pady"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _create_button(self, parent, label, command, pady=2):\n button = Tk.Button(parent, text=label, command=command)\n button.pack(side=Tk.TOP, padx=2, pady=pady, fill=Tk.X)\n return button"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Assign_L83_C8", "label": "button = Button()", "type": "assigned_variable", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L82_C4", "vector": [14, 2, 0.5, 0.006, 2, 0.02, 0.0, 95, 3, 3, 0, 0, 608, 10, 1], "semantic": {"name": "button", "arg_names": [], "import_names": [], "rhs_call_name": "Button", "annotation": ""}, "snippet": " button = Tk.Button(parent, text=label, command=command)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L84_C8", "label": "pack()", "type": "expression", "loc": [84, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L82_C4", "vector": [8, 2, 0.506, 0.006, 2, 0.02, 0.5, 742, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "pack", "arg_names": [], "import_names": [], "rhs_call_name": "pack", "annotation": ""}, "snippet": " button.pack(side=Tk.TOP, padx=2, pady=pady, fill=Tk.X)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Return_L85_C8", "label": "return", "type": "return", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L82_C4", "vector": [13, 2, 0.512, 0.006, 2, 0.02, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return button"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L87_C4", "label": "_create_scrollable_text_area", "type": "function", "loc": [87, 93], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:ClassDef_L40_C0", "vector": [2, 1, 0.5422, 0.0422, 1, 0.43, 0.5385, 929, 0, 2, 1, 0, 0, 0, 5], "semantic": {"name": "_create_scrollable_text_area", "arg_names": ["self", "root"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _create_scrollable_text_area(self, root):\n scrollbar = Tk.Scrollbar(root)\n text = Tk.Text(root, yscrollcommand=scrollbar.set, font=(\"Courier\", 9))\n scrollbar.config(command=text.yview)\n scrollbar.pack(side=Tk.RIGHT, fill=Tk.Y)\n text.pack(fill=Tk.BOTH, expand=1)\n return text"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Assign_L88_C8", "label": "scrollbar = Scrollbar()", "type": "assigned_variable", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L87_C4", "vector": [14, 2, 0.5301, 0.006, 2, 0.84, 0.0, 306, 3, 1, 0, 0, 233, 10, 1], "semantic": {"name": "scrollbar", "arg_names": [], "import_names": [], "rhs_call_name": "Scrollbar", "annotation": ""}, "snippet": " scrollbar = Tk.Scrollbar(root)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Assign_L89_C8", "label": "text = Text()", "type": "assigned_variable", "loc": [89, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L87_C4", "vector": [14, 2, 0.5361, 0.006, 2, 0.84, 0.2, 439, 3, 3, 0, 0, 833, 10, 1], "semantic": {"name": "text", "arg_names": [], "import_names": [], "rhs_call_name": "Text", "annotation": ""}, "snippet": " text = Tk.Text(root, yscrollcommand=scrollbar.set, font=(\"Courier\", 9))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L90_C8", "label": "config()", "type": "expression", "loc": [90, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L87_C4", "vector": [8, 2, 0.5422, 0.006, 2, 0.84, 0.4, 308, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "config", "arg_names": [], "import_names": [], "rhs_call_name": "config", "annotation": ""}, "snippet": " scrollbar.config(command=text.yview)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L91_C8", "label": "pack()", "type": "expression", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L87_C4", "vector": [8, 2, 0.5482, 0.006, 2, 0.84, 0.6, 742, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "pack", "arg_names": [], "import_names": [], "rhs_call_name": "pack", "annotation": ""}, "snippet": " scrollbar.pack(side=Tk.RIGHT, fill=Tk.Y)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L92_C8", "label": "pack()", "type": "expression", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L87_C4", "vector": [8, 2, 0.5542, 0.006, 2, 0.84, 0.8, 742, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "pack", "arg_names": [], "import_names": [], "rhs_call_name": "pack", "annotation": ""}, "snippet": " text.pack(fill=Tk.BOTH, expand=1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Return_L93_C8", "label": "return", "type": "return", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L87_C4", "vector": [13, 2, 0.5602, 0.006, 2, 0.84, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return text"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L95_C4", "label": "_pause_or_cont", "type": "function", "loc": [95, 102], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:ClassDef_L40_C0", "vector": [2, 1, 0.5934, 0.0482, 1, 0.43, 0.6154, 762, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "_pause_or_cont", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _pause_or_cont(self):\n if self._pause_cont_button['text'] == 'Pause':\n if self._last_update_cmd is not None:\n self._root.after_cancel(self._last_update_cmd)\n self._pause_cont_button.configure(text='Continue')\n else:\n self._pause_cont_button.configure(text='Pause')\n self._root.after(50, self._update)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L96_C8", "label": "if", "type": "if", "loc": [96, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L95_C4", "vector": [4, 2, 0.5964, 0.0422, 2, 0.66, 0.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._pause_cont_button['text'] == 'Pause':\n if self._last_update_cmd is not None:\n self._root.after_cancel(self._last_update_cmd)\n self._pause_cont_button.configure(text='Continue')\n else:\n self._pause_cont_button.configure(text='Pause')\n self._root.after(50, self._update)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L97_C12", "label": "if", "type": "if", "loc": [97, 98], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L96_C8", "vector": [4, 3, 0.5873, 0.012, 3, 0.76, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._last_update_cmd is not None:\n self._root.after_cancel(self._last_update_cmd)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L98_C16", "label": "after_cancel()", "type": "expression", "loc": [98, 98], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L97_C12", "vector": [8, 4, 0.5904, 0.006, 4, 0.92, 0.0, 953, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "after_cancel", "arg_names": [], "import_names": [], "rhs_call_name": "after_cancel", "annotation": ""}, "snippet": " self._root.after_cancel(self._last_update_cmd)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L99_C12", "label": "configure()", "type": "expression", "loc": [99, 99], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L96_C8", "vector": [8, 3, 0.5964, 0.006, 3, 0.76, 0.3333, 765, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "configure", "arg_names": [], "import_names": [], "rhs_call_name": "configure", "annotation": ""}, "snippet": " self._pause_cont_button.configure(text='Continue')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L101_C12", "label": "configure()", "type": "expression", "loc": [101, 101], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L96_C8", "vector": [8, 3, 0.6084, 0.006, 3, 0.76, 0.6667, 765, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "configure", "arg_names": [], "import_names": [], "rhs_call_name": "configure", "annotation": ""}, "snippet": " self._pause_cont_button.configure(text='Pause')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L102_C12", "label": "after()", "type": "expression", "loc": [102, 102], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L96_C8", "vector": [8, 3, 0.6145, 0.006, 3, 0.76, 1.0, 937, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "after", "arg_names": [], "import_names": [], "rhs_call_name": "after", "annotation": ""}, "snippet": " self._root.after(50, self._update)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L104_C4", "label": "_update", "type": "function", "loc": [104, 119], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:ClassDef_L40_C0", "vector": [2, 1, 0.6717, 0.0964, 1, 0.43, 0.6923, 417, 0, 1, 0, 0, 0, 0, 11], "semantic": {"name": "_update", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _update(self):\n if self._file is None:\n self._file = self._open_file(self._path)\n if self._file is not None:\n try:\n if os.stat(self._path).st_size < self._last_file_size:\n self._file.seek(0)\n self._clear_text()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L105_C8", "label": "if", "type": "if", "loc": [105, 106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L104_C4", "vector": [4, 2, 0.6355, 0.012, 2, 0.82, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._file is None:\n self._file = self._open_file(self._path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Assign_L106_C12", "label": "self._file = _open_file()", "type": "assigned_variable", "loc": [106, 106], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L105_C8", "vector": [14, 3, 0.6386, 0.006, 3, 0.7, 0.0, 852, 3, 1, 0, 0, 924, 10, 1], "semantic": {"name": "self._file", "arg_names": [], "import_names": [], "rhs_call_name": "_open_file", "annotation": ""}, "snippet": " self._file = self._open_file(self._path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L107_C8", "label": "if", "type": "if", "loc": [107, 117], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L104_C4", "vector": [4, 2, 0.6747, 0.0663, 2, 0.82, 0.3333, 0, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._file is not None:\n try:\n if os.stat(self._path).st_size < self._last_file_size:\n self._file.seek(0)\n self._clear_text()\n self._text_area.insert(Tk.END, self._file.read())\n self._last_file_size = self._file.tell()\n except (OSError, IOError):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Try_L108_C12", "label": "try", "type": "try", "loc": [108, 116], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L107_C8", "vector": [7, 3, 0.6747, 0.0542, 3, 0.59, 0.0, 0, 0, 1, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n if os.stat(self._path).st_size < self._last_file_size:\n self._file.seek(0)\n self._clear_text()\n self._text_area.insert(Tk.END, self._file.read())\n self._last_file_size = self._file.tell()\n except (OSError, IOError):\n self._file = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L109_C16", "label": "if", "type": "if", "loc": [109, 111], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:Try_L108_C12", "vector": [4, 4, 0.6627, 0.0181, 4, 0.81, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if os.stat(self._path).st_size < self._last_file_size:\n self._file.seek(0)\n self._clear_text()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L110_C20", "label": "seek()", "type": "expression", "loc": [110, 110], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L109_C16", "vector": [8, 5, 0.6627, 0.006, 5, 0.97, 0.0, 66, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "seek", "arg_names": [], "import_names": [], "rhs_call_name": "seek", "annotation": ""}, "snippet": " self._file.seek(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L111_C20", "label": "_clear_text()", "type": "expression", "loc": [111, 111], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L109_C16", "vector": [8, 5, 0.6687, 0.006, 5, 0.97, 1.0, 246, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_clear_text", "arg_names": [], "import_names": [], "rhs_call_name": "_clear_text", "annotation": ""}, "snippet": " self._clear_text()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L112_C16", "label": "insert()", "type": "expression", "loc": [112, 112], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:Try_L108_C12", "vector": [8, 4, 0.6747, 0.006, 4, 0.81, 0.5, 368, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "insert", "arg_names": [], "import_names": [], "rhs_call_name": "insert", "annotation": ""}, "snippet": " self._text_area.insert(Tk.END, self._file.read())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Assign_L113_C16", "label": "self._last_file_size = tell()", "type": "assigned_variable", "loc": [113, 113], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:Try_L108_C12", "vector": [14, 4, 0.6807, 0.006, 4, 0.81, 1.0, 845, 3, 0, 0, 0, 759, 10, 1], "semantic": {"name": "self._last_file_size", "arg_names": [], "import_names": [], "rhs_call_name": "tell", "annotation": ""}, "snippet": " self._last_file_size = self._file.tell()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Assign_L115_C16", "label": "self._file =", "type": "assigned_variable", "loc": [115, 115], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:Try_L108_C12", "vector": [14, 4, 0.6928, 0.006, 4, 0.81, 0.0, 852, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self._file", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._file = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L116_C16", "label": "_clear_text()", "type": "expression", "loc": [116, 116], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:Try_L108_C12", "vector": [8, 4, 0.6988, 0.006, 4, 0.81, 1.0, 246, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_clear_text", "arg_names": [], "import_names": [], "rhs_call_name": "_clear_text", "annotation": ""}, "snippet": " self._clear_text()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L117_C12", "label": "yview()", "type": "expression", "loc": [117, 117], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L107_C8", "vector": [8, 3, 0.7048, 0.006, 3, 0.59, 1.0, 443, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "yview", "arg_names": [], "import_names": [], "rhs_call_name": "yview", "annotation": ""}, "snippet": " self._text_area.yview('moveto', '1.0')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L118_C8", "label": "_set_status_bar_text()", "type": "expression", "loc": [118, 118], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L104_C4", "vector": [8, 2, 0.7108, 0.006, 2, 0.82, 0.6667, 714, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_set_status_bar_text", "arg_names": [], "import_names": [], "rhs_call_name": "_set_status_bar_text", "annotation": ""}, "snippet": " self._set_status_bar_text()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Assign_L119_C8", "label": "self._last_update_cmd = after()", "type": "assigned_variable", "loc": [119, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L104_C4", "vector": [14, 2, 0.7169, 0.006, 2, 0.82, 1.0, 84, 3, 2, 0, 0, 937, 10, 1], "semantic": {"name": "self._last_update_cmd", "arg_names": [], "import_names": [], "rhs_call_name": "after", "annotation": ""}, "snippet": " self._last_update_cmd = self._root.after(50, self._update)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L121_C4", "label": "_clear_text", "type": "function", "loc": [121, 122], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:ClassDef_L40_C0", "vector": [2, 1, 0.7319, 0.012, 1, 0.43, 0.7692, 246, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_clear_text", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _clear_text(self):\n self._text_area.delete(1.0, Tk.END)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L122_C8", "label": "delete()", "type": "expression", "loc": [122, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L121_C4", "vector": [8, 2, 0.7349, 0.006, 2, 0.42, 0.0, 266, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "delete", "arg_names": [], "import_names": [], "rhs_call_name": "delete", "annotation": ""}, "snippet": " self._text_area.delete(1.0, Tk.END)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L124_C4", "label": "_set_status_bar_text", "type": "function", "loc": [124, 135], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:ClassDef_L40_C0", "vector": [2, 1, 0.7801, 0.0723, 1, 0.43, 0.8462, 714, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "_set_status_bar_text", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _set_status_bar_text(self):\n left, right = self._path, ''\n if self._path is None:\n left = 'No file opened'\n elif self._file is None:\n right = 'File does not exist'\n else:\n timetuple = time.localtime(os.stat(self._path).st_mtime)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Assign_L125_C8", "label": "left, right =", "type": "assigned_variable", "loc": [125, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L124_C4", "vector": [14, 2, 0.753, 0.006, 2, 0.72, 0.0, 628, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "left, right", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " left, right = self._path, ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L126_C8", "label": "if", "type": "if", "loc": [126, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L124_C4", "vector": [4, 2, 0.7801, 0.0482, 2, 0.72, 0.3333, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._path is None:\n left = 'No file opened'\n elif self._file is None:\n right = 'File does not exist'\n else:\n timetuple = time.localtime(os.stat(self._path).st_mtime)\n timestamp = '%d%02d%02d %02d:%02d:%02d' % timetuple[:6]\n right = 'File last modified: %s' % timestamp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Assign_L127_C12", "label": "left =", "type": "assigned_variable", "loc": [127, 127], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L126_C8", "vector": [14, 3, 0.7651, 0.006, 3, 0.24, 0.0, 605, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "left", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " left = 'No file opened'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L128_C8", "label": "if", "type": "if", "loc": [128, 133], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L126_C8", "vector": [4, 3, 0.7861, 0.0361, 3, 0.24, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif self._file is None:\n right = 'File does not exist'\n else:\n timetuple = time.localtime(os.stat(self._path).st_mtime)\n timestamp = '%d%02d%02d %02d:%02d:%02d' % timetuple[:6]\n right = 'File last modified: %s' % timestamp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Assign_L129_C12", "label": "right =", "type": "assigned_variable", "loc": [129, 129], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L128_C8", "vector": [14, 4, 0.7771, 0.006, 4, 0.47, 0.0, 724, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "right", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " right = 'File does not exist'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Assign_L131_C12", "label": "timetuple = localtime()", "type": "assigned_variable", "loc": [131, 131], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L128_C8", "vector": [14, 4, 0.7892, 0.006, 4, 0.47, 0.3333, 908, 3, 1, 0, 0, 227, 10, 2], "semantic": {"name": "timetuple", "arg_names": [], "import_names": [], "rhs_call_name": "localtime", "annotation": ""}, "snippet": " timetuple = time.localtime(os.stat(self._path).st_mtime)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Assign_L132_C12", "label": "timestamp =", "type": "assigned_variable", "loc": [132, 132], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L128_C8", "vector": [14, 4, 0.7952, 0.006, 4, 0.47, 0.6667, 834, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "timestamp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " timestamp = '%d%02d%02d %02d:%02d:%02d' % timetuple[:6]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Assign_L133_C12", "label": "right =", "type": "assigned_variable", "loc": [133, 133], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L128_C8", "vector": [14, 4, 0.8012, 0.006, 4, 0.47, 1.0, 724, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "right", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " right = 'File last modified: %s' % timestamp"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L134_C8", "label": "configure()", "type": "expression", "loc": [134, 134], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L124_C4", "vector": [8, 2, 0.8072, 0.006, 2, 0.72, 0.6667, 765, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "configure", "arg_names": [], "import_names": [], "rhs_call_name": "configure", "annotation": ""}, "snippet": " self._statusbar_left.configure(text=left)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L135_C8", "label": "configure()", "type": "expression", "loc": [135, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L124_C4", "vector": [8, 2, 0.8133, 0.006, 2, 0.72, 1.0, 765, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "configure", "arg_names": [], "import_names": [], "rhs_call_name": "configure", "annotation": ""}, "snippet": " self._statusbar_right.configure(text=right) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L137_C4", "label": "_open_file", "type": "function", "loc": [137, 141], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:ClassDef_L40_C0", "vector": [2, 1, 0.8373, 0.0301, 1, 0.43, 0.9231, 924, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "_open_file", "arg_names": ["self", "path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _open_file(self, path):\n if path is not None and os.path.exists(path):\n self._last_file_size = os.stat(path).st_size\n return open(path)\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L138_C8", "label": "if", "type": "if", "loc": [138, 140], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L137_C4", "vector": [4, 2, 0.8373, 0.0181, 2, 0.09, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if path is not None and os.path.exists(path):\n self._last_file_size = os.stat(path).st_size\n return open(path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Assign_L139_C12", "label": "self._last_file_size =", "type": "assigned_variable", "loc": [139, 139], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L138_C8", "vector": [14, 3, 0.8373, 0.006, 3, 0.01, 0.0, 845, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "self._last_file_size", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._last_file_size = os.stat(path).st_size"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Return_L140_C12", "label": "return", "type": "return", "loc": [140, 140], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L138_C8", "vector": [13, 3, 0.8434, 0.006, 3, 0.01, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return open(path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Return_L141_C8", "label": "return", "type": "return", "loc": [141, 141], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L137_C4", "vector": [13, 2, 0.8494, 0.006, 2, 0.09, 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_99935:FunctionDef_L143_C4", "label": "_open_file_dialog", "type": "function", "loc": [143, 158], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:ClassDef_L40_C0", "vector": [2, 1, 0.9066, 0.0964, 1, 0.43, 1.0, 400, 0, 1, 0, 0, 0, 0, 9], "semantic": {"name": "_open_file_dialog", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _open_file_dialog(self):\n dialog = LoadFileDialog(self._root, title='Choose file to view')\n fname = dialog.go()\n if fname is None:\n return\n self._path = os.path.abspath(fname)\n if self._last_update_cmd is not None:\n self._root.after_cancel(self._last_update_cmd)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Assign_L144_C8", "label": "dialog = LoadFileDialog()", "type": "assigned_variable", "loc": [144, 144], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L143_C4", "vector": [14, 2, 0.8675, 0.006, 2, 0.89, 0.0, 709, 3, 2, 0, 0, 748, 10, 1], "semantic": {"name": "dialog", "arg_names": [], "import_names": [], "rhs_call_name": "LoadFileDialog", "annotation": ""}, "snippet": " dialog = LoadFileDialog(self._root, title='Choose file to view')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Assign_L145_C8", "label": "fname = go()", "type": "assigned_variable", "loc": [145, 145], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L143_C4", "vector": [14, 2, 0.8735, 0.006, 2, 0.89, 0.125, 190, 3, 0, 0, 0, 917, 10, 1], "semantic": {"name": "fname", "arg_names": [], "import_names": [], "rhs_call_name": "go", "annotation": ""}, "snippet": " fname = dialog.go()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L146_C8", "label": "if", "type": "if", "loc": [146, 147], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L143_C4", "vector": [4, 2, 0.8825, 0.012, 2, 0.89, 0.25, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if fname is None:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Return_L147_C12", "label": "return", "type": "return", "loc": [147, 147], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L146_C8", "vector": [13, 3, 0.8855, 0.006, 3, 0.9, 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_99935:Assign_L148_C8", "label": "self._path = abspath()", "type": "assigned_variable", "loc": [148, 148], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L143_C4", "vector": [14, 2, 0.8916, 0.006, 2, 0.89, 0.375, 249, 3, 1, 0, 0, 142, 10, 1], "semantic": {"name": "self._path", "arg_names": [], "import_names": [], "rhs_call_name": "abspath", "annotation": ""}, "snippet": " self._path = os.path.abspath(fname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L149_C8", "label": "if", "type": "if", "loc": [149, 150], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L143_C4", "vector": [4, 2, 0.9006, 0.012, 2, 0.89, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._last_update_cmd is not None:\n self._root.after_cancel(self._last_update_cmd)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L150_C12", "label": "after_cancel()", "type": "expression", "loc": [150, 150], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L149_C8", "vector": [8, 3, 0.9036, 0.006, 3, 0.89, 0.0, 953, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "after_cancel", "arg_names": [], "import_names": [], "rhs_call_name": "after_cancel", "annotation": ""}, "snippet": " self._root.after_cancel(self._last_update_cmd)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L151_C8", "label": "if", "type": "if", "loc": [151, 152], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L143_C4", "vector": [4, 2, 0.9127, 0.012, 2, 0.89, 0.625, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._file is not None:\n self._file.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L152_C12", "label": "close()", "type": "expression", "loc": [152, 152], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L151_C8", "vector": [8, 3, 0.9157, 0.006, 3, 0.71, 0.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " self._file.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Assign_L153_C8", "label": "self._file = _open_file()", "type": "assigned_variable", "loc": [153, 153], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L143_C4", "vector": [14, 2, 0.9217, 0.006, 2, 0.89, 0.75, 852, 3, 1, 0, 0, 924, 10, 1], "semantic": {"name": "self._file", "arg_names": [], "import_names": [], "rhs_call_name": "_open_file", "annotation": ""}, "snippet": " self._file = self._open_file(self._path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L154_C8", "label": "_clear_text()", "type": "expression", "loc": [154, 154], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L143_C4", "vector": [8, 2, 0.9277, 0.006, 2, 0.89, 0.875, 246, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_clear_text", "arg_names": [], "import_names": [], "rhs_call_name": "_clear_text", "annotation": ""}, "snippet": " self._clear_text()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L155_C8", "label": "if", "type": "if", "loc": [155, 158], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L143_C4", "vector": [4, 2, 0.9428, 0.0241, 2, 0.89, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._pause_cont_button['text'] == 'Continue':\n self._pause_or_cont()\n else:\n self._update()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L156_C12", "label": "_pause_or_cont()", "type": "expression", "loc": [156, 156], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L155_C8", "vector": [8, 3, 0.9398, 0.006, 3, 0.65, 0.0, 762, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_pause_or_cont", "arg_names": [], "import_names": [], "rhs_call_name": "_pause_or_cont", "annotation": ""}, "snippet": " self._pause_or_cont()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L158_C12", "label": "_update()", "type": "expression", "loc": [158, 158], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L155_C8", "vector": [8, 3, 0.9518, 0.006, 3, 0.65, 1.0, 417, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_update", "arg_names": [], "import_names": [], "rhs_call_name": "_update", "annotation": ""}, "snippet": " self._update()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L161_C0", "label": "if", "type": "if", "loc": [161, 166], "level": 0, "parent": null, "vector": [4, 0, 0.9849, 0.0361, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n if len(sys.argv) > 2 or '--help' in sys.argv:\n print(__doc__)\n sys.exit(1)\n app = FileViewer(*sys.argv[1:])\n app.mainloop()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L162_C4", "label": "if", "type": "if", "loc": [162, 164], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L161_C0", "vector": [4, 1, 0.9819, 0.0181, 1, 0.33, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(sys.argv) > 2 or '--help' in sys.argv:\n print(__doc__)\n sys.exit(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L163_C8", "label": "print()", "type": "expression", "loc": [163, 163], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L162_C4", "vector": [8, 2, 0.9819, 0.006, 2, 0.67, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(__doc__)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L164_C8", "label": "exit()", "type": "expression", "loc": [164, 164], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L162_C4", "vector": [8, 2, 0.988, 0.006, 2, 0.67, 1.0, 436, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "exit", "arg_names": [], "import_names": [], "rhs_call_name": "exit", "annotation": ""}, "snippet": " sys.exit(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Assign_L165_C4", "label": "app = FileViewer()", "type": "assigned_variable", "loc": [165, 165], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L161_C0", "vector": [14, 1, 0.994, 0.006, 1, 0.33, 0.5, 494, 3, 1, 0, 0, 476, 10, 1], "semantic": {"name": "app", "arg_names": [], "import_names": [], "rhs_call_name": "FileViewer", "annotation": ""}, "snippet": " app = FileViewer(*sys.argv[1:])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L166_C4", "label": "mainloop()", "type": "expression", "loc": [166, 166], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L161_C0", "vector": [8, 1, 1.0, 0.006, 1, 0.33, 1.0, 192, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "mainloop", "arg_names": [], "import_names": [], "rhs_call_name": "mainloop", "annotation": ""}, "snippet": " app.mainloop()"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99935:ClassDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Assign_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Assign_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Assign_L45_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Assign_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:ClassDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:ClassDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Assign_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Return_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:ClassDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Assign_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:ClassDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L64_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Assign_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Assign_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Assign_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L64_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:ClassDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L72_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Assign_L73_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L72_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L72_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L72_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L72_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Assign_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L72_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L72_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L80_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:ClassDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L82_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Assign_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Return_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:ClassDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L87_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Assign_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Assign_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Return_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:ClassDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L95_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L96_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L97_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L97_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L98_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L96_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L99_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L96_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L101_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L96_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L102_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:ClassDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L104_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L105_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Assign_L106_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L107_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Try_L108_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:Try_L108_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L109_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L109_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L110_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L109_C16", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L111_C20"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:Try_L108_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L112_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:Try_L108_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Assign_L113_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:Try_L108_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Assign_L115_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:Try_L108_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L116_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L107_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L117_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L118_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Assign_L119_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:ClassDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L121_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L122_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:ClassDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L124_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L124_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Assign_L125_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L124_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L126_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L126_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Assign_L127_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L126_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L128_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L128_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Assign_L129_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L128_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Assign_L131_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L128_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Assign_L132_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L128_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Assign_L133_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L124_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L134_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L124_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L135_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:ClassDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L137_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L137_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L138_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L138_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Assign_L139_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L138_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Return_L140_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L137_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Return_L141_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:ClassDef_L40_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L143_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Assign_L144_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Assign_L145_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L146_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L146_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Return_L147_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Assign_L148_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L149_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L149_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L150_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L151_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L151_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L152_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Assign_L153_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L154_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:FunctionDef_L143_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L155_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L155_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L156_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L155_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L158_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L161_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L162_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L162_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L163_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L162_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L164_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L161_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Assign_L165_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99935:If_L161_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99935:Expr_L166_C4"}] |
#!/usr/bin/env python
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Robot Framework Test Status Checker
Usage: statuschecker.py infile [outfile]
This tool processes Robot Framework output XML files and checks that test case
statuses and messages are as expected. Main use case is post-processing output
files got when testing Robot Framework test libraries using Robot Framework
itself.
If output file is not given, the input file is considered to be also output
file and it is edited in place.
By default all test cases are expected to 'PASS' and have no message. Changing
the expected status to 'FAIL' is done by having word 'FAIL' (in uppercase)
somewhere in the test case documentation. Expected error message must then be
given after 'FAIL'. Error message can also be specified as a regular
expression by prefixing it with string 'REGEXP:'.
This tool also allows testing the created log messages. They are specified
using a syntax 'LOG x.y:z LEVEL Actual message', which is described in the
tool documentation.
"""
import re
from robot.output import TestSuite
def process_output(inpath, outpath=None):
suite = TestSuite(inpath)
_process_suite(suite)
suite.write_to_file(outpath)
return suite.critical_stats.failed
def _process_suite(suite):
for subsuite in suite.suites:
_process_suite(subsuite)
for test in suite.tests:
_process_test(test)
def _process_test(test):
exp = _Expected(test.doc)
_check_status(test, exp)
if test.status == 'PASS':
_check_logs(test, exp)
def _check_status(test, exp):
if exp.status != test.status:
test.status = 'FAIL'
if exp.status == 'PASS':
test.message = ("Test was expected to PASS but it FAILED. "
"Error message:\n") + test.message
else:
test.message = ("Test was expected to FAIL but it PASSED. "
"Expected message:\n") + exp.message
elif not _message_matches(test.message, exp.message):
test.status = 'FAIL'
test.message = ("Wrong error message.\n\nExpected:\n%s\n\nActual:\n%s\n"
% (exp.message, test.message))
elif test.status == 'FAIL':
test.status = 'PASS'
test.message = 'Original test failed as expected.'
def _message_matches(actual, expected):
if actual == expected:
return True
if expected.startswith('REGEXP:'):
pattern = '^%s$' % expected.replace('REGEXP:', '', 1).strip()
if re.match(pattern, actual, re.DOTALL):
return True
return False
def _check_logs(test, exp):
for kw_indices, msg_index, level, message in exp.logs:
try:
kw = test.keywords[kw_indices[0]]
for index in kw_indices[1:]:
kw = kw.keywords[index]
except IndexError:
indices = '.'.join([ str(i+1) for i in kw_indices ])
test.status = 'FAIL'
test.message = ("Test '%s' does not have keyword with index '%s'"
% (test.name, indices))
return
if len(kw.messages) <= msg_index:
if message != 'NONE':
test.status = 'FAIL'
test.message = ("Keyword '%s' should have had at least %d "
"messages" % (kw.name, msg_index+1))
else:
if _check_log_level(level, test, kw, msg_index):
_check_log_message(message, test, kw, msg_index)
def _check_log_level(expected, test, kw, index):
actual = kw.messages[index].level
if actual == expected:
return True
test.status = 'FAIL'
test.message = ("Wrong level for message %d of keyword '%s'.\n\n"
"Expected: %s\nActual: %s.\n%s"
% (index+1, kw.name, expected, actual, kw.messages[index].message))
return False
def _check_log_message(expected, test, kw, index):
actual = kw.messages[index].message.strip()
if _message_matches(actual, expected):
return True
test.status = 'FAIL'
test.message = ("Wrong content for message %d of keyword '%s'.\n\n"
"Expected:\n%s\n\nActual:\n%s"
% (index+1, kw.name, expected, actual))
return False
class _Expected:
def __init__(self, doc):
self.status, self.message = self._get_status_and_message(doc)
self.logs = self._get_logs(doc)
def _get_status_and_message(self, doc):
if 'FAIL' in doc:
return 'FAIL', doc.split('FAIL', 1)[1].split('LOG', 1)[0].strip()
return 'PASS', ''
def _get_logs(self, doc):
logs = []
for item in doc.split('LOG')[1:]:
index_str, msg_str = item.strip().split(' ', 1)
kw_indices, msg_index = self._get_indices(index_str)
level, message = self._get_log_message(msg_str)
logs.append((kw_indices, msg_index, level, message))
return logs
def _get_indices(self, index_str):
try:
kw_indices, msg_index = index_str.split(':')
except ValueError:
kw_indices, msg_index = index_str, '1'
kw_indices = [ int(index) - 1 for index in kw_indices.split('.') ]
return kw_indices, int(msg_index) - 1
def _get_log_message(self, msg_str):
try:
level, message = msg_str.split(' ', 1)
if level not in ['TRACE', 'DEBUG', 'INFO', 'WARN', 'FAIL']:
raise ValueError
except ValueError:
level, message = 'INFO', msg_str
return level, message
if __name__=='__main__':
import sys
import os
if not 2 <= len(sys.argv) <= 3 or '--help' in sys.argv:
print __doc__
sys.exit(1)
infile = sys.argv[1]
outfile = len(sys.argv) == 3 and sys.argv[2] or None
print "Checking %s" % os.path.abspath(infile)
rc = process_output(infile, outfile)
if outfile:
print "Output %s" % os.path.abspath(outfile)
if rc > 255:
rc = 255
sys.exit(rc)
| ajibawa-2023/Python-Code-Large/train/row_99939 | 111 | 186 | 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_99939:Expr_L18_C0", "label": "expression", "type": "expression", "loc": [18, 39], "level": 0, "parent": null, "vector": [8, 0, 0.1532, 0.1183, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"Robot Framework Test Status Checker\n\nUsage: statuschecker.py infile [outfile]\n\nThis tool processes Robot Framework output XML files and checks that test case\nstatuses and messages are as expected. Main use case is post-processing output\nfiles got when testing Robot Framework test libraries using Robot Framework\nitself. "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:Import_L41_C0", "label": "re import re", "type": "import", "loc": [41, 41], "level": 0, "parent": null, "vector": [1, 0, 0.2204, 0.0054, 0, 0.66, 0.0833, 540, 0, 1, 0, 0, 540, 0, 0], "semantic": {"name": "re", "arg_names": [], "import_names": ["re"], "rhs_call_name": "", "annotation": ""}, "snippet": "import re"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:ImportFrom_L43_C0", "label": "from robot.output import TestSuite", "type": "import", "loc": [43, 43], "level": 0, "parent": null, "vector": [1, 0, 0.2312, 0.0054, 0, 0.66, 0.1667, 596, 0, 1, 0, 0, 596, 0, 0], "semantic": {"name": "robot.output", "arg_names": [], "import_names": ["TestSuite"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot.output import TestSuite"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L46_C0", "label": "process_output", "type": "function", "loc": [46, 50], "level": 0, "parent": null, "vector": [2, 0, 0.2581, 0.0269, 0, 0.66, 0.25, 918, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "process_output", "arg_names": ["inpath", "outpath"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def process_output(inpath, outpath=None):\n suite = TestSuite(inpath)\n _process_suite(suite)\n suite.write_to_file(outpath)\n return suite.critical_stats.failed"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L47_C4", "label": "suite = TestSuite()", "type": "assigned_variable", "loc": [47, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L46_C0", "vector": [14, 1, 0.2527, 0.0054, 1, 0.79, 0.0, 425, 3, 1, 0, 0, 75, 10, 1], "semantic": {"name": "suite", "arg_names": [], "import_names": [], "rhs_call_name": "TestSuite", "annotation": ""}, "snippet": " suite = TestSuite(inpath)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:Expr_L48_C4", "label": "_process_suite()", "type": "expression", "loc": [48, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L46_C0", "vector": [8, 1, 0.2581, 0.0054, 1, 0.79, 0.3333, 503, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_process_suite", "arg_names": [], "import_names": [], "rhs_call_name": "_process_suite", "annotation": ""}, "snippet": " _process_suite(suite)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:Expr_L49_C4", "label": "write_to_file()", "type": "expression", "loc": [49, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L46_C0", "vector": [8, 1, 0.2634, 0.0054, 1, 0.79, 0.6667, 283, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write_to_file", "arg_names": [], "import_names": [], "rhs_call_name": "write_to_file", "annotation": ""}, "snippet": " suite.write_to_file(outpath)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:Return_L50_C4", "label": "return", "type": "return", "loc": [50, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L46_C0", "vector": [13, 1, 0.2688, 0.0054, 1, 0.79, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return suite.critical_stats.failed"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L52_C0", "label": "_process_suite", "type": "function", "loc": [52, 56], "level": 0, "parent": null, "vector": [2, 0, 0.2903, 0.0269, 0, 0.66, 0.3333, 503, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "_process_suite", "arg_names": ["suite"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _process_suite(suite):\n for subsuite in suite.suites:\n _process_suite(subsuite)\n for test in suite.tests:\n _process_test(test)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:For_L53_C4", "label": "for subsuite", "type": "for", "loc": [53, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L52_C0", "vector": [6, 1, 0.2876, 0.0108, 1, 0.57, 0.0, 700, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "subsuite", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for subsuite in suite.suites:\n _process_suite(subsuite)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:Expr_L54_C8", "label": "_process_suite()", "type": "expression", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:For_L53_C4", "vector": [8, 2, 0.2903, 0.0054, 2, 0.64, 0.0, 503, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_process_suite", "arg_names": [], "import_names": [], "rhs_call_name": "_process_suite", "annotation": ""}, "snippet": " _process_suite(subsuite)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:For_L55_C4", "label": "for test", "type": "for", "loc": [55, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L52_C0", "vector": [6, 1, 0.2984, 0.0108, 1, 0.57, 1.0, 224, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "test", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for test in suite.tests:\n _process_test(test)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:Expr_L56_C8", "label": "_process_test()", "type": "expression", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:For_L55_C4", "vector": [8, 2, 0.3011, 0.0054, 2, 0.97, 0.0, 281, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_process_test", "arg_names": [], "import_names": [], "rhs_call_name": "_process_test", "annotation": ""}, "snippet": " _process_test(test)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L58_C0", "label": "_process_test", "type": "function", "loc": [58, 62], "level": 0, "parent": null, "vector": [2, 0, 0.3226, 0.0269, 0, 0.66, 0.4167, 281, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "_process_test", "arg_names": ["test"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _process_test(test):\n exp = _Expected(test.doc)\n _check_status(test, exp)\n if test.status == 'PASS':\n _check_logs(test, exp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L59_C4", "label": "exp = _Expected()", "type": "assigned_variable", "loc": [59, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L58_C0", "vector": [14, 1, 0.3172, 0.0054, 1, 0.79, 0.0, 971, 3, 1, 0, 0, 904, 10, 1], "semantic": {"name": "exp", "arg_names": [], "import_names": [], "rhs_call_name": "_Expected", "annotation": ""}, "snippet": " exp = _Expected(test.doc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:Expr_L60_C4", "label": "_check_status()", "type": "expression", "loc": [60, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L58_C0", "vector": [8, 1, 0.3226, 0.0054, 1, 0.79, 0.5, 848, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_check_status", "arg_names": [], "import_names": [], "rhs_call_name": "_check_status", "annotation": ""}, "snippet": " _check_status(test, exp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L61_C4", "label": "if", "type": "if", "loc": [61, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L58_C0", "vector": [4, 1, 0.3306, 0.0108, 1, 0.79, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if test.status == 'PASS':\n _check_logs(test, exp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:Expr_L62_C8", "label": "_check_logs()", "type": "expression", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L61_C4", "vector": [8, 2, 0.3333, 0.0054, 2, 0.01, 0.0, 567, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_check_logs", "arg_names": [], "import_names": [], "rhs_call_name": "_check_logs", "annotation": ""}, "snippet": " _check_logs(test, exp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L64_C0", "label": "_check_status", "type": "function", "loc": [64, 79], "level": 0, "parent": null, "vector": [2, 0, 0.3844, 0.086, 0, 0.66, 0.5, 848, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_check_status", "arg_names": ["test", "exp"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _check_status(test, exp):\n if exp.status != test.status:\n test.status = 'FAIL'\n if exp.status == 'PASS':\n test.message = (\"Test was expected to PASS but it FAILED. \" \n \"Error message:\\n\") + test.message\n else:\n test.message = (\"Test was expected to FAIL but it PASSED. \""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L65_C4", "label": "if", "type": "if", "loc": [65, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L64_C0", "vector": [4, 1, 0.3871, 0.0806, 1, 0.64, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if exp.status != test.status:\n test.status = 'FAIL'\n if exp.status == 'PASS':\n test.message = (\"Test was expected to PASS but it FAILED. \" \n \"Error message:\\n\") + test.message\n else:\n test.message = (\"Test was expected to FAIL but it PASSED. \"\n \"Expected message:\\n\") + exp.message"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L66_C8", "label": "test.status =", "type": "assigned_variable", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L65_C4", "vector": [14, 2, 0.3548, 0.0054, 2, 0.1, 0.0, 9, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "test.status", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " test.status = 'FAIL'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L67_C8", "label": "if", "type": "if", "loc": [67, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L65_C4", "vector": [4, 2, 0.3737, 0.0323, 2, 0.1, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if exp.status == 'PASS':\n test.message = (\"Test was expected to PASS but it FAILED. \" \n \"Error message:\\n\") + test.message\n else:\n test.message = (\"Test was expected to FAIL but it PASSED. \"\n \"Expected message:\\n\") + exp.message"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L68_C12", "label": "test.message =", "type": "assigned_variable", "loc": [68, 69], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L67_C8", "vector": [14, 3, 0.3683, 0.0108, 3, 0.3, 0.0, 792, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "test.message", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " test.message = (\"Test was expected to PASS but it FAILED. \" \n \"Error message:\\n\") + test.message"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L71_C12", "label": "test.message =", "type": "assigned_variable", "loc": [71, 72], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L67_C8", "vector": [14, 3, 0.3844, 0.0108, 3, 0.3, 1.0, 792, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "test.message", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " test.message = (\"Test was expected to FAIL but it PASSED. \"\n \"Expected message:\\n\") + exp.message"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L73_C4", "label": "if", "type": "if", "loc": [73, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L65_C4", "vector": [4, 2, 0.4086, 0.0376, 2, 0.1, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif not _message_matches(test.message, exp.message):\n test.status = 'FAIL'\n test.message = (\"Wrong error message.\\n\\nExpected:\\n%s\\n\\nActual:\\n%s\\n\"\n % (exp.message, test.message))\n elif test.status == 'FAIL':\n test.status = 'PASS'\n test.message = 'Original test failed as expected.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L74_C8", "label": "test.status =", "type": "assigned_variable", "loc": [74, 74], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L73_C4", "vector": [14, 3, 0.3978, 0.0054, 3, 0.59, 0.0, 9, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "test.status", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " test.status = 'FAIL'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L75_C8", "label": "test.message =", "type": "assigned_variable", "loc": [75, 76], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L73_C4", "vector": [14, 3, 0.4059, 0.0108, 3, 0.59, 0.5, 792, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "test.message", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " test.message = (\"Wrong error message.\\n\\nExpected:\\n%s\\n\\nActual:\\n%s\\n\"\n % (exp.message, test.message))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L77_C4", "label": "if", "type": "if", "loc": [77, 79], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L73_C4", "vector": [4, 3, 0.4194, 0.0161, 3, 0.59, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif test.status == 'FAIL':\n test.status = 'PASS'\n test.message = 'Original test failed as expected.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L78_C8", "label": "test.status =", "type": "assigned_variable", "loc": [78, 78], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L77_C4", "vector": [14, 4, 0.4194, 0.0054, 4, 0.13, 0.0, 9, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "test.status", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " test.status = 'PASS'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L79_C8", "label": "test.message =", "type": "assigned_variable", "loc": [79, 79], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L77_C4", "vector": [14, 4, 0.4247, 0.0054, 4, 0.13, 1.0, 792, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "test.message", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " test.message = 'Original test failed as expected.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L81_C0", "label": "_message_matches", "type": "function", "loc": [81, 88], "level": 0, "parent": null, "vector": [2, 0, 0.4543, 0.043, 0, 0.66, 0.5833, 834, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "_message_matches", "arg_names": ["actual", "expected"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _message_matches(actual, expected):\n if actual == expected:\n return True\n if expected.startswith('REGEXP:'):\n pattern = '^%s$' % expected.replace('REGEXP:', '', 1).strip()\n if re.match(pattern, actual, re.DOTALL):\n return True\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L82_C4", "label": "if", "type": "if", "loc": [82, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L81_C0", "vector": [4, 1, 0.4435, 0.0108, 1, 0.79, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if actual == expected:\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:Return_L83_C8", "label": "return", "type": "return", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L82_C4", "vector": [13, 2, 0.4462, 0.0054, 2, 0.11, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L84_C4", "label": "if", "type": "if", "loc": [84, 87], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L81_C0", "vector": [4, 1, 0.4597, 0.0215, 1, 0.79, 0.5, 0, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if expected.startswith('REGEXP:'):\n pattern = '^%s$' % expected.replace('REGEXP:', '', 1).strip()\n if re.match(pattern, actual, re.DOTALL):\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L85_C8", "label": "pattern =", "type": "assigned_variable", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L84_C4", "vector": [14, 2, 0.457, 0.0054, 2, 0.75, 0.0, 561, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "pattern", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " pattern = '^%s$' % expected.replace('REGEXP:', '', 1).strip()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L86_C8", "label": "if", "type": "if", "loc": [86, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L84_C4", "vector": [4, 2, 0.4651, 0.0108, 2, 0.75, 1.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if re.match(pattern, actual, re.DOTALL):\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:Return_L87_C12", "label": "return", "type": "return", "loc": [87, 87], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L86_C8", "vector": [13, 3, 0.4677, 0.0054, 3, 0.86, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:Return_L88_C4", "label": "return", "type": "return", "loc": [88, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L81_C0", "vector": [13, 1, 0.4731, 0.0054, 1, 0.79, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L90_C0", "label": "_check_logs", "type": "function", "loc": [90, 110], "level": 0, "parent": null, "vector": [2, 0, 0.5376, 0.1129, 0, 0.66, 0.6667, 567, 0, 2, 0, 0, 0, 0, 5], "semantic": {"name": "_check_logs", "arg_names": ["test", "exp"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _check_logs(test, exp):\n for kw_indices, msg_index, level, message in exp.logs:\n try:\n kw = test.keywords[kw_indices[0]]\n for index in kw_indices[1:]:\n kw = kw.keywords[index]\n except IndexError:\n indices = '.'.join([ str(i+1) for i in kw_indices ])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:For_L91_C4", "label": "for kw_indices, msg_index, level, message", "type": "for", "loc": [91, 110], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L90_C0", "vector": [6, 1, 0.5403, 0.1075, 1, 0.48, 0.0, 463, 7, 0, 0, 0, 0, 0, 5], "semantic": {"name": "kw_indices, msg_index, level, message", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for kw_indices, msg_index, level, message in exp.logs:\n try:\n kw = test.keywords[kw_indices[0]]\n for index in kw_indices[1:]:\n kw = kw.keywords[index]\n except IndexError:\n indices = '.'.join([ str(i+1) for i in kw_indices ])\n test.status = 'FAIL'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:Try_L92_C8", "label": "try", "type": "try", "loc": [92, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:For_L91_C4", "vector": [7, 2, 0.5188, 0.0538, 2, 0.47, 0.0, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n kw = test.keywords[kw_indices[0]]\n for index in kw_indices[1:]:\n kw = kw.keywords[index]\n except IndexError:\n indices = '.'.join([ str(i+1) for i in kw_indices ])\n test.status = 'FAIL'\n test.message = (\"Test '%s' does not have keyword with index '%s'\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L93_C12", "label": "kw =", "type": "assigned_variable", "loc": [93, 93], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:Try_L92_C8", "vector": [14, 3, 0.5, 0.0054, 3, 0.97, 0.0, 755, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "kw", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " kw = test.keywords[kw_indices[0]]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:For_L94_C12", "label": "for index", "type": "for", "loc": [94, 95], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:Try_L92_C8", "vector": [6, 3, 0.5081, 0.0108, 3, 0.97, 1.0, 780, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "index", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for index in kw_indices[1:]:\n kw = kw.keywords[index]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L95_C16", "label": "kw =", "type": "assigned_variable", "loc": [95, 95], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:For_L94_C12", "vector": [14, 4, 0.5108, 0.0054, 4, 0.98, 0.0, 755, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "kw", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " kw = kw.keywords[index]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L97_C12", "label": "indices = join()", "type": "assigned_variable", "loc": [97, 97], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:Try_L92_C8", "vector": [14, 3, 0.5215, 0.0054, 3, 0.97, 0.0, 478, 3, 1, 0, 0, 933, 10, 2], "semantic": {"name": "indices", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " indices = '.'.join([ str(i+1) for i in kw_indices ])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L98_C12", "label": "test.status =", "type": "assigned_variable", "loc": [98, 98], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:Try_L92_C8", "vector": [14, 3, 0.5269, 0.0054, 3, 0.97, 0.3333, 9, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "test.status", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " test.status = 'FAIL'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L99_C12", "label": "test.message =", "type": "assigned_variable", "loc": [99, 100], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:Try_L92_C8", "vector": [14, 3, 0.5349, 0.0108, 3, 0.97, 0.6667, 792, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "test.message", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " test.message = (\"Test '%s' does not have keyword with index '%s'\"\n % (test.name, indices))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:Return_L101_C12", "label": "return", "type": "return", "loc": [101, 101], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:Try_L92_C8", "vector": [13, 3, 0.543, 0.0054, 3, 0.97, 1.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_99939:If_L103_C8", "label": "if", "type": "if", "loc": [103, 110], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:For_L91_C4", "vector": [4, 2, 0.5726, 0.043, 2, 0.47, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(kw.messages) <= msg_index:\n if message != 'NONE':\n test.status = 'FAIL'\n test.message = (\"Keyword '%s' should have had at least %d \"\n \"messages\" % (kw.name, msg_index+1))\n else:\n if _check_log_level(level, test, kw, msg_index):\n _check_log_message(message, test, kw, msg_index)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L104_C12", "label": "if", "type": "if", "loc": [104, 107], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L103_C8", "vector": [4, 3, 0.5672, 0.0215, 3, 0.73, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if message != 'NONE':\n test.status = 'FAIL'\n test.message = (\"Keyword '%s' should have had at least %d \"\n \"messages\" % (kw.name, msg_index+1))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L105_C16", "label": "test.status =", "type": "assigned_variable", "loc": [105, 105], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L104_C12", "vector": [14, 4, 0.5645, 0.0054, 4, 0.35, 0.0, 9, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "test.status", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " test.status = 'FAIL'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L106_C16", "label": "test.message =", "type": "assigned_variable", "loc": [106, 107], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L104_C12", "vector": [14, 4, 0.5726, 0.0108, 4, 0.35, 1.0, 792, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "test.message", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " test.message = (\"Keyword '%s' should have had at least %d \"\n \"messages\" % (kw.name, msg_index+1))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L109_C12", "label": "if", "type": "if", "loc": [109, 110], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L103_C8", "vector": [4, 3, 0.5887, 0.0108, 3, 0.73, 1.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if _check_log_level(level, test, kw, msg_index):\n _check_log_message(message, test, kw, msg_index)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:Expr_L110_C16", "label": "_check_log_message()", "type": "expression", "loc": [110, 110], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L109_C12", "vector": [8, 4, 0.5914, 0.0054, 4, 0.21, 0.0, 749, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "_check_log_message", "arg_names": [], "import_names": [], "rhs_call_name": "_check_log_message", "annotation": ""}, "snippet": " _check_log_message(message, test, kw, msg_index)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L112_C0", "label": "_check_log_level", "type": "function", "loc": [112, 120], "level": 0, "parent": null, "vector": [2, 0, 0.6237, 0.0484, 0, 0.66, 0.75, 621, 0, 4, 1, 0, 0, 0, 0], "semantic": {"name": "_check_log_level", "arg_names": ["expected", "test", "kw", "index"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _check_log_level(expected, test, kw, index):\n actual = kw.messages[index].level\n if actual == expected:\n return True\n test.status = 'FAIL'\n test.message = (\"Wrong level for message %d of keyword '%s'.\\n\\n\"\n \"Expected: %s\\nActual: %s.\\n%s\" \n % (index+1, kw.name, expected, actual, kw.messages[index].message))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L113_C4", "label": "actual =", "type": "assigned_variable", "loc": [113, 113], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L112_C0", "vector": [14, 1, 0.6075, 0.0054, 1, 0.08, 0.0, 331, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "actual", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " actual = kw.messages[index].level"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L114_C4", "label": "if", "type": "if", "loc": [114, 115], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L112_C0", "vector": [4, 1, 0.6156, 0.0108, 1, 0.08, 0.25, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if actual == expected:\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:Return_L115_C8", "label": "return", "type": "return", "loc": [115, 115], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L114_C4", "vector": [13, 2, 0.6183, 0.0054, 2, 0.25, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L116_C4", "label": "test.status =", "type": "assigned_variable", "loc": [116, 116], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L112_C0", "vector": [14, 1, 0.6237, 0.0054, 1, 0.08, 0.5, 9, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "test.status", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " test.status = 'FAIL'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L117_C4", "label": "test.message =", "type": "assigned_variable", "loc": [117, 119], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L112_C0", "vector": [14, 1, 0.6344, 0.0161, 1, 0.08, 0.75, 792, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "test.message", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " test.message = (\"Wrong level for message %d of keyword '%s'.\\n\\n\"\n \"Expected: %s\\nActual: %s.\\n%s\" \n % (index+1, kw.name, expected, actual, kw.messages[index].message))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:Return_L120_C4", "label": "return", "type": "return", "loc": [120, 120], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L112_C0", "vector": [13, 1, 0.6452, 0.0054, 1, 0.08, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L122_C0", "label": "_check_log_message", "type": "function", "loc": [122, 130], "level": 0, "parent": null, "vector": [2, 0, 0.6774, 0.0484, 0, 0.66, 0.8333, 749, 0, 4, 1, 0, 0, 0, 2], "semantic": {"name": "_check_log_message", "arg_names": ["expected", "test", "kw", "index"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _check_log_message(expected, test, kw, index):\n actual = kw.messages[index].message.strip()\n if _message_matches(actual, expected):\n return True\n test.status = 'FAIL'\n test.message = (\"Wrong content for message %d of keyword '%s'.\\n\\n\"\n \"Expected:\\n%s\\n\\nActual:\\n%s\" \n % (index+1, kw.name, expected, actual))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L123_C4", "label": "actual = strip()", "type": "assigned_variable", "loc": [123, 123], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L122_C0", "vector": [14, 1, 0.6613, 0.0054, 1, 0.15, 0.0, 331, 3, 0, 0, 0, 973, 10, 1], "semantic": {"name": "actual", "arg_names": [], "import_names": [], "rhs_call_name": "strip", "annotation": ""}, "snippet": " actual = kw.messages[index].message.strip()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L124_C4", "label": "if", "type": "if", "loc": [124, 125], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L122_C0", "vector": [4, 1, 0.6694, 0.0108, 1, 0.15, 0.25, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if _message_matches(actual, expected):\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:Return_L125_C8", "label": "return", "type": "return", "loc": [125, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L124_C4", "vector": [13, 2, 0.672, 0.0054, 2, 0.44, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L126_C4", "label": "test.status =", "type": "assigned_variable", "loc": [126, 126], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L122_C0", "vector": [14, 1, 0.6774, 0.0054, 1, 0.15, 0.5, 9, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "test.status", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " test.status = 'FAIL'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L127_C4", "label": "test.message =", "type": "assigned_variable", "loc": [127, 129], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L122_C0", "vector": [14, 1, 0.6882, 0.0161, 1, 0.15, 0.75, 792, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "test.message", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " test.message = (\"Wrong content for message %d of keyword '%s'.\\n\\n\"\n \"Expected:\\n%s\\n\\nActual:\\n%s\" \n % (index+1, kw.name, expected, actual))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:Return_L130_C4", "label": "return", "type": "return", "loc": [130, 130], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L122_C0", "vector": [13, 1, 0.6989, 0.0054, 1, 0.15, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:ClassDef_L133_C0", "label": "_Expected", "type": "class", "loc": [133, 168], "level": 0, "parent": null, "vector": [3, 0, 0.8091, 0.1935, 0, 0.66, 0.9167, 904, 0, 5, 0, 0, 0, 0, 16], "semantic": {"name": "_Expected", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _Expected:\n \n def __init__(self, doc):\n self.status, self.message = self._get_status_and_message(doc)\n self.logs = self._get_logs(doc)\n \n def _get_status_and_message(self, doc):\n if 'FAIL' in doc:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L135_C4", "label": "__init__", "type": "function", "loc": [135, 137], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:ClassDef_L133_C0", "vector": [2, 1, 0.7312, 0.0161, 1, 0.59, 0.0, 555, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "doc"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, doc):\n self.status, self.message = self._get_status_and_message(doc)\n self.logs = self._get_logs(doc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L136_C8", "label": " = _get_status_and_message()", "type": "assigned_variable", "loc": [136, 136], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L135_C4", "vector": [14, 2, 0.7312, 0.0054, 2, 0.59, 0.0, 0, 3, 1, 0, 0, 230, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "_get_status_and_message", "annotation": ""}, "snippet": " self.status, self.message = self._get_status_and_message(doc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L137_C8", "label": "self.logs = _get_logs()", "type": "assigned_variable", "loc": [137, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L135_C4", "vector": [14, 2, 0.7366, 0.0054, 2, 0.59, 1.0, 810, 3, 1, 0, 0, 835, 10, 1], "semantic": {"name": "self.logs", "arg_names": [], "import_names": [], "rhs_call_name": "_get_logs", "annotation": ""}, "snippet": " self.logs = self._get_logs(doc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L139_C4", "label": "_get_status_and_message", "type": "function", "loc": [139, 142], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:ClassDef_L133_C0", "vector": [2, 1, 0.7554, 0.0215, 1, 0.59, 0.25, 230, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "_get_status_and_message", "arg_names": ["self", "doc"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_status_and_message(self, doc):\n if 'FAIL' in doc:\n return 'FAIL', doc.split('FAIL', 1)[1].split('LOG', 1)[0].strip()\n return 'PASS', ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L140_C8", "label": "if", "type": "if", "loc": [140, 141], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L139_C4", "vector": [4, 2, 0.7554, 0.0108, 2, 0.73, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if 'FAIL' in doc:\n return 'FAIL', doc.split('FAIL', 1)[1].split('LOG', 1)[0].strip()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:Return_L141_C12", "label": "return", "type": "return", "loc": [141, 141], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L140_C8", "vector": [13, 3, 0.7581, 0.0054, 3, 0.37, 0.0, 0, 0, 0, 0, 0, 0, 8, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'FAIL', doc.split('FAIL', 1)[1].split('LOG', 1)[0].strip()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:Return_L142_C8", "label": "return", "type": "return", "loc": [142, 142], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L139_C4", "vector": [13, 2, 0.7634, 0.0054, 2, 0.73, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 'PASS', ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L144_C4", "label": "_get_logs", "type": "function", "loc": [144, 151], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:ClassDef_L133_C0", "vector": [2, 1, 0.793, 0.043, 1, 0.59, 0.5, 835, 0, 2, 1, 0, 0, 0, 6], "semantic": {"name": "_get_logs", "arg_names": ["self", "doc"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_logs(self, doc):\n logs = []\n for item in doc.split('LOG')[1:]:\n index_str, msg_str = item.strip().split(' ', 1)\n kw_indices, msg_index = self._get_indices(index_str)\n level, message = self._get_log_message(msg_str)\n logs.append((kw_indices, msg_index, level, message)) \n return logs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L145_C8", "label": "logs =", "type": "assigned_variable", "loc": [145, 145], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L144_C4", "vector": [14, 2, 0.7796, 0.0054, 2, 0.16, 0.0, 693, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "logs", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " logs = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:For_L146_C8", "label": "for item", "type": "for", "loc": [146, 150], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L144_C4", "vector": [6, 2, 0.7957, 0.0269, 2, 0.16, 0.5, 434, 6, 0, 0, 0, 0, 0, 6], "semantic": {"name": "item", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for item in doc.split('LOG')[1:]:\n index_str, msg_str = item.strip().split(' ', 1)\n kw_indices, msg_index = self._get_indices(index_str)\n level, message = self._get_log_message(msg_str)\n logs.append((kw_indices, msg_index, level, message)) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L147_C12", "label": "index_str, msg_str = split()", "type": "assigned_variable", "loc": [147, 147], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:For_L146_C8", "vector": [14, 3, 0.7903, 0.0054, 3, 0.72, 0.0, 908, 3, 2, 0, 0, 908, 10, 2], "semantic": {"name": "index_str, msg_str", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " index_str, msg_str = item.strip().split(' ', 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L148_C12", "label": "kw_indices, msg_index = _get_indices()", "type": "assigned_variable", "loc": [148, 148], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:For_L146_C8", "vector": [14, 3, 0.7957, 0.0054, 3, 0.72, 0.3333, 253, 3, 1, 0, 0, 161, 10, 1], "semantic": {"name": "kw_indices, msg_index", "arg_names": [], "import_names": [], "rhs_call_name": "_get_indices", "annotation": ""}, "snippet": " kw_indices, msg_index = self._get_indices(index_str)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L149_C12", "label": "level, message = _get_log_message()", "type": "assigned_variable", "loc": [149, 149], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:For_L146_C8", "vector": [14, 3, 0.8011, 0.0054, 3, 0.72, 0.6667, 146, 3, 1, 0, 0, 672, 10, 1], "semantic": {"name": "level, message", "arg_names": [], "import_names": [], "rhs_call_name": "_get_log_message", "annotation": ""}, "snippet": " level, message = self._get_log_message(msg_str)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:Expr_L150_C12", "label": "append()", "type": "expression", "loc": [150, 150], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:For_L146_C8", "vector": [8, 3, 0.8065, 0.0054, 3, 0.72, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " logs.append((kw_indices, msg_index, level, message)) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:Return_L151_C8", "label": "return", "type": "return", "loc": [151, 151], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L144_C4", "vector": [13, 2, 0.8118, 0.0054, 2, 0.16, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return logs"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L153_C4", "label": "_get_indices", "type": "function", "loc": [153, 159], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:ClassDef_L133_C0", "vector": [2, 1, 0.8387, 0.0376, 1, 0.59, 0.75, 161, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "_get_indices", "arg_names": ["self", "index_str"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_indices(self, index_str):\n try:\n kw_indices, msg_index = index_str.split(':')\n except ValueError:\n kw_indices, msg_index = index_str, '1'\n kw_indices = [ int(index) - 1 for index in kw_indices.split('.') ]\n return kw_indices, int(msg_index) - 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:Try_L154_C8", "label": "try", "type": "try", "loc": [154, 157], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L153_C4", "vector": [7, 2, 0.836, 0.0215, 2, 0.71, 0.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n kw_indices, msg_index = index_str.split(':')\n except ValueError:\n kw_indices, msg_index = index_str, '1'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L155_C12", "label": "kw_indices, msg_index = split()", "type": "assigned_variable", "loc": [155, 155], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:Try_L154_C8", "vector": [14, 3, 0.8333, 0.0054, 3, 0.37, 0.0, 253, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "kw_indices, msg_index", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " kw_indices, msg_index = index_str.split(':')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L157_C12", "label": "kw_indices, msg_index =", "type": "assigned_variable", "loc": [157, 157], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:Try_L154_C8", "vector": [14, 3, 0.8441, 0.0054, 3, 0.37, 0.0, 253, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "kw_indices, msg_index", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " kw_indices, msg_index = index_str, '1'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L158_C8", "label": "kw_indices =", "type": "assigned_variable", "loc": [158, 158], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L153_C4", "vector": [14, 2, 0.8495, 0.0054, 2, 0.71, 0.5, 685, 5, 0, 0, 0, 0, 0, 2], "semantic": {"name": "kw_indices", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " kw_indices = [ int(index) - 1 for index in kw_indices.split('.') ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:Return_L159_C8", "label": "return", "type": "return", "loc": [159, 159], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L153_C4", "vector": [13, 2, 0.8548, 0.0054, 2, 0.71, 1.0, 0, 0, 0, 0, 0, 0, 8, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return kw_indices, int(msg_index) - 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L161_C4", "label": "_get_log_message", "type": "function", "loc": [161, 168], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:ClassDef_L133_C0", "vector": [2, 1, 0.8844, 0.043, 1, 0.59, 1.0, 672, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "_get_log_message", "arg_names": ["self", "msg_str"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_log_message(self, msg_str):\n try:\n level, message = msg_str.split(' ', 1)\n if level not in ['TRACE', 'DEBUG', 'INFO', 'WARN', 'FAIL']:\n raise ValueError\n except ValueError:\n level, message = 'INFO', msg_str\n return level, message"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:Try_L162_C8", "label": "try", "type": "try", "loc": [162, 167], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L161_C4", "vector": [7, 2, 0.8844, 0.0323, 2, 0.81, 0.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n level, message = msg_str.split(' ', 1)\n if level not in ['TRACE', 'DEBUG', 'INFO', 'WARN', 'FAIL']:\n raise ValueError\n except ValueError:\n level, message = 'INFO', msg_str"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L163_C12", "label": "level, message = split()", "type": "assigned_variable", "loc": [163, 163], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:Try_L162_C8", "vector": [14, 3, 0.8763, 0.0054, 3, 0.43, 0.0, 146, 3, 2, 0, 0, 908, 10, 1], "semantic": {"name": "level, message", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " level, message = msg_str.split(' ', 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L164_C12", "label": "if", "type": "if", "loc": [164, 165], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:Try_L162_C8", "vector": [4, 3, 0.8844, 0.0108, 3, 0.43, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if level not in ['TRACE', 'DEBUG', 'INFO', 'WARN', 'FAIL']:\n raise ValueError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L167_C12", "label": "level, message =", "type": "assigned_variable", "loc": [167, 167], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:Try_L162_C8", "vector": [14, 3, 0.8978, 0.0054, 3, 0.43, 0.0, 146, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "level, message", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " level, message = 'INFO', msg_str"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:Return_L168_C8", "label": "return", "type": "return", "loc": [168, 168], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L161_C4", "vector": [13, 2, 0.9032, 0.0054, 2, 0.81, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return level, message"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L171_C0", "label": "if", "type": "if", "loc": [171, 186], "level": 0, "parent": null, "vector": [4, 0, 0.9597, 0.086, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 10], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__=='__main__':\n import sys\n import os\n\n if not 2 <= len(sys.argv) <= 3 or '--help' in sys.argv:\n print(__doc__)\n sys.exit(1)\n infile = sys.argv[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:Import_L172_C4", "label": "sys import sys", "type": "import", "loc": [172, 172], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L171_C0", "vector": [1, 1, 0.9247, 0.0054, 1, 0.99, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": " import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:Import_L173_C4", "label": "os import os", "type": "import", "loc": [173, 173], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L171_C0", "vector": [1, 1, 0.9301, 0.0054, 1, 0.99, 0.1111, 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_99939:If_L175_C4", "label": "if", "type": "if", "loc": [175, 177], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L171_C0", "vector": [4, 1, 0.9462, 0.0161, 1, 0.99, 0.2222, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not 2 <= len(sys.argv) <= 3 or '--help' in sys.argv:\n print(__doc__)\n sys.exit(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:Expr_L176_C8", "label": "print()", "type": "expression", "loc": [176, 176], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L175_C4", "vector": [8, 2, 0.9462, 0.0054, 2, 0.54, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(__doc__)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:Expr_L177_C8", "label": "exit()", "type": "expression", "loc": [177, 177], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L175_C4", "vector": [8, 2, 0.9516, 0.0054, 2, 0.54, 1.0, 436, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "exit", "arg_names": [], "import_names": [], "rhs_call_name": "exit", "annotation": ""}, "snippet": " sys.exit(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L178_C4", "label": "infile =", "type": "assigned_variable", "loc": [178, 178], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L171_C0", "vector": [14, 1, 0.957, 0.0054, 1, 0.99, 0.3333, 463, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "infile", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " infile = sys.argv[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L179_C4", "label": "outfile =", "type": "assigned_variable", "loc": [179, 179], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L171_C0", "vector": [14, 1, 0.9624, 0.0054, 1, 0.99, 0.4444, 206, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "outfile", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " outfile = len(sys.argv) == 3 and sys.argv[2] or None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:Expr_L180_C4", "label": "print()", "type": "expression", "loc": [180, 180], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L171_C0", "vector": [8, 1, 0.9677, 0.0054, 1, 0.99, 0.5556, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Checking %s\" % os.path.abspath(infile))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L181_C4", "label": "rc = process_output()", "type": "assigned_variable", "loc": [181, 181], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L171_C0", "vector": [14, 1, 0.9731, 0.0054, 1, 0.99, 0.6667, 401, 3, 2, 0, 0, 918, 10, 1], "semantic": {"name": "rc", "arg_names": [], "import_names": [], "rhs_call_name": "process_output", "annotation": ""}, "snippet": " rc = process_output(infile, outfile)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L182_C4", "label": "if", "type": "if", "loc": [182, 183], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L171_C0", "vector": [4, 1, 0.9812, 0.0108, 1, 0.99, 0.7778, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if outfile:\n print(\"Output %s\" % os.path.abspath(outfile))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:Expr_L183_C8", "label": "print()", "type": "expression", "loc": [183, 183], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L182_C4", "vector": [8, 2, 0.9839, 0.0054, 2, 0.44, 0.0, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Output %s\" % os.path.abspath(outfile))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L184_C4", "label": "if", "type": "if", "loc": [184, 185], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L171_C0", "vector": [4, 1, 0.9919, 0.0108, 1, 0.99, 0.8889, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if rc > 255:\n rc = 255"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L185_C8", "label": "rc =", "type": "assigned_variable", "loc": [185, 185], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L184_C4", "vector": [14, 2, 0.9946, 0.0054, 2, 0.34, 0.0, 401, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "rc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " rc = 255"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99939:Expr_L186_C4", "label": "exit()", "type": "expression", "loc": [186, 186], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L171_C0", "vector": [8, 1, 1.0, 0.0054, 1, 0.99, 1.0, 436, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "exit", "arg_names": [], "import_names": [], "rhs_call_name": "exit", "annotation": ""}, "snippet": " sys.exit(rc)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:Expr_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:Expr_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L46_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:Return_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L52_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:For_L53_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:For_L53_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:Expr_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L52_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:For_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:For_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:Expr_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:Expr_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L58_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L61_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L61_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:Expr_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L65_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L65_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L67_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L68_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L67_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L71_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L65_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L73_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L73_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L73_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L77_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L77_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L77_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L81_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L82_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L82_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:Return_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L81_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L84_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L86_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:Return_L87_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L81_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:Return_L88_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L90_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:For_L91_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:For_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:Try_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:Try_L92_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L93_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:Try_L92_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:For_L94_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:For_L94_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L95_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:Try_L92_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L97_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:Try_L92_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L98_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:Try_L92_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L99_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:Try_L92_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:Return_L101_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:For_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L103_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L103_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L104_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L104_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L105_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L104_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L106_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L103_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L109_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L109_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:Expr_L110_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L112_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L113_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L112_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L114_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L114_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:Return_L115_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L112_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L116_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L112_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L117_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L112_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:Return_L120_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L122_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L123_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L122_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L124_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L124_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:Return_L125_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L122_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L126_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L122_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L127_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L122_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:Return_L130_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:ClassDef_L133_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L135_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L135_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L136_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L135_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L137_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:ClassDef_L133_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L139_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L139_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L140_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L140_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:Return_L141_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L139_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:Return_L142_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:ClassDef_L133_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L144_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L144_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L145_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L144_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:For_L146_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:For_L146_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L147_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:For_L146_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L148_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:For_L146_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L149_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:For_L146_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:Expr_L150_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L144_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:Return_L151_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:ClassDef_L133_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L153_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:Try_L154_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:Try_L154_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L155_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:Try_L154_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L157_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L158_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:Return_L159_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:ClassDef_L133_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L161_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L161_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:Try_L162_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:Try_L162_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L163_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:Try_L162_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L164_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:Try_L162_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L167_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:FunctionDef_L161_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:Return_L168_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L171_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:Import_L172_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L171_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:Import_L173_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L171_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L175_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L175_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:Expr_L176_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L175_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:Expr_L177_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L171_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L178_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L171_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L179_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L171_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:Expr_L180_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L171_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L181_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L171_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L182_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L182_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:Expr_L183_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L171_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L184_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L184_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:Assign_L185_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99939:If_L171_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99939:Expr_L186_C4"}] |
#!/usr/bin/env python
"""qs2html.py -- Creates HTML version of Robot Framework Quick Start Guide
Usage: qs2html.py [ cr(eate) | dist | zip ]
create .. Creates the HTML version of the Quick Start Guide.
dist .... Creates the Quick Start Guide and copies it and all its dependencies
under directory named 'robotframework-quickstart-<date>'.
zip ..... Uses 'dist' to create the Quick Start Guide distribution and then
packages it into 'robotframework-quickstart-<date>.zip'.
"""
import sys
import os
import shutil
import time
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', 'userguide'))
import ug2html # This also initializes docutils and pygments
def create_quickstart():
from docutils.core import publish_cmdline
print 'Creating Quick Start Guide ...'
qsdir = os.path.dirname(os.path.abspath(__file__))
description = 'Quick Start Guide for Robot Framework'
arguments = '''
--time
--stylesheet-path=../userguide/src/userguide.css
quickstart.rst
quickstart.html
'''.split('\n')[1:-1]
os.chdir(qsdir)
publish_cmdline(writer_name='html', description=description, argv=arguments)
qspath = arguments[-1]
print os.path.abspath(qspath)
return qspath
def create_distribution():
qspath = create_quickstart() # we are in doc/quickstart after this
outdir = 'robotframework-quickstart-%d%02d%02d' % time.localtime()[:3]
files = { '': [qspath], 'testlibs': ['LoginLibrary.py'],
'sut': ['login.py', 'test_login.py'] }
print 'Creating distribution directory ...'
if os.path.exists(outdir):
print 'Removing previous distribution'
shutil.rmtree(outdir)
os.mkdir(outdir)
for dirname, files in files.items():
dirpath = os.path.join(outdir, dirname)
if not os.path.exists(dirpath):
print "Creating output directory '%s'" % dirpath
os.mkdir(dirpath)
for name in files:
source = os.path.join(dirname, name)
print "Copying '%s' -> '%s'" % (source, dirpath)
shutil.copy(source, dirpath)
return outdir
def create_zip():
qsdir = create_distribution()
ug2html.zip_distribution(qsdir)
if __name__ == '__main__':
actions = { 'create': create_quickstart, 'cr': create_quickstart,
'dist': create_distribution, 'zip': create_zip }
try:
actions[sys.argv[1]](*sys.argv[2:])
except (KeyError, IndexError, TypeError):
print __doc__
| ajibawa-2023/Python-Code-Large/train/row_99941 | 45 | 79 | 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_99941:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 14], "level": 0, "parent": null, "vector": [8, 0, 0.1076, 0.1519, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"qs2html.py -- Creates HTML version of Robot Framework Quick Start Guide\n\nUsage: qs2html.py [ cr(eate) | dist | zip ]\n\ncreate .. Creates the HTML version of the Quick Start Guide.\n\ndist .... Creates the Quick Start Guide and copies it and all its dependencies \n under directory named 'robotframework-quickstart-<date>'."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99941:Import_L16_C0", "label": "sys import sys", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.2025, 0.0127, 0, 0.66, 0.1, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99941:Import_L17_C0", "label": "os import os", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.2152, 0.0127, 0, 0.66, 0.2, 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_99941:Import_L18_C0", "label": "shutil import shutil", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.2278, 0.0127, 0, 0.66, 0.3, 614, 0, 1, 0, 0, 614, 0, 0], "semantic": {"name": "shutil", "arg_names": [], "import_names": ["shutil"], "rhs_call_name": "", "annotation": ""}, "snippet": "import shutil"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99941:Import_L19_C0", "label": "time import time", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.2405, 0.0127, 0, 0.66, 0.4, 654, 0, 1, 0, 0, 654, 0, 0], "semantic": {"name": "time", "arg_names": [], "import_names": ["time"], "rhs_call_name": "", "annotation": ""}, "snippet": "import time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99941:Expr_L21_C0", "label": "insert()", "type": "expression", "loc": [21, 21], "level": 0, "parent": null, "vector": [8, 0, 0.2658, 0.0127, 0, 0.66, 0.5, 368, 3, 2, 0, 0, 0, 0, 3], "semantic": {"name": "insert", "arg_names": [], "import_names": [], "rhs_call_name": "insert", "annotation": ""}, "snippet": "sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', 'userguide'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99941:Import_L22_C0", "label": "ug2html import ug2html", "type": "import", "loc": [22, 22], "level": 0, "parent": null, "vector": [1, 0, 0.2785, 0.0127, 0, 0.66, 0.6, 350, 0, 1, 0, 0, 350, 0, 0], "semantic": {"name": "ug2html", "arg_names": [], "import_names": ["ug2html"], "rhs_call_name": "", "annotation": ""}, "snippet": "import ug2html # This also initializes docutils and pygments"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99941:FunctionDef_L25_C0", "label": "create_quickstart", "type": "function", "loc": [25, 42], "level": 0, "parent": null, "vector": [2, 0, 0.4241, 0.2278, 0, 0.66, 0.7, 523, 0, 0, 1, 0, 0, 0, 8], "semantic": {"name": "create_quickstart", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def create_quickstart():\n from docutils.core import publish_cmdline\n\n print('Creating Quick Start Guide ...')\n qsdir = os.path.dirname(os.path.abspath(__file__))\n description = 'Quick Start Guide for Robot Framework'\n arguments = '''\n--time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99941:ImportFrom_L26_C4", "label": "from docutils.core import publish_cmdline", "type": "import", "loc": [26, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99941:FunctionDef_L25_C0", "vector": [1, 1, 0.3291, 0.0127, 1, 0.06, 0.0, 219, 0, 1, 0, 0, 219, 0, 0], "semantic": {"name": "docutils.core", "arg_names": [], "import_names": ["publish_cmdline"], "rhs_call_name": "", "annotation": ""}, "snippet": " from docutils.core import publish_cmdline"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99941:Expr_L28_C4", "label": "print()", "type": "expression", "loc": [28, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99941:FunctionDef_L25_C0", "vector": [8, 1, 0.3544, 0.0127, 1, 0.06, 0.1111, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Creating Quick Start Guide ...')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99941:Assign_L29_C4", "label": "qsdir = dirname()", "type": "assigned_variable", "loc": [29, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99941:FunctionDef_L25_C0", "vector": [14, 1, 0.3671, 0.0127, 1, 0.06, 0.2222, 669, 3, 1, 0, 0, 959, 10, 2], "semantic": {"name": "qsdir", "arg_names": [], "import_names": [], "rhs_call_name": "dirname", "annotation": ""}, "snippet": " qsdir = os.path.dirname(os.path.abspath(__file__))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99941:Assign_L30_C4", "label": "description =", "type": "assigned_variable", "loc": [30, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99941:FunctionDef_L25_C0", "vector": [14, 1, 0.3797, 0.0127, 1, 0.06, 0.3333, 306, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "description", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " description = 'Quick Start Guide for Robot Framework'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99941:Assign_L31_C4", "label": "arguments =", "type": "assigned_variable", "loc": [31, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99941:FunctionDef_L25_C0", "vector": [14, 1, 0.4241, 0.0759, 1, 0.06, 0.4444, 426, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "arguments", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " arguments = '''\n--time\n--stylesheet-path=../userguide/src/userguide.css\nquickstart.rst\nquickstart.html\n'''.split('\\n')[1:-1] "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99941:Expr_L38_C4", "label": "chdir()", "type": "expression", "loc": [38, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99941:FunctionDef_L25_C0", "vector": [8, 1, 0.481, 0.0127, 1, 0.06, 0.5556, 122, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "chdir", "arg_names": [], "import_names": [], "rhs_call_name": "chdir", "annotation": ""}, "snippet": " os.chdir(qsdir)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99941:Expr_L39_C4", "label": "publish_cmdline()", "type": "expression", "loc": [39, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99941:FunctionDef_L25_C0", "vector": [8, 1, 0.4937, 0.0127, 1, 0.06, 0.6667, 679, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "publish_cmdline", "arg_names": [], "import_names": [], "rhs_call_name": "publish_cmdline", "annotation": ""}, "snippet": " publish_cmdline(writer_name='html', description=description, argv=arguments)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99941:Assign_L40_C4", "label": "qspath =", "type": "assigned_variable", "loc": [40, 40], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99941:FunctionDef_L25_C0", "vector": [14, 1, 0.5063, 0.0127, 1, 0.06, 0.7778, 717, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "qspath", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " qspath = arguments[-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99941:Expr_L41_C4", "label": "print()", "type": "expression", "loc": [41, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99941:FunctionDef_L25_C0", "vector": [8, 1, 0.519, 0.0127, 1, 0.06, 0.8889, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(os.path.abspath(qspath))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99941:Return_L42_C4", "label": "return", "type": "return", "loc": [42, 42], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99941:FunctionDef_L25_C0", "vector": [13, 1, 0.5316, 0.0127, 1, 0.06, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return qspath"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99941:FunctionDef_L45_C0", "label": "create_distribution", "type": "function", "loc": [45, 65], "level": 0, "parent": null, "vector": [2, 0, 0.6962, 0.2658, 0, 0.66, 0.8, 699, 0, 0, 1, 0, 0, 0, 15], "semantic": {"name": "create_distribution", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def create_distribution():\n qspath = create_quickstart() # we are in doc/quickstart after this\n outdir = 'robotframework-quickstart-%d%02d%02d' % time.localtime()[:3]\n files = { '': [qspath], 'testlibs': ['LoginLibrary.py'],\n 'sut': ['login.py', 'test_login.py'] }\n \n print('Creating distribution directory ...')\n if os.path.exists(outdir):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99941:Assign_L46_C4", "label": "qspath = create_quickstart()", "type": "assigned_variable", "loc": [46, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99941:FunctionDef_L45_C0", "vector": [14, 1, 0.5823, 0.0127, 1, 0.95, 0.0, 717, 3, 0, 0, 0, 523, 10, 1], "semantic": {"name": "qspath", "arg_names": [], "import_names": [], "rhs_call_name": "create_quickstart", "annotation": ""}, "snippet": " qspath = create_quickstart() # we are in doc/quickstart after this"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99941:Assign_L47_C4", "label": "outdir =", "type": "assigned_variable", "loc": [47, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99941:FunctionDef_L45_C0", "vector": [14, 1, 0.5949, 0.0127, 1, 0.95, 0.1429, 479, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "outdir", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " outdir = 'robotframework-quickstart-%d%02d%02d' % time.localtime()[:3]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99941:Assign_L48_C4", "label": "files =", "type": "assigned_variable", "loc": [48, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99941:FunctionDef_L45_C0", "vector": [14, 1, 0.6139, 0.0253, 1, 0.95, 0.2857, 598, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "files", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " files = { '': [qspath], 'testlibs': ['LoginLibrary.py'],\n 'sut': ['login.py', 'test_login.py'] }"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99941:Expr_L51_C4", "label": "print()", "type": "expression", "loc": [51, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99941:FunctionDef_L45_C0", "vector": [8, 1, 0.6456, 0.0127, 1, 0.95, 0.4286, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Creating distribution directory ...')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99941:If_L52_C4", "label": "if", "type": "if", "loc": [52, 54], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99941:FunctionDef_L45_C0", "vector": [4, 1, 0.6709, 0.038, 1, 0.95, 0.5714, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if os.path.exists(outdir):\n print('Removing previous distribution')\n shutil.rmtree(outdir)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99941:Expr_L53_C8", "label": "print()", "type": "expression", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99941:If_L52_C4", "vector": [8, 2, 0.6709, 0.0127, 2, 0.48, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Removing previous distribution')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99941:Expr_L54_C8", "label": "rmtree()", "type": "expression", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99941:If_L52_C4", "vector": [8, 2, 0.6835, 0.0127, 2, 0.48, 1.0, 317, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "rmtree", "arg_names": [], "import_names": [], "rhs_call_name": "rmtree", "annotation": ""}, "snippet": " shutil.rmtree(outdir)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99941:Expr_L55_C4", "label": "mkdir()", "type": "expression", "loc": [55, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99941:FunctionDef_L45_C0", "vector": [8, 1, 0.6962, 0.0127, 1, 0.95, 0.7143, 853, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "mkdir", "arg_names": [], "import_names": [], "rhs_call_name": "mkdir", "annotation": ""}, "snippet": " os.mkdir(outdir)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99941:For_L56_C4", "label": "for dirname, files", "type": "for", "loc": [56, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99941:FunctionDef_L45_C0", "vector": [6, 1, 0.7595, 0.1139, 1, 0.95, 0.8571, 566, 3, 0, 0, 0, 0, 0, 8], "semantic": {"name": "dirname, files", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for dirname, files in files.items():\n dirpath = os.path.join(outdir, dirname)\n if not os.path.exists(dirpath):\n print(\"Creating output directory '%s'\" % dirpath)\n os.mkdir(dirpath)\n for name in files:\n source = os.path.join(dirname, name)\n print(\"Copying '%s' -> '%s'\" % (source, dirpath))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99941:Assign_L57_C8", "label": "dirpath = join()", "type": "assigned_variable", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99941:For_L56_C4", "vector": [14, 2, 0.7215, 0.0127, 2, 0.03, 0.0, 600, 3, 2, 0, 0, 933, 10, 1], "semantic": {"name": "dirpath", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " dirpath = os.path.join(outdir, dirname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99941:If_L58_C8", "label": "if", "type": "if", "loc": [58, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99941:For_L56_C4", "vector": [4, 2, 0.7468, 0.038, 2, 0.03, 0.5, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not os.path.exists(dirpath):\n print(\"Creating output directory '%s'\" % dirpath)\n os.mkdir(dirpath)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99941:Expr_L59_C12", "label": "print()", "type": "expression", "loc": [59, 59], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99941:If_L58_C8", "vector": [8, 3, 0.7468, 0.0127, 3, 0.28, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Creating output directory '%s'\" % dirpath)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99941:Expr_L60_C12", "label": "mkdir()", "type": "expression", "loc": [60, 60], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99941:If_L58_C8", "vector": [8, 3, 0.7595, 0.0127, 3, 0.28, 1.0, 853, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "mkdir", "arg_names": [], "import_names": [], "rhs_call_name": "mkdir", "annotation": ""}, "snippet": " os.mkdir(dirpath)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99941:For_L61_C8", "label": "for name", "type": "for", "loc": [61, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99941:For_L56_C4", "vector": [6, 2, 0.7911, 0.0506, 2, 0.03, 1.0, 57, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for name in files:\n source = os.path.join(dirname, name)\n print(\"Copying '%s' -> '%s'\" % (source, dirpath))\n shutil.copy(source, dirpath)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99941:Assign_L62_C12", "label": "source = join()", "type": "assigned_variable", "loc": [62, 62], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99941:For_L61_C8", "vector": [14, 3, 0.7848, 0.0127, 3, 0.37, 0.0, 703, 3, 2, 0, 0, 933, 10, 1], "semantic": {"name": "source", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " source = os.path.join(dirname, name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99941:Expr_L63_C12", "label": "print()", "type": "expression", "loc": [63, 63], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99941:For_L61_C8", "vector": [8, 3, 0.7975, 0.0127, 3, 0.37, 0.5, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Copying '%s' -> '%s'\" % (source, dirpath))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99941:Expr_L64_C12", "label": "copy()", "type": "expression", "loc": [64, 64], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99941:For_L61_C8", "vector": [8, 3, 0.8101, 0.0127, 3, 0.37, 1.0, 739, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "copy", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " shutil.copy(source, dirpath)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99941:Return_L65_C4", "label": "return", "type": "return", "loc": [65, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99941:FunctionDef_L45_C0", "vector": [13, 1, 0.8228, 0.0127, 1, 0.95, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return outdir "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99941:FunctionDef_L68_C0", "label": "create_zip", "type": "function", "loc": [68, 70], "level": 0, "parent": null, "vector": [2, 0, 0.8734, 0.038, 0, 0.66, 0.9, 276, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "create_zip", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def create_zip():\n qsdir = create_distribution()\n ug2html.zip_distribution(qsdir)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99941:Assign_L69_C4", "label": "qsdir = create_distribution()", "type": "assigned_variable", "loc": [69, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99941:FunctionDef_L68_C0", "vector": [14, 1, 0.8734, 0.0127, 1, 0.23, 0.0, 669, 3, 0, 0, 0, 699, 10, 1], "semantic": {"name": "qsdir", "arg_names": [], "import_names": [], "rhs_call_name": "create_distribution", "annotation": ""}, "snippet": " qsdir = create_distribution()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99941:Expr_L70_C4", "label": "zip_distribution()", "type": "expression", "loc": [70, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99941:FunctionDef_L68_C0", "vector": [8, 1, 0.8861, 0.0127, 1, 0.23, 1.0, 339, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "zip_distribution", "arg_names": [], "import_names": [], "rhs_call_name": "zip_distribution", "annotation": ""}, "snippet": " ug2html.zip_distribution(qsdir)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99941:If_L73_C0", "label": "if", "type": "if", "loc": [73, 79], "level": 0, "parent": null, "vector": [4, 0, 0.962, 0.0886, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n actions = { 'create': create_quickstart, 'cr': create_quickstart,\n 'dist': create_distribution, 'zip': create_zip }\n try:\n actions[sys.argv[1]](*sys.argv[2:])\n except (KeyError, IndexError, TypeError):\n print(__doc__)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99941:Assign_L74_C4", "label": "actions =", "type": "assigned_variable", "loc": [74, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99941:If_L73_C0", "vector": [14, 1, 0.943, 0.0253, 1, 0.84, 0.0, 317, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "actions", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " actions = { 'create': create_quickstart, 'cr': create_quickstart,\n 'dist': create_distribution, 'zip': create_zip }"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99941:Try_L76_C4", "label": "try", "type": "try", "loc": [76, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99941:If_L73_C0", "vector": [7, 1, 0.981, 0.0506, 1, 0.84, 1.0, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n actions[sys.argv[1]](*sys.argv[2:])\n except (KeyError, IndexError, TypeError):\n print(__doc__)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99941:Expr_L77_C8", "label": "expression", "type": "expression", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99941:Try_L76_C4", "vector": [8, 2, 0.9747, 0.0127, 2, 0.4, 0.0, 0, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " actions[sys.argv[1]](*sys.argv[2:])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99941:Expr_L79_C8", "label": "print()", "type": "expression", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99941:Try_L76_C4", "vector": [8, 2, 1.0, 0.0127, 2, 0.4, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(__doc__)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99941:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99941:ImportFrom_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99941:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99941:Expr_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99941:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99941:Assign_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99941:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99941:Assign_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99941:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99941:Assign_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99941:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99941:Expr_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99941:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99941:Expr_L39_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99941:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99941:Assign_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99941:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99941:Expr_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99941:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99941:Return_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99941:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99941:Assign_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99941:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99941:Assign_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99941:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99941:Assign_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99941:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99941:Expr_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99941:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99941:If_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99941:If_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99941:Expr_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99941:If_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99941:Expr_L54_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99941:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99941:Expr_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99941:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99941:For_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99941:For_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99941:Assign_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99941:For_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99941:If_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99941:If_L58_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99941:Expr_L59_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99941:If_L58_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99941:Expr_L60_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99941:For_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99941:For_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99941:For_L61_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99941:Assign_L62_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99941:For_L61_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99941:Expr_L63_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99941:For_L61_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99941:Expr_L64_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99941:FunctionDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99941:Return_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99941:FunctionDef_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99941:Assign_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99941:FunctionDef_L68_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99941:Expr_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99941:If_L73_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99941:Assign_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99941:If_L73_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99941:Try_L76_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99941:Try_L76_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99941:Expr_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99941:Try_L76_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99941:Expr_L79_C8"}] |
import os
import sys
import subprocess
class LoginLibrary:
def __init__(self):
self._sut_path = os.path.join(os.path.dirname(__file__),
'..', 'sut', 'login.py')
self._status = ''
def create_user(self, username, password):
self._run_command('create', username, password)
def change_password(self, username, old_pwd, new_pwd):
self._run_command('change-password', username, old_pwd, new_pwd)
def attempt_to_login_with_credentials(self, username, password):
self._run_command('login', username, password)
def status_should_be(self, expected_status):
if expected_status != self._status:
raise AssertionError("Expected status to be '%s' but was '%s'"
% (expected_status, self._status))
def _run_command(self, command, *args):
if not sys.executable:
raise RuntimeError("Could not find Jython installation")
command = [sys.executable, self._sut_path, command] + list(args)
process = subprocess.Popen(command, stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
self._status = process.communicate()[0].strip()
| ajibawa-2023/Python-Code-Large/train/row_99942 | 20 | 33 | 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_99942:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0303, 0.0303, 0, 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_99942:Import_L2_C0", "label": "sys import sys", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0606, 0.0303, 0, 0.66, 0.3333, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99942:Import_L3_C0", "label": "subprocess import subprocess", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0909, 0.0303, 0, 0.66, 0.6667, 394, 0, 1, 0, 0, 394, 0, 0], "semantic": {"name": "subprocess", "arg_names": [], "import_names": ["subprocess"], "rhs_call_name": "", "annotation": ""}, "snippet": "import subprocess"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99942:ClassDef_L6_C0", "label": "LoginLibrary", "type": "class", "loc": [6, 33], "level": 0, "parent": null, "vector": [3, 0, 0.5909, 0.8485, 0, 0.66, 1.0, 563, 0, 6, 0, 0, 0, 0, 11], "semantic": {"name": "LoginLibrary", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class LoginLibrary:\n\n def __init__(self):\n self._sut_path = os.path.join(os.path.dirname(__file__),\n '..', 'sut', 'login.py')\n self._status = ''\n\n def create_user(self, username, password):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99942:FunctionDef_L8_C4", "label": "__init__", "type": "function", "loc": [8, 11], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99942:ClassDef_L6_C0", "vector": [2, 1, 0.2879, 0.1212, 1, 0.57, 0.0, 555, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self):\n self._sut_path = os.path.join(os.path.dirname(__file__),\n '..', 'sut', 'login.py')\n self._status = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99942:Assign_L9_C8", "label": "self._sut_path = join()", "type": "assigned_variable", "loc": [9, 10], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99942:FunctionDef_L8_C4", "vector": [14, 2, 0.2879, 0.0606, 2, 0.88, 0.0, 74, 3, 4, 0, 0, 933, 10, 2], "semantic": {"name": "self._sut_path", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " self._sut_path = os.path.join(os.path.dirname(__file__),\n '..', 'sut', 'login.py')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99942:Assign_L11_C8", "label": "self._status =", "type": "assigned_variable", "loc": [11, 11], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99942:FunctionDef_L8_C4", "vector": [14, 2, 0.3333, 0.0303, 2, 0.88, 1.0, 891, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self._status", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._status = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99942:FunctionDef_L13_C4", "label": "create_user", "type": "function", "loc": [13, 14], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99942:ClassDef_L6_C0", "vector": [2, 1, 0.4091, 0.0606, 1, 0.57, 0.2, 946, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "create_user", "arg_names": ["self", "username", "password"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def create_user(self, username, password):\n self._run_command('create', username, password)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99942:Expr_L14_C8", "label": "_run_command()", "type": "expression", "loc": [14, 14], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99942:FunctionDef_L13_C4", "vector": [8, 2, 0.4242, 0.0303, 2, 0.65, 0.0, 549, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "_run_command", "arg_names": [], "import_names": [], "rhs_call_name": "_run_command", "annotation": ""}, "snippet": " self._run_command('create', username, password)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99942:FunctionDef_L16_C4", "label": "change_password", "type": "function", "loc": [16, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99942:ClassDef_L6_C0", "vector": [2, 1, 0.5, 0.0606, 1, 0.57, 0.4, 421, 0, 4, 0, 0, 0, 0, 1], "semantic": {"name": "change_password", "arg_names": ["self", "username", "old_pwd", "new_pwd"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def change_password(self, username, old_pwd, new_pwd):\n self._run_command('change-password', username, old_pwd, new_pwd)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99942:Expr_L17_C8", "label": "_run_command()", "type": "expression", "loc": [17, 17], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99942:FunctionDef_L16_C4", "vector": [8, 2, 0.5152, 0.0303, 2, 0.54, 0.0, 549, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "_run_command", "arg_names": [], "import_names": [], "rhs_call_name": "_run_command", "annotation": ""}, "snippet": " self._run_command('change-password', username, old_pwd, new_pwd)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99942:FunctionDef_L19_C4", "label": "attempt_to_login_with_credentials", "type": "function", "loc": [19, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99942:ClassDef_L6_C0", "vector": [2, 1, 0.5909, 0.0606, 1, 0.57, 0.6, 434, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "attempt_to_login_with_credentials", "arg_names": ["self", "username", "password"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def attempt_to_login_with_credentials(self, username, password):\n self._run_command('login', username, password)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99942:Expr_L20_C8", "label": "_run_command()", "type": "expression", "loc": [20, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99942:FunctionDef_L19_C4", "vector": [8, 2, 0.6061, 0.0303, 2, 0.59, 0.0, 549, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "_run_command", "arg_names": [], "import_names": [], "rhs_call_name": "_run_command", "annotation": ""}, "snippet": " self._run_command('login', username, password)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99942:FunctionDef_L22_C4", "label": "status_should_be", "type": "function", "loc": [22, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99942:ClassDef_L6_C0", "vector": [2, 1, 0.7121, 0.1212, 1, 0.57, 0.8, 296, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "status_should_be", "arg_names": ["self", "expected_status"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def status_should_be(self, expected_status):\n if expected_status != self._status:\n raise AssertionError(\"Expected status to be '%s' but was '%s'\"\n % (expected_status, self._status))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99942:If_L23_C8", "label": "if", "type": "if", "loc": [23, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99942:FunctionDef_L22_C4", "vector": [4, 2, 0.7273, 0.0909, 2, 0.64, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if expected_status != self._status:\n raise AssertionError(\"Expected status to be '%s' but was '%s'\"\n % (expected_status, self._status))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99942:FunctionDef_L27_C4", "label": "_run_command", "type": "function", "loc": [27, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99942:ClassDef_L6_C0", "vector": [2, 1, 0.9091, 0.2121, 1, 0.57, 1.0, 549, 0, 3, 0, 0, 0, 0, 5], "semantic": {"name": "_run_command", "arg_names": ["self", "command", "args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _run_command(self, command, *args):\n if not sys.executable:\n raise RuntimeError(\"Could not find Jython installation\")\n command = [sys.executable, self._sut_path, command] + list(args)\n process = subprocess.Popen(command, stdout=subprocess.PIPE,\n stderr=subprocess.STDOUT)\n self._status = process.communicate()[0].strip()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99942:If_L28_C8", "label": "if", "type": "if", "loc": [28, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99942:FunctionDef_L27_C4", "vector": [4, 2, 0.8636, 0.0606, 2, 0.42, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not sys.executable:\n raise RuntimeError(\"Could not find Jython installation\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99942:Assign_L30_C8", "label": "command =", "type": "assigned_variable", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99942:FunctionDef_L27_C4", "vector": [14, 2, 0.9091, 0.0303, 2, 0.42, 0.3333, 842, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "command", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " command = [sys.executable, self._sut_path, command] + list(args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99942:Assign_L31_C8", "label": "process = Popen()", "type": "assigned_variable", "loc": [31, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99942:FunctionDef_L27_C4", "vector": [14, 2, 0.9545, 0.0606, 2, 0.42, 0.6667, 712, 3, 3, 0, 0, 568, 10, 1], "semantic": {"name": "process", "arg_names": [], "import_names": [], "rhs_call_name": "Popen", "annotation": ""}, "snippet": " process = subprocess.Popen(command, stdout=subprocess.PIPE,\n stderr=subprocess.STDOUT)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99942:Assign_L33_C8", "label": "self._status = strip()", "type": "assigned_variable", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99942:FunctionDef_L27_C4", "vector": [14, 2, 1.0, 0.0303, 2, 0.42, 1.0, 891, 3, 0, 0, 0, 973, 10, 2], "semantic": {"name": "self._status", "arg_names": [], "import_names": [], "rhs_call_name": "strip", "annotation": ""}, "snippet": " self._status = process.communicate()[0].strip()"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99942:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99942:FunctionDef_L8_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99942:FunctionDef_L8_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99942:Assign_L9_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99942:FunctionDef_L8_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99942:Assign_L11_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99942:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99942:FunctionDef_L13_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99942:FunctionDef_L13_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99942:Expr_L14_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99942:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99942:FunctionDef_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99942:FunctionDef_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99942:Expr_L17_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99942:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99942:FunctionDef_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99942:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99942:Expr_L20_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99942:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99942:FunctionDef_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99942:FunctionDef_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99942:If_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99942:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99942:FunctionDef_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99942:FunctionDef_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99942:If_L28_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99942:FunctionDef_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99942:Assign_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99942:FunctionDef_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99942:Assign_L31_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99942:FunctionDef_L27_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99942:Assign_L33_C8"}] |
def simple_keyword():
"""Log a message"""
print 'You have used the simplest keyword.'
def greet(name):
"""Logs a friendly greeting to person given as argument"""
print 'Hello %s!' % name
def multiply_by_two(number):
"""Returns the given number multiplied by two
The result is always a floating point number.
This keyword fails if the given `number` cannot be converted to number.
"""
return float(number) * 2
def numbers_should_be_equal(first, second):
print '*DEBUG* Got arguments %s and %s' % (first, second)
if float(first) != float(second):
raise AssertionError('Given numbers are unequal!')
| ajibawa-2023/Python-Code-Large/train/row_99943 | 12 | 20 | 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_99943:FunctionDef_L1_C0", "label": "simple_keyword", "type": "function", "loc": [1, 3], "level": 0, "parent": null, "vector": [2, 0, 0.1, 0.15, 0, 0.66, 0.0, 30, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "simple_keyword", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def simple_keyword():\n \"\"\"Log a message\"\"\"\n print('You have used the simplest keyword.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99943:Expr_L2_C4", "label": "expression", "type": "expression", "loc": [2, 2], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99943:FunctionDef_L1_C0", "vector": [8, 1, 0.1, 0.05, 1, 0.85, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Log a message\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99943:Expr_L3_C4", "label": "print()", "type": "expression", "loc": [3, 3], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99943:FunctionDef_L1_C0", "vector": [8, 1, 0.15, 0.05, 1, 0.85, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('You have used the simplest keyword.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99943:FunctionDef_L5_C0", "label": "greet", "type": "function", "loc": [5, 7], "level": 0, "parent": null, "vector": [2, 0, 0.3, 0.15, 0, 0.66, 0.3333, 81, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "greet", "arg_names": ["name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def greet(name):\n \"\"\"Logs a friendly greeting to person given as argument\"\"\"\n print('Hello %s!' % name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99943:Expr_L6_C4", "label": "expression", "type": "expression", "loc": [6, 6], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99943:FunctionDef_L5_C0", "vector": [8, 1, 0.3, 0.05, 1, 0.28, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Logs a friendly greeting to person given as argument\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99943:Expr_L7_C4", "label": "print()", "type": "expression", "loc": [7, 7], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99943:FunctionDef_L5_C0", "vector": [8, 1, 0.35, 0.05, 1, 0.28, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Hello %s!' % name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99943:FunctionDef_L9_C0", "label": "multiply_by_two", "type": "function", "loc": [9, 15], "level": 0, "parent": null, "vector": [2, 0, 0.6, 0.35, 0, 0.66, 0.6667, 348, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "multiply_by_two", "arg_names": ["number"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def multiply_by_two(number):\n \"\"\"Returns the given number multiplied by two\n \n The result is always a floating point number.\n This keyword fails if the given `number` cannot be converted to number.\n \"\"\"\n return float(number) * 2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99943:Expr_L10_C4", "label": "expression", "type": "expression", "loc": [10, 14], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99943:FunctionDef_L9_C0", "vector": [8, 1, 0.6, 0.25, 1, 0.09, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Returns the given number multiplied by two\n \n The result is always a floating point number.\n This keyword fails if the given `number` cannot be converted to number.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99943:Return_L15_C4", "label": "return", "type": "return", "loc": [15, 15], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99943:FunctionDef_L9_C0", "vector": [13, 1, 0.75, 0.05, 1, 0.09, 1.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return float(number) * 2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99943:FunctionDef_L17_C0", "label": "numbers_should_be_equal", "type": "function", "loc": [17, 20], "level": 0, "parent": null, "vector": [2, 0, 0.925, 0.2, 0, 0.66, 1.0, 356, 0, 2, 0, 0, 0, 0, 4], "semantic": {"name": "numbers_should_be_equal", "arg_names": ["first", "second"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def numbers_should_be_equal(first, second):\n print('*DEBUG* Got arguments %s and %s' % (first, second))\n if float(first) != float(second):\n raise AssertionError('Given numbers are unequal!')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99943:Expr_L18_C4", "label": "print()", "type": "expression", "loc": [18, 18], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99943:FunctionDef_L17_C0", "vector": [8, 1, 0.9, 0.05, 1, 0.55, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('*DEBUG* Got arguments %s and %s' % (first, second))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99943:If_L19_C4", "label": "if", "type": "if", "loc": [19, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99943:FunctionDef_L17_C0", "vector": [4, 1, 0.975, 0.1, 1, 0.55, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if float(first) != float(second):\n raise AssertionError('Given numbers are unequal!')"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99943:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99943:Expr_L2_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99943:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99943:Expr_L3_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99943:FunctionDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99943:Expr_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99943:FunctionDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99943:Expr_L7_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99943:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99943:Expr_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99943:FunctionDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99943:Return_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99943:FunctionDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99943:Expr_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99943:FunctionDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99943:If_L19_C4"}] |
#!/usr/bin/env python
"""pt2html.py -- Creates HTML version of Python Tutorial
Usage: pt2html.py
"""
import sys
import os
import shutil
import time
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', 'userguide'))
import ug2html # This also initializes docutils and pygments
def create_tutorial():
from docutils.core import publish_cmdline
print 'Creating Python Tutorial ...'
os.chdir(os.path.dirname(os.path.abspath(__file__)))
description = 'Python Tutorial for Robot Framework Library Developers'
arguments = '''
--time
--stylesheet-path=../userguide/src/userguide.css
PythonTutorial.rst
PythonTutorial.html
'''.split('\n')[1:-1]
publish_cmdline(writer_name='html', description=description, argv=arguments)
path = arguments[-1]
print os.path.abspath(path)
return path
if __name__ == '__main__':
create_tutorial()
| ajibawa-2023/Python-Code-Large/train/row_99944 | 19 | 36 | 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_99944:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 6], "level": 0, "parent": null, "vector": [8, 0, 0.125, 0.1111, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"pt2html.py -- Creates HTML version of Python Tutorial\n\nUsage: pt2html.py\n\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99944:Import_L8_C0", "label": "sys import sys", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.2222, 0.0278, 0, 0.66, 0.125, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99944:Import_L9_C0", "label": "os import os", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.25, 0.0278, 0, 0.66, 0.25, 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_99944:Import_L10_C0", "label": "shutil import shutil", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.2778, 0.0278, 0, 0.66, 0.375, 614, 0, 1, 0, 0, 614, 0, 0], "semantic": {"name": "shutil", "arg_names": [], "import_names": ["shutil"], "rhs_call_name": "", "annotation": ""}, "snippet": "import shutil"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99944:Import_L11_C0", "label": "time import time", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.3056, 0.0278, 0, 0.66, 0.5, 654, 0, 1, 0, 0, 654, 0, 0], "semantic": {"name": "time", "arg_names": [], "import_names": ["time"], "rhs_call_name": "", "annotation": ""}, "snippet": "import time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99944:Expr_L13_C0", "label": "insert()", "type": "expression", "loc": [13, 13], "level": 0, "parent": null, "vector": [8, 0, 0.3611, 0.0278, 0, 0.66, 0.625, 368, 3, 2, 0, 0, 0, 0, 3], "semantic": {"name": "insert", "arg_names": [], "import_names": [], "rhs_call_name": "insert", "annotation": ""}, "snippet": "sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', 'userguide'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99944:Import_L14_C0", "label": "ug2html import ug2html", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.3889, 0.0278, 0, 0.66, 0.75, 350, 0, 1, 0, 0, 350, 0, 0], "semantic": {"name": "ug2html", "arg_names": [], "import_names": ["ug2html"], "rhs_call_name": "", "annotation": ""}, "snippet": "import ug2html # This also initializes docutils and pygments"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99944:FunctionDef_L17_C0", "label": "create_tutorial", "type": "function", "loc": [17, 32], "level": 0, "parent": null, "vector": [2, 0, 0.6806, 0.4444, 0, 0.66, 0.875, 809, 0, 0, 1, 0, 0, 0, 8], "semantic": {"name": "create_tutorial", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def create_tutorial():\n from docutils.core import publish_cmdline\n\n print('Creating Python Tutorial ...')\n os.chdir(os.path.dirname(os.path.abspath(__file__)))\n description = 'Python Tutorial for Robot Framework Library Developers'\n arguments = '''\n--time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99944:ImportFrom_L18_C4", "label": "from docutils.core import publish_cmdline", "type": "import", "loc": [18, 18], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99944:FunctionDef_L17_C0", "vector": [1, 1, 0.5, 0.0278, 1, 0.55, 0.0, 219, 0, 1, 0, 0, 219, 0, 0], "semantic": {"name": "docutils.core", "arg_names": [], "import_names": ["publish_cmdline"], "rhs_call_name": "", "annotation": ""}, "snippet": " from docutils.core import publish_cmdline"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99944:Expr_L20_C4", "label": "print()", "type": "expression", "loc": [20, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99944:FunctionDef_L17_C0", "vector": [8, 1, 0.5556, 0.0278, 1, 0.55, 0.125, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Creating Python Tutorial ...')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99944:Expr_L21_C4", "label": "chdir()", "type": "expression", "loc": [21, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99944:FunctionDef_L17_C0", "vector": [8, 1, 0.5833, 0.0278, 1, 0.55, 0.25, 122, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "chdir", "arg_names": [], "import_names": [], "rhs_call_name": "chdir", "annotation": ""}, "snippet": " os.chdir(os.path.dirname(os.path.abspath(__file__)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99944:Assign_L22_C4", "label": "description =", "type": "assigned_variable", "loc": [22, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99944:FunctionDef_L17_C0", "vector": [14, 1, 0.6111, 0.0278, 1, 0.55, 0.375, 306, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "description", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " description = 'Python Tutorial for Robot Framework Library Developers'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99944:Assign_L23_C4", "label": "arguments =", "type": "assigned_variable", "loc": [23, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99944:FunctionDef_L17_C0", "vector": [14, 1, 0.7083, 0.1667, 1, 0.55, 0.5, 426, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "arguments", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " arguments = '''\n--time\n--stylesheet-path=../userguide/src/userguide.css\nPythonTutorial.rst\nPythonTutorial.html\n'''.split('\\n')[1:-1] "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99944:Expr_L29_C4", "label": "publish_cmdline()", "type": "expression", "loc": [29, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99944:FunctionDef_L17_C0", "vector": [8, 1, 0.8056, 0.0278, 1, 0.55, 0.625, 679, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "publish_cmdline", "arg_names": [], "import_names": [], "rhs_call_name": "publish_cmdline", "annotation": ""}, "snippet": " publish_cmdline(writer_name='html', description=description, argv=arguments)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99944:Assign_L30_C4", "label": "path =", "type": "assigned_variable", "loc": [30, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99944:FunctionDef_L17_C0", "vector": [14, 1, 0.8333, 0.0278, 1, 0.55, 0.75, 358, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "path", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " path = arguments[-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99944:Expr_L31_C4", "label": "print()", "type": "expression", "loc": [31, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99944:FunctionDef_L17_C0", "vector": [8, 1, 0.8611, 0.0278, 1, 0.55, 0.875, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(os.path.abspath(path))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99944:Return_L32_C4", "label": "return", "type": "return", "loc": [32, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99944:FunctionDef_L17_C0", "vector": [13, 1, 0.8889, 0.0278, 1, 0.55, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return path"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99944:If_L35_C0", "label": "if", "type": "if", "loc": [35, 36], "level": 0, "parent": null, "vector": [4, 0, 0.9861, 0.0556, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n create_tutorial()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99944:Expr_L36_C4", "label": "create_tutorial()", "type": "expression", "loc": [36, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99944:If_L35_C0", "vector": [8, 1, 1.0, 0.0278, 1, 0.33, 0.0, 809, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "create_tutorial", "arg_names": [], "import_names": [], "rhs_call_name": "create_tutorial", "annotation": ""}, "snippet": " create_tutorial()"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99944:FunctionDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99944:ImportFrom_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99944:FunctionDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99944:Expr_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99944:FunctionDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99944:Expr_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99944:FunctionDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99944:Assign_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99944:FunctionDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99944:Assign_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99944:FunctionDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99944:Expr_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99944:FunctionDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99944:Assign_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99944:FunctionDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99944:Expr_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99944:FunctionDef_L17_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99944:Return_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99944:If_L35_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99944:Expr_L36_C4"}] |
#!/usr/bin/env python
"""Usage: lib2html.py [ library | all ]
Libraries:
BuiltIn (bu)
Collections (co)
Dialogs (di)
OperatingSystem (op)
Screenshot (sc)
String (st)
Telnet (te)
"""
import sys
import tempfile
import os
import re
ROOT = os.path.normpath(os.path.join(os.path.abspath(__file__),'..','..','..'))
LIBRARIES = {}
for line in __doc__.splitlines():
res = re.search('(\w+) \((\w\w)\)', line)
if res:
name, alias = res.groups()
LIBRARIES[name.lower()] = LIBRARIES[alias] = name
sys.path.insert(0, os.path.join(ROOT,'tools','libdoc'))
sys.path.insert(0, os.path.join(ROOT,'src'))
from libdoc import LibraryDoc, create_html_doc
def create_libdoc(name):
ipath = os.path.join(ROOT,'src','robot','libraries',name+'.py')
opath = os.path.join(ROOT,'doc','libraries',name+'.html')
create_html_doc(LibraryDoc(ipath), opath)
print opath
if __name__ == '__main__':
try:
name = sys.argv[1].lower()
if name == 'all':
for name in sorted(set(LIBRARIES.values())):
create_libdoc(name)
else:
create_libdoc(LIBRARIES[name])
except (IndexError, KeyError):
print __doc__
| ajibawa-2023/Python-Code-Large/train/row_99945 | 28 | 50 | 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_99945:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 13], "level": 0, "parent": null, "vector": [8, 0, 0.16, 0.22, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"Usage: lib2html.py [ library | all ]\n\nLibraries:\n BuiltIn (bu)\n Collections (co)\n Dialogs (di)\n OperatingSystem (op)\n Screenshot (sc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99945:Import_L15_C0", "label": "sys import sys", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.3, 0.02, 0, 0.66, 0.0833, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99945:Import_L16_C0", "label": "tempfile import tempfile", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.32, 0.02, 0, 0.66, 0.1667, 516, 0, 1, 0, 0, 516, 0, 0], "semantic": {"name": "tempfile", "arg_names": [], "import_names": ["tempfile"], "rhs_call_name": "", "annotation": ""}, "snippet": "import tempfile"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99945:Import_L17_C0", "label": "os import os", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.34, 0.02, 0, 0.66, 0.25, 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_99945:Import_L18_C0", "label": "re import re", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.36, 0.02, 0, 0.66, 0.3333, 540, 0, 1, 0, 0, 540, 0, 0], "semantic": {"name": "re", "arg_names": [], "import_names": ["re"], "rhs_call_name": "", "annotation": ""}, "snippet": "import re"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99945:Assign_L20_C0", "label": "ROOT = normpath()", "type": "assigned_variable", "loc": [20, 20], "level": 0, "parent": null, "vector": [14, 0, 0.4, 0.02, 0, 0.66, 0.4167, 986, 3, 1, 0, 0, 638, 10, 3], "semantic": {"name": "ROOT", "arg_names": [], "import_names": [], "rhs_call_name": "normpath", "annotation": ""}, "snippet": "ROOT = os.path.normpath(os.path.join(os.path.abspath(__file__),'..','..','..'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99945:Assign_L21_C0", "label": "LIBRARIES =", "type": "assigned_variable", "loc": [21, 21], "level": 0, "parent": null, "vector": [14, 0, 0.42, 0.02, 0, 0.66, 0.5, 735, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "LIBRARIES", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "LIBRARIES = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99945:For_L22_C0", "label": "for line", "type": "for", "loc": [22, 26], "level": 0, "parent": null, "vector": [6, 0, 0.48, 0.1, 0, 0.66, 0.5833, 373, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "line", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "for line in __doc__.splitlines():\n res = re.search('(\\w+) \\((\\w\\w)\\)', line)\n if res:\n name, alias = res.groups()\n LIBRARIES[name.lower()] = LIBRARIES[alias] = name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99945:Assign_L23_C4", "label": "res = search()", "type": "assigned_variable", "loc": [23, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99945:For_L22_C0", "vector": [14, 1, 0.46, 0.02, 1, 0.57, 0.0, 413, 3, 2, 0, 0, 163, 10, 1], "semantic": {"name": "res", "arg_names": [], "import_names": [], "rhs_call_name": "search", "annotation": ""}, "snippet": " res = re.search('(\\w+) \\((\\w\\w)\\)', line)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99945:If_L24_C4", "label": "if", "type": "if", "loc": [24, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99945:For_L22_C0", "vector": [4, 1, 0.5, 0.06, 1, 0.57, 1.0, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if res:\n name, alias = res.groups()\n LIBRARIES[name.lower()] = LIBRARIES[alias] = name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99945:Assign_L25_C8", "label": "name, alias = groups()", "type": "assigned_variable", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99945:If_L24_C4", "vector": [14, 2, 0.5, 0.02, 2, 0.56, 0.0, 200, 3, 0, 0, 0, 161, 10, 1], "semantic": {"name": "name, alias", "arg_names": [], "import_names": [], "rhs_call_name": "groups", "annotation": ""}, "snippet": " name, alias = res.groups()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99945:Assign_L26_C8", "label": "assign", "type": "assigned_variable", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99945:If_L24_C4", "vector": [14, 2, 0.52, 0.02, 2, 0.56, 1.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " LIBRARIES[name.lower()] = LIBRARIES[alias] = name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99945:Expr_L28_C0", "label": "insert()", "type": "expression", "loc": [28, 28], "level": 0, "parent": null, "vector": [8, 0, 0.56, 0.02, 0, 0.66, 0.6667, 368, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "insert", "arg_names": [], "import_names": [], "rhs_call_name": "insert", "annotation": ""}, "snippet": "sys.path.insert(0, os.path.join(ROOT,'tools','libdoc'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99945:Expr_L29_C0", "label": "insert()", "type": "expression", "loc": [29, 29], "level": 0, "parent": null, "vector": [8, 0, 0.58, 0.02, 0, 0.66, 0.75, 368, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "insert", "arg_names": [], "import_names": [], "rhs_call_name": "insert", "annotation": ""}, "snippet": "sys.path.insert(0, os.path.join(ROOT,'src'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99945:ImportFrom_L31_C0", "label": "from libdoc import LibraryDoc, create_html_doc", "type": "import", "loc": [31, 31], "level": 0, "parent": null, "vector": [1, 0, 0.62, 0.02, 0, 0.66, 0.8333, 566, 0, 2, 0, 0, 566, 0, 0], "semantic": {"name": "libdoc", "arg_names": [], "import_names": ["LibraryDoc", "create_html_doc"], "rhs_call_name": "", "annotation": ""}, "snippet": "from libdoc import LibraryDoc, create_html_doc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99945:FunctionDef_L34_C0", "label": "create_libdoc", "type": "function", "loc": [34, 38], "level": 0, "parent": null, "vector": [2, 0, 0.72, 0.1, 0, 0.66, 0.9167, 345, 0, 1, 0, 0, 0, 0, 5], "semantic": {"name": "create_libdoc", "arg_names": ["name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def create_libdoc(name):\n ipath = os.path.join(ROOT,'src','robot','libraries',name+'.py')\n opath = os.path.join(ROOT,'doc','libraries',name+'.html')\n create_html_doc(LibraryDoc(ipath), opath)\n print(opath)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99945:Assign_L35_C4", "label": "ipath = join()", "type": "assigned_variable", "loc": [35, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99945:FunctionDef_L34_C0", "vector": [14, 1, 0.7, 0.02, 1, 0.53, 0.0, 53, 3, 5, 0, 0, 933, 10, 1], "semantic": {"name": "ipath", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " ipath = os.path.join(ROOT,'src','robot','libraries',name+'.py')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99945:Assign_L36_C4", "label": "opath = join()", "type": "assigned_variable", "loc": [36, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99945:FunctionDef_L34_C0", "vector": [14, 1, 0.72, 0.02, 1, 0.53, 0.3333, 904, 3, 4, 0, 0, 933, 10, 1], "semantic": {"name": "opath", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " opath = os.path.join(ROOT,'doc','libraries',name+'.html')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99945:Expr_L37_C4", "label": "create_html_doc()", "type": "expression", "loc": [37, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99945:FunctionDef_L34_C0", "vector": [8, 1, 0.74, 0.02, 1, 0.53, 0.6667, 611, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "create_html_doc", "arg_names": [], "import_names": [], "rhs_call_name": "create_html_doc", "annotation": ""}, "snippet": " create_html_doc(LibraryDoc(ipath), opath)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99945:Expr_L38_C4", "label": "print()", "type": "expression", "loc": [38, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99945:FunctionDef_L34_C0", "vector": [8, 1, 0.76, 0.02, 1, 0.53, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(opath)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99945:If_L41_C0", "label": "if", "type": "if", "loc": [41, 50], "level": 0, "parent": null, "vector": [4, 0, 0.91, 0.2, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n try:\n name = sys.argv[1].lower()\n if name == 'all':\n for name in sorted(set(LIBRARIES.values())):\n create_libdoc(name)\n else:\n create_libdoc(LIBRARIES[name])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99945:Try_L42_C4", "label": "try", "type": "try", "loc": [42, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99945:If_L41_C0", "vector": [7, 1, 0.92, 0.18, 1, 0.65, 0.0, 0, 0, 1, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n name = sys.argv[1].lower()\n if name == 'all':\n for name in sorted(set(LIBRARIES.values())):\n create_libdoc(name)\n else:\n create_libdoc(LIBRARIES[name])\n except (IndexError, KeyError):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99945:Assign_L43_C8", "label": "name = lower()", "type": "assigned_variable", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99945:Try_L42_C4", "vector": [14, 2, 0.86, 0.02, 2, 0.45, 0.0, 57, 3, 0, 0, 0, 432, 10, 1], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "lower", "annotation": ""}, "snippet": " name = sys.argv[1].lower()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99945:If_L44_C8", "label": "if", "type": "if", "loc": [44, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99945:Try_L42_C4", "vector": [4, 2, 0.92, 0.1, 2, 0.45, 1.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if name == 'all':\n for name in sorted(set(LIBRARIES.values())):\n create_libdoc(name)\n else:\n create_libdoc(LIBRARIES[name])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99945:For_L45_C12", "label": "for name", "type": "for", "loc": [45, 46], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99945:If_L44_C8", "vector": [6, 3, 0.91, 0.04, 3, 0.29, 0.0, 57, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for name in sorted(set(LIBRARIES.values())):\n create_libdoc(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99945:Expr_L46_C16", "label": "create_libdoc()", "type": "expression", "loc": [46, 46], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99945:For_L45_C12", "vector": [8, 4, 0.92, 0.02, 4, 0.36, 0.0, 345, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "create_libdoc", "arg_names": [], "import_names": [], "rhs_call_name": "create_libdoc", "annotation": ""}, "snippet": " create_libdoc(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99945:Expr_L48_C12", "label": "create_libdoc()", "type": "expression", "loc": [48, 48], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99945:If_L44_C8", "vector": [8, 3, 0.96, 0.02, 3, 0.29, 1.0, 345, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "create_libdoc", "arg_names": [], "import_names": [], "rhs_call_name": "create_libdoc", "annotation": ""}, "snippet": " create_libdoc(LIBRARIES[name])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99945:Expr_L50_C8", "label": "print()", "type": "expression", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99945:Try_L42_C4", "vector": [8, 2, 1.0, 0.02, 2, 0.45, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(__doc__)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99945:For_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99945:Assign_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99945:For_L22_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99945:If_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99945:If_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99945:Assign_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99945:If_L24_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99945:Assign_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99945:FunctionDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99945:Assign_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99945:FunctionDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99945:Assign_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99945:FunctionDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99945:Expr_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99945:FunctionDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99945:Expr_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99945:If_L41_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99945:Try_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99945:Try_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99945:Assign_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99945:Try_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99945:If_L44_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99945:If_L44_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99945:For_L45_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99945:For_L45_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99945:Expr_L46_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99945:If_L44_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99945:Expr_L48_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99945:Try_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99945:Expr_L50_C8"}] |
#!/usr/bin/env python
"""ug2html.py -- Creates HTML version of Robot Framework User Guide
Usage: ug2html.py [ cr(eate) | dist | zip ]
create .. Creates the user guide so that it has relative links to images,
library docs, etc. This version is stored in the version control
and distributed with the source distribution.
dist .... Creates the user guide under 'robotframework-userguide-<version>'
directory and also copies all needed images and other link targets
there. The created output directory can thus be distributed
independently.
zip ..... Uses 'dist' to create a stand-alone distribution and then packages
it into 'robotframework-userguide-<version>.zip'
Version number to use is got automatically from 'src/robot/version.py' file
created by 'package.py'.
"""
import os
import sys
import shutil
# First part of this file is Pygments configuration and actual
# documentation generation follows it.
#
#
# Pygments configuration
# ----------------------
#
# This code is from 'external/rst-directive.py' file included in Pygments 0.9
# distribution. For more details see http://pygments.org/docs/rstdirective/
#
"""
The Pygments MoinMoin Parser
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This fragment is a Docutils_ 0.4 directive that renders source code
(to HTML only, currently) via Pygments.
To use it, adjust the options below and copy the code into a module
that you import on initialization. The code then automatically
registers a ``sourcecode`` directive that you can use instead of
normal code blocks like this::
.. sourcecode:: python
My code goes here.
If you want to have different code styles, e.g. one with line numbers
and one without, add formatters with their names in the VARIANTS dict
below. You can invoke them instead of the DEFAULT one by using a
directive option::
.. sourcecode:: python
:linenos:
My code goes here.
Look at the `directive documentation`_ to get all the gory details.
.. _Docutils: http://docutils.sf.net/
.. _directive documentation:
http://docutils.sourceforge.net/docs/howto/rst-directives.html
:copyright: 2007 by Georg Brandl.
:license: BSD, see LICENSE for more details.
"""
# Options
# ~~~~~~~
# Set to True if you want inline CSS styles instead of classes
INLINESTYLES = False
from pygments.formatters import HtmlFormatter
# The default formatter
DEFAULT = HtmlFormatter(noclasses=INLINESTYLES)
# Add name -> formatter pairs for every variant you want to use
VARIANTS = {
# 'linenos': HtmlFormatter(noclasses=INLINESTYLES, linenos=True),
}
from docutils import nodes
from docutils.parsers.rst import directives
from pygments import highlight
from pygments.lexers import get_lexer_by_name, TextLexer
def pygments_directive(name, arguments, options, content, lineno,
content_offset, block_text, state, state_machine):
try:
lexer = get_lexer_by_name(arguments[0])
except ValueError:
# no lexer found - use the text one instead of an exception
lexer = TextLexer()
# take an arbitrary option if more than one is given
formatter = options and VARIANTS[options.keys()[0]] or DEFAULT
# possibility to read the content from an external file
filtered = [ line for line in content if line.strip() ]
if len(filtered) == 1:
path = filtered[0].replace('/', os.sep)
if os.path.isfile(path):
content = open(path).read().splitlines()
parsed = highlight(u'\n'.join(content), lexer, formatter)
return [nodes.raw('', parsed, format='html')]
pygments_directive.arguments = (1, 0, 1)
pygments_directive.content = 1
pygments_directive.options = dict([(key, directives.flag) for key in VARIANTS])
directives.register_directive('sourcecode', pygments_directive)
#
# Create the user guide using docutils
#
# This code is based on rst2html.py distributed with docutils
#
try:
import locale
locale.setlocale(locale.LC_ALL, '')
except:
pass
def create_userguide():
from docutils.core import publish_cmdline
print 'Creating user guide ...'
ugdir = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, os.path.join(ugdir, '..', '..', 'src', 'robot'))
from version import get_version
print 'Version:', get_version()
vfile = open(os.path.join(ugdir, 'src', 'version.txt'), 'w')
vfile.write('.. |version| replace:: %s\n' % get_version())
vfile.close()
description = 'HTML generator for Robot Framework User Guide.'
arguments = '''
--time
--stylesheet-path=src/userguide.css
src/RobotFrameworkUserGuide.txt
RobotFrameworkUserGuide.html
'''.split('\n')[1:-1]
os.chdir(ugdir)
publish_cmdline(writer_name='html', description=description, argv=arguments)
os.unlink(vfile.name)
ugpath = os.path.abspath(arguments[-1])
print ugpath
return ugpath, get_version(sep='-')
#
# Create user guide distribution directory
#
def create_distribution():
import re
from urlparse import urlparse
ugpath, version = create_userguide() # we are in doc/userguide after this
outdir = 'robotframework-userguide-%s' % version
tools = os.path.join(outdir, 'tools')
templates = os.path.join(outdir, 'templates')
libraries = os.path.join(outdir, 'libraries')
images = os.path.join(outdir, 'images')
print 'Creating distribution directory ...'
if os.path.exists(outdir):
print 'Removing previous user guide distribution'
shutil.rmtree(outdir)
for dirname in [outdir, tools, templates, libraries, images]:
print "Creating output directory '%s'" % dirname
os.mkdir(dirname)
def replace_links(res):
if not res.group(5):
return res.group(0)
scheme, _, path, _, _, fragment = urlparse(res.group(5))
if scheme or (fragment and not path):
return res.group(0)
replaced_link = '%s %s="%%s/%s"' % (res.group(1), res.group(4),
os.path.basename(path))
if path.startswith('../../tools'):
copy(path, tools)
copy_tool_images(path)
replaced_link = replaced_link % 'tools'
elif path.startswith('../../templates'):
copy(path, templates)
replaced_link = replaced_link % 'templates'
elif path.startswith('../libraries'):
copy(path, libraries)
replaced_link = replaced_link % 'libraries'
elif path.startswith('src/'):
copy(path, images)
replaced_link = replaced_link % 'images'
else:
raise ValueError('Invalid link target: %s' % path)
print "Modified link '%s' -> '%s'" % (res.group(0), replaced_link)
return replaced_link
def copy(source, dest):
print "Copying '%s' -> '%s'" % (source, dest)
shutil.copy(source, dest)
def copy_tool_images(path):
indir = os.path.dirname(path)
for line in open(os.path.splitext(path)[0]+'.txt').readlines():
if line.startswith('.. figure::'):
copy(os.path.join(indir, line.strip().split()[-1]), tools)
link_regexp = re.compile('''
(<(a|img)\s+.*?)
(\s+(href|src)="(.*?)"|>)
''', re.VERBOSE | re.DOTALL | re.IGNORECASE)
content = open(ugpath).read()
content = link_regexp.sub(replace_links, content)
outfile = open(os.path.join(outdir, os.path.basename(ugpath)), 'wb')
outfile.write(content)
outfile.close()
print os.path.abspath(outfile.name)
return outdir
#
# Create a zip distribution package
#
def create_zip():
ugdir = create_distribution()
zip_distribution(ugdir)
def zip_distribution(dirpath):
"""Generic zipper. Used also by qs2html.py """
from zipfile import ZipFile, ZIP_DEFLATED
print 'Creating zip package ...'
zippath = os.path.normpath(dirpath) + '.zip'
zipfile = ZipFile(zippath, 'w', compression=ZIP_DEFLATED)
for root, _, files in os.walk(dirpath):
for name in files:
path = os.path.join(root, name)
print "Adding '%s'" % path
zipfile.write(path)
zipfile.close()
print 'Removing distribution directory', dirpath
shutil.rmtree(dirpath)
print os.path.abspath(zippath)
if __name__ == '__main__':
actions = { 'create': create_userguide, 'cr': create_userguide,
'dist': create_distribution, 'zip': create_zip }
try:
actions[sys.argv[1]](*sys.argv[2:])
except (KeyError, IndexError, TypeError):
print __doc__
| ajibawa-2023/Python-Code-Large/train/row_99946 | 127 | 264 | 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_99946:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 21], "level": 0, "parent": null, "vector": [8, 0, 0.0455, 0.072, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"ug2html.py -- Creates HTML version of Robot Framework User Guide\n\nUsage: ug2html.py [ cr(eate) | dist | zip ]\n\ncreate .. Creates the user guide so that it has relative links to images,\n library docs, etc. This version is stored in the version control\n and distributed with the source distribution.\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Import_L23_C0", "label": "os import os", "type": "import", "loc": [23, 23], "level": 0, "parent": null, "vector": [1, 0, 0.0871, 0.0038, 0, 0.66, 0.0435, 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_99946:Import_L24_C0", "label": "sys import sys", "type": "import", "loc": [24, 24], "level": 0, "parent": null, "vector": [1, 0, 0.0909, 0.0038, 0, 0.66, 0.087, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Import_L25_C0", "label": "shutil import shutil", "type": "import", "loc": [25, 25], "level": 0, "parent": null, "vector": [1, 0, 0.0947, 0.0038, 0, 0.66, 0.1304, 614, 0, 1, 0, 0, 614, 0, 0], "semantic": {"name": "shutil", "arg_names": [], "import_names": ["shutil"], "rhs_call_name": "", "annotation": ""}, "snippet": "import shutil"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L38_C0", "label": "expression", "type": "expression", "loc": [38, 72], "level": 0, "parent": null, "vector": [8, 0, 0.2083, 0.1326, 0, 0.66, 0.1739, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"\n The Pygments MoinMoin Parser\n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n This fragment is a Docutils_ 0.4 directive that renders source code\n (to HTML only, currently) via Pygments.\n\n To use it, adjust the options below and copy the code into a module"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L78_C0", "label": "INLINESTYLES =", "type": "assigned_variable", "loc": [78, 78], "level": 0, "parent": null, "vector": [14, 0, 0.2955, 0.0038, 0, 0.66, 0.2174, 281, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "INLINESTYLES", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "INLINESTYLES = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:ImportFrom_L80_C0", "label": "from pygments.formatters import HtmlFormatter", "type": "import", "loc": [80, 80], "level": 0, "parent": null, "vector": [1, 0, 0.303, 0.0038, 0, 0.66, 0.2609, 443, 0, 1, 0, 0, 443, 0, 0], "semantic": {"name": "pygments.formatters", "arg_names": [], "import_names": ["HtmlFormatter"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pygments.formatters import HtmlFormatter"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L83_C0", "label": "DEFAULT = HtmlFormatter()", "type": "assigned_variable", "loc": [83, 83], "level": 0, "parent": null, "vector": [14, 0, 0.3144, 0.0038, 0, 0.66, 0.3043, 570, 3, 1, 0, 0, 75, 10, 1], "semantic": {"name": "DEFAULT", "arg_names": [], "import_names": [], "rhs_call_name": "HtmlFormatter", "annotation": ""}, "snippet": "DEFAULT = HtmlFormatter(noclasses=INLINESTYLES)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L86_C0", "label": "VARIANTS =", "type": "assigned_variable", "loc": [86, 88], "level": 0, "parent": null, "vector": [14, 0, 0.3295, 0.0114, 0, 0.66, 0.3478, 186, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "VARIANTS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "VARIANTS = {\n # 'linenos': HtmlFormatter(noclasses=INLINESTYLES, linenos=True),\n}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:ImportFrom_L90_C0", "label": "from docutils import nodes", "type": "import", "loc": [90, 90], "level": 0, "parent": null, "vector": [1, 0, 0.3409, 0.0038, 0, 0.66, 0.3913, 976, 0, 1, 0, 0, 976, 0, 0], "semantic": {"name": "docutils", "arg_names": [], "import_names": ["nodes"], "rhs_call_name": "", "annotation": ""}, "snippet": "from docutils import nodes"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:ImportFrom_L91_C0", "label": "from docutils.parsers.rst import directives", "type": "import", "loc": [91, 91], "level": 0, "parent": null, "vector": [1, 0, 0.3447, 0.0038, 0, 0.66, 0.4348, 299, 0, 1, 0, 0, 299, 0, 0], "semantic": {"name": "docutils.parsers.rst", "arg_names": [], "import_names": ["directives"], "rhs_call_name": "", "annotation": ""}, "snippet": "from docutils.parsers.rst import directives"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:ImportFrom_L93_C0", "label": "from pygments import highlight", "type": "import", "loc": [93, 93], "level": 0, "parent": null, "vector": [1, 0, 0.3523, 0.0038, 0, 0.66, 0.4783, 638, 0, 1, 0, 0, 638, 0, 0], "semantic": {"name": "pygments", "arg_names": [], "import_names": ["highlight"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pygments import highlight"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:ImportFrom_L94_C0", "label": "from pygments.lexers import get_lexer_by_name, TextLexer", "type": "import", "loc": [94, 94], "level": 0, "parent": null, "vector": [1, 0, 0.3561, 0.0038, 0, 0.66, 0.5217, 18, 0, 2, 0, 0, 18, 0, 0], "semantic": {"name": "pygments.lexers", "arg_names": [], "import_names": ["get_lexer_by_name", "TextLexer"], "rhs_call_name": "", "annotation": ""}, "snippet": "from pygments.lexers import get_lexer_by_name, TextLexer"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L96_C0", "label": "pygments_directive", "type": "function", "loc": [96, 112], "level": 0, "parent": null, "vector": [2, 0, 0.3939, 0.0644, 0, 0.66, 0.5652, 640, 0, 9, 1, 0, 0, 0, 13], "semantic": {"name": "pygments_directive", "arg_names": ["name", "arguments", "options", "content", "lineno", "content_offset", "block_text", "state", "state_machine"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def pygments_directive(name, arguments, options, content, lineno,\n content_offset, block_text, state, state_machine):\n try:\n lexer = get_lexer_by_name(arguments[0])\n except ValueError:\n # no lexer found - use the text one instead of an exception\n lexer = TextLexer()\n # take an arbitrary option if more than one is given"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Try_L98_C4", "label": "try", "type": "try", "loc": [98, 102], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L96_C0", "vector": [7, 1, 0.3788, 0.0189, 1, 0.18, 0.0, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n lexer = get_lexer_by_name(arguments[0])\n except ValueError:\n # no lexer found - use the text one instead of an exception\n lexer = TextLexer()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L99_C8", "label": "lexer = get_lexer_by_name()", "type": "assigned_variable", "loc": [99, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:Try_L98_C4", "vector": [14, 2, 0.375, 0.0038, 2, 0.24, 0.0, 672, 3, 1, 0, 0, 456, 10, 1], "semantic": {"name": "lexer", "arg_names": [], "import_names": [], "rhs_call_name": "get_lexer_by_name", "annotation": ""}, "snippet": " lexer = get_lexer_by_name(arguments[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L102_C8", "label": "lexer = TextLexer()", "type": "assigned_variable", "loc": [102, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:Try_L98_C4", "vector": [14, 2, 0.3864, 0.0038, 2, 0.24, 0.0, 672, 3, 0, 0, 0, 732, 10, 1], "semantic": {"name": "lexer", "arg_names": [], "import_names": [], "rhs_call_name": "TextLexer", "annotation": ""}, "snippet": " lexer = TextLexer()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L104_C4", "label": "formatter =", "type": "assigned_variable", "loc": [104, 104], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L96_C0", "vector": [14, 1, 0.3939, 0.0038, 1, 0.18, 0.2, 791, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "formatter", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " formatter = options and VARIANTS[options.keys()[0]] or DEFAULT"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L106_C4", "label": "filtered =", "type": "assigned_variable", "loc": [106, 106], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L96_C0", "vector": [14, 1, 0.4015, 0.0038, 1, 0.18, 0.4, 429, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "filtered", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " filtered = [ line for line in content if line.strip() ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:If_L107_C4", "label": "if", "type": "if", "loc": [107, 110], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L96_C0", "vector": [4, 1, 0.411, 0.0152, 1, 0.18, 0.6, 0, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(filtered) == 1:\n path = filtered[0].replace('/', os.sep)\n if os.path.isfile(path):\n content = open(path).read().splitlines()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L108_C8", "label": "path = replace()", "type": "assigned_variable", "loc": [108, 108], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:If_L107_C4", "vector": [14, 2, 0.4091, 0.0038, 2, 0.14, 0.0, 358, 3, 2, 0, 0, 293, 10, 1], "semantic": {"name": "path", "arg_names": [], "import_names": [], "rhs_call_name": "replace", "annotation": ""}, "snippet": " path = filtered[0].replace('/', os.sep)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:If_L109_C8", "label": "if", "type": "if", "loc": [109, 110], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:If_L107_C4", "vector": [4, 2, 0.4148, 0.0076, 2, 0.14, 1.0, 0, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if os.path.isfile(path):\n content = open(path).read().splitlines()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L110_C12", "label": "content = splitlines()", "type": "assigned_variable", "loc": [110, 110], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:If_L109_C8", "vector": [14, 3, 0.4167, 0.0038, 3, 0.06, 0.0, 273, 3, 0, 0, 0, 296, 10, 3], "semantic": {"name": "content", "arg_names": [], "import_names": [], "rhs_call_name": "splitlines", "annotation": ""}, "snippet": " content = open(path).read().splitlines()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L111_C4", "label": "parsed = highlight()", "type": "assigned_variable", "loc": [111, 111], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L96_C0", "vector": [14, 1, 0.4205, 0.0038, 1, 0.18, 0.8, 313, 3, 3, 0, 0, 449, 10, 2], "semantic": {"name": "parsed", "arg_names": [], "import_names": [], "rhs_call_name": "highlight", "annotation": ""}, "snippet": " parsed = highlight(u'\\n'.join(content), lexer, formatter)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Return_L112_C4", "label": "return", "type": "return", "loc": [112, 112], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L96_C0", "vector": [13, 1, 0.4242, 0.0038, 1, 0.18, 1.0, 0, 0, 0, 0, 0, 0, 5, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [nodes.raw('', parsed, format='html')]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L114_C0", "label": "pygments_directive.arguments =", "type": "assigned_variable", "loc": [114, 114], "level": 0, "parent": null, "vector": [14, 0, 0.4318, 0.0038, 0, 0.66, 0.6087, 804, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "pygments_directive.arguments", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "pygments_directive.arguments = (1, 0, 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L115_C0", "label": "pygments_directive.content =", "type": "assigned_variable", "loc": [115, 115], "level": 0, "parent": null, "vector": [14, 0, 0.4356, 0.0038, 0, 0.66, 0.6522, 44, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "pygments_directive.content", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "pygments_directive.content = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L116_C0", "label": "pygments_directive.options = dict()", "type": "assigned_variable", "loc": [116, 116], "level": 0, "parent": null, "vector": [14, 0, 0.4394, 0.0038, 0, 0.66, 0.6957, 160, 3, 1, 0, 0, 827, 10, 1], "semantic": {"name": "pygments_directive.options", "arg_names": [], "import_names": [], "rhs_call_name": "dict", "annotation": ""}, "snippet": "pygments_directive.options = dict([(key, directives.flag) for key in VARIANTS])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L118_C0", "label": "register_directive()", "type": "expression", "loc": [118, 118], "level": 0, "parent": null, "vector": [8, 0, 0.447, 0.0038, 0, 0.66, 0.7391, 78, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "register_directive", "arg_names": [], "import_names": [], "rhs_call_name": "register_directive", "annotation": ""}, "snippet": "directives.register_directive('sourcecode', pygments_directive)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Try_L126_C0", "label": "try", "type": "try", "loc": [126, 130], "level": 0, "parent": null, "vector": [7, 0, 0.4848, 0.0189, 0, 0.66, 0.7826, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "try:\n import locale\n locale.setlocale(locale.LC_ALL, '')\nexcept:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Import_L127_C4", "label": "locale import locale", "type": "import", "loc": [127, 127], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:Try_L126_C0", "vector": [1, 1, 0.4811, 0.0038, 1, 0.88, 0.0, 884, 0, 1, 0, 0, 884, 0, 0], "semantic": {"name": "locale", "arg_names": [], "import_names": ["locale"], "rhs_call_name": "", "annotation": ""}, "snippet": " import locale"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L128_C4", "label": "setlocale()", "type": "expression", "loc": [128, 128], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:Try_L126_C0", "vector": [8, 1, 0.4848, 0.0038, 1, 0.88, 1.0, 735, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "setlocale", "arg_names": [], "import_names": [], "rhs_call_name": "setlocale", "annotation": ""}, "snippet": " locale.setlocale(locale.LC_ALL, '')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L132_C0", "label": "create_userguide", "type": "function", "loc": [132, 157], "level": 0, "parent": null, "vector": [2, 0, 0.5473, 0.0985, 0, 0.66, 0.8261, 843, 0, 0, 1, 0, 0, 0, 19], "semantic": {"name": "create_userguide", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def create_userguide():\n from docutils.core import publish_cmdline\n\n print('Creating user guide ...')\n ugdir = os.path.dirname(os.path.abspath(__file__))\n sys.path.insert(0, os.path.join(ugdir, '..', '..', 'src', 'robot'))\n from version import get_version\n print('Version:', get_version())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:ImportFrom_L133_C4", "label": "from docutils.core import publish_cmdline", "type": "import", "loc": [133, 133], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L132_C0", "vector": [1, 1, 0.5038, 0.0038, 1, 0.93, 0.0, 219, 0, 1, 0, 0, 219, 0, 0], "semantic": {"name": "docutils.core", "arg_names": [], "import_names": ["publish_cmdline"], "rhs_call_name": "", "annotation": ""}, "snippet": " from docutils.core import publish_cmdline"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L135_C4", "label": "print()", "type": "expression", "loc": [135, 135], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L132_C0", "vector": [8, 1, 0.5114, 0.0038, 1, 0.93, 0.0625, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Creating user guide ...')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L136_C4", "label": "ugdir = dirname()", "type": "assigned_variable", "loc": [136, 136], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L132_C0", "vector": [14, 1, 0.5152, 0.0038, 1, 0.93, 0.125, 82, 3, 1, 0, 0, 959, 10, 2], "semantic": {"name": "ugdir", "arg_names": [], "import_names": [], "rhs_call_name": "dirname", "annotation": ""}, "snippet": " ugdir = os.path.dirname(os.path.abspath(__file__))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L137_C4", "label": "insert()", "type": "expression", "loc": [137, 137], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L132_C0", "vector": [8, 1, 0.5189, 0.0038, 1, 0.93, 0.1875, 368, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "insert", "arg_names": [], "import_names": [], "rhs_call_name": "insert", "annotation": ""}, "snippet": " sys.path.insert(0, os.path.join(ugdir, '..', '..', 'src', 'robot'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:ImportFrom_L138_C4", "label": "from version import get_version", "type": "import", "loc": [138, 138], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L132_C0", "vector": [1, 1, 0.5227, 0.0038, 1, 0.93, 0.25, 623, 0, 1, 0, 0, 623, 0, 0], "semantic": {"name": "version", "arg_names": [], "import_names": ["get_version"], "rhs_call_name": "", "annotation": ""}, "snippet": " from version import get_version"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L139_C4", "label": "print()", "type": "expression", "loc": [139, 139], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L132_C0", "vector": [8, 1, 0.5265, 0.0038, 1, 0.93, 0.3125, 535, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Version:', get_version())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L140_C4", "label": "vfile = open()", "type": "assigned_variable", "loc": [140, 140], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L132_C0", "vector": [14, 1, 0.5303, 0.0038, 1, 0.93, 0.375, 192, 3, 2, 0, 0, 693, 10, 2], "semantic": {"name": "vfile", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": " vfile = open(os.path.join(ugdir, 'src', 'version.txt'), 'w')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L141_C4", "label": "write()", "type": "expression", "loc": [141, 141], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L132_C0", "vector": [8, 1, 0.5341, 0.0038, 1, 0.93, 0.4375, 837, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " vfile.write('.. |version| replace:: %s\\n' % get_version())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L142_C4", "label": "close()", "type": "expression", "loc": [142, 142], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L132_C0", "vector": [8, 1, 0.5379, 0.0038, 1, 0.93, 0.5, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " vfile.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L144_C4", "label": "description =", "type": "assigned_variable", "loc": [144, 144], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L132_C0", "vector": [14, 1, 0.5455, 0.0038, 1, 0.93, 0.5625, 306, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "description", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " description = 'HTML generator for Robot Framework User Guide.'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L145_C4", "label": "arguments =", "type": "assigned_variable", "loc": [145, 150], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L132_C0", "vector": [14, 1, 0.5587, 0.0227, 1, 0.93, 0.625, 426, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "arguments", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " arguments = '''\n--time\n--stylesheet-path=src/userguide.css\nsrc/RobotFrameworkUserGuide.txt\nRobotFrameworkUserGuide.html\n'''.split('\\n')[1:-1] "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L152_C4", "label": "chdir()", "type": "expression", "loc": [152, 152], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L132_C0", "vector": [8, 1, 0.5758, 0.0038, 1, 0.93, 0.6875, 122, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "chdir", "arg_names": [], "import_names": [], "rhs_call_name": "chdir", "annotation": ""}, "snippet": " os.chdir(ugdir)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L153_C4", "label": "publish_cmdline()", "type": "expression", "loc": [153, 153], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L132_C0", "vector": [8, 1, 0.5795, 0.0038, 1, 0.93, 0.75, 679, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "publish_cmdline", "arg_names": [], "import_names": [], "rhs_call_name": "publish_cmdline", "annotation": ""}, "snippet": " publish_cmdline(writer_name='html', description=description, argv=arguments)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L154_C4", "label": "unlink()", "type": "expression", "loc": [154, 154], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L132_C0", "vector": [8, 1, 0.5833, 0.0038, 1, 0.93, 0.8125, 701, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "unlink", "arg_names": [], "import_names": [], "rhs_call_name": "unlink", "annotation": ""}, "snippet": " os.unlink(vfile.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L155_C4", "label": "ugpath = abspath()", "type": "assigned_variable", "loc": [155, 155], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L132_C0", "vector": [14, 1, 0.5871, 0.0038, 1, 0.93, 0.875, 719, 3, 1, 0, 0, 142, 10, 1], "semantic": {"name": "ugpath", "arg_names": [], "import_names": [], "rhs_call_name": "abspath", "annotation": ""}, "snippet": " ugpath = os.path.abspath(arguments[-1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L156_C4", "label": "print()", "type": "expression", "loc": [156, 156], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L132_C0", "vector": [8, 1, 0.5909, 0.0038, 1, 0.93, 0.9375, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(ugpath)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Return_L157_C4", "label": "return", "type": "return", "loc": [157, 157], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L132_C0", "vector": [13, 1, 0.5947, 0.0038, 1, 0.93, 1.0, 0, 0, 0, 0, 0, 0, 8, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return ugpath, get_version(sep='-')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L163_C0", "label": "create_distribution", "type": "function", "loc": [163, 230], "level": 0, "parent": null, "vector": [2, 0, 0.7443, 0.2576, 0, 0.66, 0.8696, 699, 0, 0, 1, 0, 0, 0, 53], "semantic": {"name": "create_distribution", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def create_distribution():\n import re\n from urlparse import urlparse\n\n ugpath, version = create_userguide() # we are in doc/userguide after this\n outdir = 'robotframework-userguide-%s' % version\n tools = os.path.join(outdir, 'tools')\n templates = os.path.join(outdir, 'templates')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Import_L164_C4", "label": "re import re", "type": "import", "loc": [164, 164], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L163_C0", "vector": [1, 1, 0.6212, 0.0038, 1, 0.72, 0.0, 540, 0, 1, 0, 0, 540, 0, 0], "semantic": {"name": "re", "arg_names": [], "import_names": ["re"], "rhs_call_name": "", "annotation": ""}, "snippet": " import re"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:ImportFrom_L165_C4", "label": "from urlparse import urlparse", "type": "import", "loc": [165, 165], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L163_C0", "vector": [1, 1, 0.625, 0.0038, 1, 0.72, 0.0476, 857, 0, 1, 0, 0, 857, 0, 0], "semantic": {"name": "urlparse", "arg_names": [], "import_names": ["urlparse"], "rhs_call_name": "", "annotation": ""}, "snippet": " from urlparse import urlparse"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L167_C4", "label": "ugpath, version = create_userguide()", "type": "assigned_variable", "loc": [167, 167], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L163_C0", "vector": [14, 1, 0.6326, 0.0038, 1, 0.72, 0.0952, 302, 3, 0, 0, 0, 843, 10, 1], "semantic": {"name": "ugpath, version", "arg_names": [], "import_names": [], "rhs_call_name": "create_userguide", "annotation": ""}, "snippet": " ugpath, version = create_userguide() # we are in doc/userguide after this"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L168_C4", "label": "outdir =", "type": "assigned_variable", "loc": [168, 168], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L163_C0", "vector": [14, 1, 0.6364, 0.0038, 1, 0.72, 0.1429, 479, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "outdir", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " outdir = 'robotframework-userguide-%s' % version"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L169_C4", "label": "tools = join()", "type": "assigned_variable", "loc": [169, 169], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L163_C0", "vector": [14, 1, 0.6402, 0.0038, 1, 0.72, 0.1905, 409, 3, 2, 0, 0, 933, 10, 1], "semantic": {"name": "tools", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " tools = os.path.join(outdir, 'tools')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L170_C4", "label": "templates = join()", "type": "assigned_variable", "loc": [170, 170], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L163_C0", "vector": [14, 1, 0.6439, 0.0038, 1, 0.72, 0.2381, 565, 3, 2, 0, 0, 933, 10, 1], "semantic": {"name": "templates", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " templates = os.path.join(outdir, 'templates')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L171_C4", "label": "libraries = join()", "type": "assigned_variable", "loc": [171, 171], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L163_C0", "vector": [14, 1, 0.6477, 0.0038, 1, 0.72, 0.2857, 874, 3, 2, 0, 0, 933, 10, 1], "semantic": {"name": "libraries", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " libraries = os.path.join(outdir, 'libraries')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L172_C4", "label": "images = join()", "type": "assigned_variable", "loc": [172, 172], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L163_C0", "vector": [14, 1, 0.6515, 0.0038, 1, 0.72, 0.3333, 734, 3, 2, 0, 0, 933, 10, 1], "semantic": {"name": "images", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " images = os.path.join(outdir, 'images')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L173_C4", "label": "print()", "type": "expression", "loc": [173, 173], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L163_C0", "vector": [8, 1, 0.6553, 0.0038, 1, 0.72, 0.381, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Creating distribution directory ...')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:If_L175_C4", "label": "if", "type": "if", "loc": [175, 177], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L163_C0", "vector": [4, 1, 0.6667, 0.0114, 1, 0.72, 0.4286, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if os.path.exists(outdir):\n print('Removing previous user guide distribution')\n shutil.rmtree(outdir)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L176_C8", "label": "print()", "type": "expression", "loc": [176, 176], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:If_L175_C4", "vector": [8, 2, 0.6667, 0.0038, 2, 0.85, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Removing previous user guide distribution')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L177_C8", "label": "rmtree()", "type": "expression", "loc": [177, 177], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:If_L175_C4", "vector": [8, 2, 0.6705, 0.0038, 2, 0.85, 1.0, 317, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "rmtree", "arg_names": [], "import_names": [], "rhs_call_name": "rmtree", "annotation": ""}, "snippet": " shutil.rmtree(outdir)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:For_L179_C4", "label": "for dirname", "type": "for", "loc": [179, 181], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L163_C0", "vector": [6, 1, 0.6818, 0.0114, 1, 0.72, 0.4762, 959, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "dirname", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for dirname in [outdir, tools, templates, libraries, images]:\n print(\"Creating output directory '%s'\" % dirname)\n os.mkdir(dirname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L180_C8", "label": "print()", "type": "expression", "loc": [180, 180], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:For_L179_C4", "vector": [8, 2, 0.6818, 0.0038, 2, 0.81, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Creating output directory '%s'\" % dirname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L181_C8", "label": "mkdir()", "type": "expression", "loc": [181, 181], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:For_L179_C4", "vector": [8, 2, 0.6856, 0.0038, 2, 0.81, 1.0, 853, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "mkdir", "arg_names": [], "import_names": [], "rhs_call_name": "mkdir", "annotation": ""}, "snippet": " os.mkdir(dirname)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L183_C4", "label": "replace_links", "type": "function", "loc": [183, 207], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L163_C0", "vector": [2, 1, 0.7386, 0.0947, 1, 0.72, 0.5238, 838, 0, 1, 1, 0, 0, 0, 20], "semantic": {"name": "replace_links", "arg_names": ["res"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def replace_links(res):\n if not res.group(5):\n return res.group(0)\n scheme, _, path, _, _, fragment = urlparse(res.group(5))\n if scheme or (fragment and not path):\n return res.group(0)\n replaced_link = '%s %s=\"%%s/%s\"' % (res.group(1), res.group(4), \n os.path.basename(path)) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:If_L184_C8", "label": "if", "type": "if", "loc": [184, 185], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L183_C4", "vector": [4, 2, 0.6989, 0.0076, 2, 0.68, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not res.group(5):\n return res.group(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Return_L185_C12", "label": "return", "type": "return", "loc": [185, 185], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:If_L184_C8", "vector": [13, 3, 0.7008, 0.0038, 3, 0.56, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return res.group(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L186_C8", "label": "scheme, _, path, _, _, fragment = urlparse()", "type": "assigned_variable", "loc": [186, 186], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L183_C4", "vector": [14, 2, 0.7045, 0.0038, 2, 0.68, 0.1667, 842, 3, 1, 0, 0, 857, 10, 2], "semantic": {"name": "scheme, _, path, _, _, fragment", "arg_names": [], "import_names": [], "rhs_call_name": "urlparse", "annotation": ""}, "snippet": " scheme, _, path, _, _, fragment = urlparse(res.group(5))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:If_L187_C8", "label": "if", "type": "if", "loc": [187, 188], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L183_C4", "vector": [4, 2, 0.7102, 0.0076, 2, 0.68, 0.3333, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if scheme or (fragment and not path):\n return res.group(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Return_L188_C12", "label": "return", "type": "return", "loc": [188, 188], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:If_L187_C8", "vector": [13, 3, 0.7121, 0.0038, 3, 0.7, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return res.group(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L189_C8", "label": "replaced_link =", "type": "assigned_variable", "loc": [189, 190], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L183_C4", "vector": [14, 2, 0.7178, 0.0076, 2, 0.68, 0.5, 150, 4, 0, 0, 0, 0, 0, 3], "semantic": {"name": "replaced_link", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " replaced_link = '%s %s=\"%%s/%s\"' % (res.group(1), res.group(4), \n os.path.basename(path)) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:If_L191_C8", "label": "if", "type": "if", "loc": [191, 205], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L183_C4", "vector": [4, 2, 0.75, 0.0568, 2, 0.68, 0.6667, 0, 3, 0, 0, 0, 0, 0, 10], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if path.startswith('../../tools'):\n copy(path, tools)\n copy_tool_images(path)\n replaced_link = replaced_link % 'tools'\n elif path.startswith('../../templates'):\n copy(path, templates)\n replaced_link = replaced_link % 'templates'\n elif path.startswith('../libraries'):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L192_C12", "label": "copy()", "type": "expression", "loc": [192, 192], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:If_L191_C8", "vector": [8, 3, 0.7273, 0.0038, 3, 0.85, 0.0, 739, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "copy", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " copy(path, tools)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L193_C12", "label": "copy_tool_images()", "type": "expression", "loc": [193, 193], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:If_L191_C8", "vector": [8, 3, 0.7311, 0.0038, 3, 0.85, 0.3333, 519, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "copy_tool_images", "arg_names": [], "import_names": [], "rhs_call_name": "copy_tool_images", "annotation": ""}, "snippet": " copy_tool_images(path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L194_C12", "label": "replaced_link =", "type": "assigned_variable", "loc": [194, 194], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:If_L191_C8", "vector": [14, 3, 0.7348, 0.0038, 3, 0.85, 0.6667, 150, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "replaced_link", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " replaced_link = replaced_link % 'tools'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:If_L195_C8", "label": "if", "type": "if", "loc": [195, 205], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:If_L191_C8", "vector": [4, 3, 0.7576, 0.0417, 3, 0.85, 1.0, 0, 3, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif path.startswith('../../templates'):\n copy(path, templates)\n replaced_link = replaced_link % 'templates'\n elif path.startswith('../libraries'):\n copy(path, libraries)\n replaced_link = replaced_link % 'libraries'\n elif path.startswith('src/'):\n copy(path, images)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L196_C12", "label": "copy()", "type": "expression", "loc": [196, 196], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:If_L195_C8", "vector": [8, 4, 0.7424, 0.0038, 4, 0.38, 0.0, 739, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "copy", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " copy(path, templates)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L197_C12", "label": "replaced_link =", "type": "assigned_variable", "loc": [197, 197], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:If_L195_C8", "vector": [14, 4, 0.7462, 0.0038, 4, 0.38, 0.5, 150, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "replaced_link", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " replaced_link = replaced_link % 'templates'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:If_L198_C8", "label": "if", "type": "if", "loc": [198, 205], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:If_L195_C8", "vector": [4, 4, 0.7633, 0.0303, 4, 0.38, 1.0, 0, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif path.startswith('../libraries'):\n copy(path, libraries)\n replaced_link = replaced_link % 'libraries'\n elif path.startswith('src/'):\n copy(path, images)\n replaced_link = replaced_link % 'images'\n else:\n raise ValueError('Invalid link target: %s' % path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L199_C12", "label": "copy()", "type": "expression", "loc": [199, 199], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:If_L198_C8", "vector": [8, 5, 0.7538, 0.0038, 5, 0.18, 0.0, 739, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "copy", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " copy(path, libraries)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L200_C12", "label": "replaced_link =", "type": "assigned_variable", "loc": [200, 200], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:If_L198_C8", "vector": [14, 5, 0.7576, 0.0038, 5, 0.18, 0.5, 150, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "replaced_link", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " replaced_link = replaced_link % 'libraries'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:If_L201_C8", "label": "if", "type": "if", "loc": [201, 205], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:If_L198_C8", "vector": [4, 5, 0.7689, 0.0189, 5, 0.18, 1.0, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif path.startswith('src/'):\n copy(path, images)\n replaced_link = replaced_link % 'images'\n else:\n raise ValueError('Invalid link target: %s' % path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L202_C12", "label": "copy()", "type": "expression", "loc": [202, 202], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:If_L201_C8", "vector": [8, 6, 0.7652, 0.0038, 6, 0.55, 0.0, 739, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "copy", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " copy(path, images)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L203_C12", "label": "replaced_link =", "type": "assigned_variable", "loc": [203, 203], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:If_L201_C8", "vector": [14, 6, 0.7689, 0.0038, 6, 0.55, 1.0, 150, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "replaced_link", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " replaced_link = replaced_link % 'images'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L206_C8", "label": "print()", "type": "expression", "loc": [206, 206], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L183_C4", "vector": [8, 2, 0.7803, 0.0038, 2, 0.68, 0.8333, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Modified link '%s' -> '%s'\" % (res.group(0), replaced_link))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Return_L207_C8", "label": "return", "type": "return", "loc": [207, 207], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L183_C4", "vector": [13, 2, 0.7841, 0.0038, 2, 0.68, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return replaced_link"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L209_C4", "label": "copy", "type": "function", "loc": [209, 211], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L163_C0", "vector": [2, 1, 0.7955, 0.0114, 1, 0.72, 0.5714, 739, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "copy", "arg_names": ["source", "dest"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def copy(source, dest):\n print(\"Copying '%s' -> '%s'\" % (source, dest))\n shutil.copy(source, dest)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L210_C8", "label": "print()", "type": "expression", "loc": [210, 210], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L209_C4", "vector": [8, 2, 0.7955, 0.0038, 2, 0.77, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Copying '%s' -> '%s'\" % (source, dest))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L211_C8", "label": "copy()", "type": "expression", "loc": [211, 211], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L209_C4", "vector": [8, 2, 0.7992, 0.0038, 2, 0.77, 1.0, 739, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "copy", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " shutil.copy(source, dest)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L213_C4", "label": "copy_tool_images", "type": "function", "loc": [213, 217], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L163_C0", "vector": [2, 1, 0.8144, 0.0189, 1, 0.72, 0.619, 519, 0, 1, 0, 0, 0, 0, 9], "semantic": {"name": "copy_tool_images", "arg_names": ["path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def copy_tool_images(path):\n indir = os.path.dirname(path)\n for line in open(os.path.splitext(path)[0]+'.txt').readlines():\n if line.startswith('.. figure::'):\n copy(os.path.join(indir, line.strip().split()[-1]), tools)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L214_C8", "label": "indir = dirname()", "type": "assigned_variable", "loc": [214, 214], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L213_C4", "vector": [14, 2, 0.8106, 0.0038, 2, 0.96, 0.0, 702, 3, 1, 0, 0, 959, 10, 1], "semantic": {"name": "indir", "arg_names": [], "import_names": [], "rhs_call_name": "dirname", "annotation": ""}, "snippet": " indir = os.path.dirname(path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:For_L215_C8", "label": "for line", "type": "for", "loc": [215, 217], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L213_C4", "vector": [6, 2, 0.8182, 0.0114, 2, 0.96, 1.0, 373, 3, 0, 0, 0, 0, 0, 8], "semantic": {"name": "line", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for line in open(os.path.splitext(path)[0]+'.txt').readlines():\n if line.startswith('.. figure::'):\n copy(os.path.join(indir, line.strip().split()[-1]), tools)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:If_L216_C12", "label": "if", "type": "if", "loc": [216, 217], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:For_L215_C8", "vector": [4, 3, 0.8201, 0.0076, 3, 0.06, 0.0, 0, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if line.startswith('.. figure::'):\n copy(os.path.join(indir, line.strip().split()[-1]), tools)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L217_C16", "label": "copy()", "type": "expression", "loc": [217, 217], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:If_L216_C12", "vector": [8, 4, 0.822, 0.0038, 4, 0.11, 0.0, 739, 3, 2, 0, 0, 0, 0, 4], "semantic": {"name": "copy", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " copy(os.path.join(indir, line.strip().split()[-1]), tools)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L219_C4", "label": "link_regexp = compile()", "type": "assigned_variable", "loc": [219, 222], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L163_C0", "vector": [14, 1, 0.8352, 0.0152, 1, 0.72, 0.6667, 933, 3, 2, 0, 0, 821, 10, 1], "semantic": {"name": "link_regexp", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": " link_regexp = re.compile('''\n(<(a|img)\\s+.*?)\n(\\s+(href|src)=\"(.*?)\"|>)\n''', re.VERBOSE | re.DOTALL | re.IGNORECASE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L224_C4", "label": "content = read()", "type": "assigned_variable", "loc": [224, 224], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L163_C0", "vector": [14, 1, 0.8485, 0.0038, 1, 0.72, 0.7143, 273, 3, 0, 0, 0, 453, 10, 2], "semantic": {"name": "content", "arg_names": [], "import_names": [], "rhs_call_name": "read", "annotation": ""}, "snippet": " content = open(ugpath).read()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L225_C4", "label": "content = sub()", "type": "assigned_variable", "loc": [225, 225], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L163_C0", "vector": [14, 1, 0.8523, 0.0038, 1, 0.72, 0.7619, 273, 3, 2, 0, 0, 819, 10, 1], "semantic": {"name": "content", "arg_names": [], "import_names": [], "rhs_call_name": "sub", "annotation": ""}, "snippet": " content = link_regexp.sub(replace_links, content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L226_C4", "label": "outfile = open()", "type": "assigned_variable", "loc": [226, 226], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L163_C0", "vector": [14, 1, 0.8561, 0.0038, 1, 0.72, 0.8095, 206, 3, 2, 0, 0, 693, 10, 3], "semantic": {"name": "outfile", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": " outfile = open(os.path.join(outdir, os.path.basename(ugpath)), 'wb')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L227_C4", "label": "write()", "type": "expression", "loc": [227, 227], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L163_C0", "vector": [8, 1, 0.8598, 0.0038, 1, 0.72, 0.8571, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " outfile.write(content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L228_C4", "label": "close()", "type": "expression", "loc": [228, 228], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L163_C0", "vector": [8, 1, 0.8636, 0.0038, 1, 0.72, 0.9048, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " outfile.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L229_C4", "label": "print()", "type": "expression", "loc": [229, 229], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L163_C0", "vector": [8, 1, 0.8674, 0.0038, 1, 0.72, 0.9524, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(os.path.abspath(outfile.name))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Return_L230_C4", "label": "return", "type": "return", "loc": [230, 230], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L163_C0", "vector": [13, 1, 0.8712, 0.0038, 1, 0.72, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return outdir"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L235_C0", "label": "create_zip", "type": "function", "loc": [235, 237], "level": 0, "parent": null, "vector": [2, 0, 0.8939, 0.0114, 0, 0.66, 0.913, 276, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "create_zip", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def create_zip():\n ugdir = create_distribution()\n zip_distribution(ugdir)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L236_C4", "label": "ugdir = create_distribution()", "type": "assigned_variable", "loc": [236, 236], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L235_C0", "vector": [14, 1, 0.8939, 0.0038, 1, 0.6, 0.0, 82, 3, 0, 0, 0, 699, 10, 1], "semantic": {"name": "ugdir", "arg_names": [], "import_names": [], "rhs_call_name": "create_distribution", "annotation": ""}, "snippet": " ugdir = create_distribution()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L237_C4", "label": "zip_distribution()", "type": "expression", "loc": [237, 237], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L235_C0", "vector": [8, 1, 0.8977, 0.0038, 1, 0.6, 1.0, 339, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "zip_distribution", "arg_names": [], "import_names": [], "rhs_call_name": "zip_distribution", "annotation": ""}, "snippet": " zip_distribution(ugdir)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L240_C0", "label": "zip_distribution", "type": "function", "loc": [240, 255], "level": 0, "parent": null, "vector": [2, 0, 0.9375, 0.0606, 0, 0.66, 0.9565, 339, 0, 1, 0, 0, 0, 0, 12], "semantic": {"name": "zip_distribution", "arg_names": ["dirpath"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def zip_distribution(dirpath):\n \"\"\"Generic zipper. Used also by qs2html.py \"\"\"\n from zipfile import ZipFile, ZIP_DEFLATED\n\n print('Creating zip package ...')\n zippath = os.path.normpath(dirpath) + '.zip'\n zipfile = ZipFile(zippath, 'w', compression=ZIP_DEFLATED)\n for root, _, files in os.walk(dirpath):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L241_C4", "label": "expression", "type": "expression", "loc": [241, 241], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L240_C0", "vector": [8, 1, 0.9129, 0.0038, 1, 0.81, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Generic zipper. Used also by qs2html.py \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:ImportFrom_L242_C4", "label": "from zipfile import ZipFile, ZIP_DEFLATED", "type": "import", "loc": [242, 242], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L240_C0", "vector": [1, 1, 0.9167, 0.0038, 1, 0.81, 0.1111, 93, 0, 2, 0, 0, 93, 0, 0], "semantic": {"name": "zipfile", "arg_names": [], "import_names": ["ZipFile", "ZIP_DEFLATED"], "rhs_call_name": "", "annotation": ""}, "snippet": " from zipfile import ZipFile, ZIP_DEFLATED"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L244_C4", "label": "print()", "type": "expression", "loc": [244, 244], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L240_C0", "vector": [8, 1, 0.9242, 0.0038, 1, 0.81, 0.2222, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Creating zip package ...')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L245_C4", "label": "zippath =", "type": "assigned_variable", "loc": [245, 245], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L240_C0", "vector": [14, 1, 0.928, 0.0038, 1, 0.81, 0.3333, 868, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "zippath", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " zippath = os.path.normpath(dirpath) + '.zip'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L246_C4", "label": "zipfile = ZipFile()", "type": "assigned_variable", "loc": [246, 246], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L240_C0", "vector": [14, 1, 0.9318, 0.0038, 1, 0.81, 0.4444, 93, 3, 3, 0, 0, 299, 10, 1], "semantic": {"name": "zipfile", "arg_names": [], "import_names": [], "rhs_call_name": "ZipFile", "annotation": ""}, "snippet": " zipfile = ZipFile(zippath, 'w', compression=ZIP_DEFLATED)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:For_L247_C4", "label": "for root, _, files", "type": "for", "loc": [247, 251], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L240_C0", "vector": [6, 1, 0.9432, 0.0189, 1, 0.81, 0.5556, 653, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "root, _, files", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for root, _, files in os.walk(dirpath):\n for name in files:\n path = os.path.join(root, name)\n print(\"Adding '%s'\" % path)\n zipfile.write(path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:For_L248_C8", "label": "for name", "type": "for", "loc": [248, 251], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:For_L247_C4", "vector": [6, 2, 0.9451, 0.0152, 2, 0.18, 0.0, 57, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for name in files:\n path = os.path.join(root, name)\n print(\"Adding '%s'\" % path)\n zipfile.write(path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L249_C12", "label": "path = join()", "type": "assigned_variable", "loc": [249, 249], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:For_L248_C8", "vector": [14, 3, 0.9432, 0.0038, 3, 0.45, 0.0, 358, 3, 2, 0, 0, 933, 10, 1], "semantic": {"name": "path", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " path = os.path.join(root, name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L250_C12", "label": "print()", "type": "expression", "loc": [250, 250], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:For_L248_C8", "vector": [8, 3, 0.947, 0.0038, 3, 0.45, 0.5, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Adding '%s'\" % path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L251_C12", "label": "write()", "type": "expression", "loc": [251, 251], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:For_L248_C8", "vector": [8, 3, 0.9508, 0.0038, 3, 0.45, 1.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " zipfile.write(path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L252_C4", "label": "close()", "type": "expression", "loc": [252, 252], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L240_C0", "vector": [8, 1, 0.9545, 0.0038, 1, 0.81, 0.6667, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " zipfile.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L253_C4", "label": "print()", "type": "expression", "loc": [253, 253], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L240_C0", "vector": [8, 1, 0.9583, 0.0038, 1, 0.81, 0.7778, 535, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Removing distribution directory', dirpath)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L254_C4", "label": "rmtree()", "type": "expression", "loc": [254, 254], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L240_C0", "vector": [8, 1, 0.9621, 0.0038, 1, 0.81, 0.8889, 317, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "rmtree", "arg_names": [], "import_names": [], "rhs_call_name": "rmtree", "annotation": ""}, "snippet": " shutil.rmtree(dirpath)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L255_C4", "label": "print()", "type": "expression", "loc": [255, 255], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L240_C0", "vector": [8, 1, 0.9659, 0.0038, 1, 0.81, 1.0, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(os.path.abspath(zippath))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:If_L258_C0", "label": "if", "type": "if", "loc": [258, 264], "level": 0, "parent": null, "vector": [4, 0, 0.9886, 0.0265, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n actions = { 'create': create_userguide, 'cr': create_userguide,\n 'dist': create_distribution, 'zip': create_zip }\n try:\n actions[sys.argv[1]](*sys.argv[2:])\n except (KeyError, IndexError, TypeError):\n print(__doc__)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L259_C4", "label": "actions =", "type": "assigned_variable", "loc": [259, 260], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:If_L258_C0", "vector": [14, 1, 0.983, 0.0076, 1, 0.2, 0.0, 317, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "actions", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " actions = { 'create': create_userguide, 'cr': create_userguide,\n 'dist': create_distribution, 'zip': create_zip }"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Try_L261_C4", "label": "try", "type": "try", "loc": [261, 264], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:If_L258_C0", "vector": [7, 1, 0.9943, 0.0152, 1, 0.2, 1.0, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n actions[sys.argv[1]](*sys.argv[2:])\n except (KeyError, IndexError, TypeError):\n print(__doc__)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L262_C8", "label": "expression", "type": "expression", "loc": [262, 262], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:Try_L261_C4", "vector": [8, 2, 0.9924, 0.0038, 2, 0.41, 0.0, 0, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " actions[sys.argv[1]](*sys.argv[2:])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L264_C8", "label": "print()", "type": "expression", "loc": [264, 264], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99946:Try_L261_C4", "vector": [8, 2, 1.0, 0.0038, 2, 0.41, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(__doc__)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Try_L98_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:Try_L98_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L99_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:Try_L98_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L102_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L104_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L106_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:If_L107_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:If_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L108_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:If_L107_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:If_L109_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:If_L109_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L110_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L111_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Return_L112_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:Try_L126_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Import_L127_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:Try_L126_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L128_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L132_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:ImportFrom_L133_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L132_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L135_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L132_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L136_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L132_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L137_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L132_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:ImportFrom_L138_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L132_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L139_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L132_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L140_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L132_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L141_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L132_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L142_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L132_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L144_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L132_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L145_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L132_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L152_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L132_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L153_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L132_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L154_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L132_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L155_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L132_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L156_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L132_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Return_L157_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L163_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Import_L164_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L163_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:ImportFrom_L165_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L163_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L167_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L163_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L168_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L163_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L169_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L163_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L170_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L163_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L171_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L163_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L172_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L163_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L173_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L163_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:If_L175_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:If_L175_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L176_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:If_L175_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L177_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L163_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:For_L179_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:For_L179_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L180_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:For_L179_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L181_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L163_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L183_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L183_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:If_L184_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:If_L184_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Return_L185_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L183_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L186_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L183_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:If_L187_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:If_L187_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Return_L188_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L183_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L189_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L183_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:If_L191_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:If_L191_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L192_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:If_L191_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L193_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:If_L191_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L194_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:If_L191_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:If_L195_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:If_L195_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L196_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:If_L195_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L197_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:If_L195_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:If_L198_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:If_L198_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L199_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:If_L198_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L200_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:If_L198_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:If_L201_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:If_L201_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L202_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:If_L201_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L203_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L183_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L206_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L183_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Return_L207_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L163_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L209_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L209_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L210_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L209_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L211_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L163_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L213_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L213_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L214_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L213_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:For_L215_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:For_L215_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:If_L216_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:If_L216_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L217_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L163_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L219_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L163_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L224_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L163_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L225_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L163_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L226_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L163_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L227_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L163_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L228_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L163_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L229_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L163_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Return_L230_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L235_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L236_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L235_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L237_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L240_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L241_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L240_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:ImportFrom_L242_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L240_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L244_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L240_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L245_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L240_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L246_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L240_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:For_L247_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:For_L247_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:For_L248_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:For_L248_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L249_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:For_L248_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L250_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:For_L248_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L251_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L240_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L252_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L240_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L253_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L240_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L254_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:FunctionDef_L240_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L255_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:If_L258_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Assign_L259_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:If_L258_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Try_L261_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:Try_L261_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L262_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99946:Try_L261_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99946:Expr_L264_C8"}] |
#!/usr/bin/env python
"""Usage: check_test_times.py inpath [outpath]
Reads result of a test run from Robot output file and checks that no test
took longer than 3 minutest to execute. If outpath is not given, the
result is written over the original file.
"""
import sys
from robot.output import TestSuite
def check_tests(inpath, outpath=None):
if not outpath:
outpath = inpath
suite = TestSuite(inpath)
_check_execution_times(suite)
suite.write_to_file(outpath)
def _check_execution_times(suite):
for test in suite.tests:
if test.status == 'PASS' and test.elapsedtime > 1000 * 60 * 3:
test.status = 'FAIL'
test.message = 'Test execution time was too long: %s' % test.elapsedtime
for suite in suite.suites:
_check_execution_times(suite)
if __name__ == '__main__':
try:
check_tests(*sys.argv[1:])
except TypeError:
print __doc__
| ajibawa-2023/Python-Code-Large/train/row_99947 | 20 | 34 | 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_99947:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 8], "level": 0, "parent": null, "vector": [8, 0, 0.1618, 0.1765, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"Usage: check_test_times.py inpath [outpath]\n\nReads result of a test run from Robot output file and checks that no test \ntook longer than 3 minutest to execute. If outpath is not given, the\nresult is written over the original file.\n\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99947:Import_L10_C0", "label": "sys import sys", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.2941, 0.0294, 0, 0.66, 0.2, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99947:ImportFrom_L11_C0", "label": "from robot.output import TestSuite", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.3235, 0.0294, 0, 0.66, 0.4, 596, 0, 1, 0, 0, 596, 0, 0], "semantic": {"name": "robot.output", "arg_names": [], "import_names": ["TestSuite"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot.output import TestSuite"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99947:FunctionDef_L14_C0", "label": "check_tests", "type": "function", "loc": [14, 19], "level": 0, "parent": null, "vector": [2, 0, 0.4853, 0.1765, 0, 0.66, 0.6, 978, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "check_tests", "arg_names": ["inpath", "outpath"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def check_tests(inpath, outpath=None):\n if not outpath:\n outpath = inpath\n suite = TestSuite(inpath)\n _check_execution_times(suite)\n suite.write_to_file(outpath)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99947:If_L15_C4", "label": "if", "type": "if", "loc": [15, 16], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99947:FunctionDef_L14_C0", "vector": [4, 1, 0.4559, 0.0588, 1, 0.29, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not outpath:\n outpath = inpath"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99947:Assign_L16_C8", "label": "outpath =", "type": "assigned_variable", "loc": [16, 16], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99947:If_L15_C4", "vector": [14, 2, 0.4706, 0.0294, 2, 0.39, 0.0, 74, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "outpath", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " outpath = inpath"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99947:Assign_L17_C4", "label": "suite = TestSuite()", "type": "assigned_variable", "loc": [17, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99947:FunctionDef_L14_C0", "vector": [14, 1, 0.5, 0.0294, 1, 0.29, 0.3333, 425, 3, 1, 0, 0, 75, 10, 1], "semantic": {"name": "suite", "arg_names": [], "import_names": [], "rhs_call_name": "TestSuite", "annotation": ""}, "snippet": " suite = TestSuite(inpath)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99947:Expr_L18_C4", "label": "_check_execution_times()", "type": "expression", "loc": [18, 18], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99947:FunctionDef_L14_C0", "vector": [8, 1, 0.5294, 0.0294, 1, 0.29, 0.6667, 152, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_check_execution_times", "arg_names": [], "import_names": [], "rhs_call_name": "_check_execution_times", "annotation": ""}, "snippet": " _check_execution_times(suite)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99947:Expr_L19_C4", "label": "write_to_file()", "type": "expression", "loc": [19, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99947:FunctionDef_L14_C0", "vector": [8, 1, 0.5588, 0.0294, 1, 0.29, 1.0, 283, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write_to_file", "arg_names": [], "import_names": [], "rhs_call_name": "write_to_file", "annotation": ""}, "snippet": " suite.write_to_file(outpath)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99947:FunctionDef_L21_C0", "label": "_check_execution_times", "type": "function", "loc": [21, 27], "level": 0, "parent": null, "vector": [2, 0, 0.7059, 0.2059, 0, 0.66, 0.8, 152, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_check_execution_times", "arg_names": ["suite"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _check_execution_times(suite):\n for test in suite.tests:\n if test.status == 'PASS' and test.elapsedtime > 1000 * 60 * 3:\n test.status = 'FAIL'\n test.message = 'Test execution time was too long: %s' % test.elapsedtime\n for suite in suite.suites:\n _check_execution_times(suite)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99947:For_L22_C4", "label": "for test", "type": "for", "loc": [22, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99947:FunctionDef_L21_C0", "vector": [6, 1, 0.6912, 0.1176, 1, 0.76, 0.0, 224, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "test", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for test in suite.tests:\n if test.status == 'PASS' and test.elapsedtime > 1000 * 60 * 3:\n test.status = 'FAIL'\n test.message = 'Test execution time was too long: %s' % test.elapsedtime"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99947:If_L23_C8", "label": "if", "type": "if", "loc": [23, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99947:For_L22_C4", "vector": [4, 2, 0.7059, 0.0882, 2, 0.76, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if test.status == 'PASS' and test.elapsedtime > 1000 * 60 * 3:\n test.status = 'FAIL'\n test.message = 'Test execution time was too long: %s' % test.elapsedtime"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99947:Assign_L24_C12", "label": "test.status =", "type": "assigned_variable", "loc": [24, 24], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99947:If_L23_C8", "vector": [14, 3, 0.7059, 0.0294, 3, 0.85, 0.0, 9, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "test.status", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " test.status = 'FAIL'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99947:Assign_L25_C12", "label": "test.message =", "type": "assigned_variable", "loc": [25, 25], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99947:If_L23_C8", "vector": [14, 3, 0.7353, 0.0294, 3, 0.85, 1.0, 792, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "test.message", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " test.message = 'Test execution time was too long: %s' % test.elapsedtime"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99947:For_L26_C4", "label": "for suite", "type": "for", "loc": [26, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99947:FunctionDef_L21_C0", "vector": [6, 1, 0.7794, 0.0588, 1, 0.76, 1.0, 425, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "suite", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for suite in suite.suites:\n _check_execution_times(suite)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99947:Expr_L27_C8", "label": "_check_execution_times()", "type": "expression", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99947:For_L26_C4", "vector": [8, 2, 0.7941, 0.0294, 2, 0.8, 0.0, 152, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_check_execution_times", "arg_names": [], "import_names": [], "rhs_call_name": "_check_execution_times", "annotation": ""}, "snippet": " _check_execution_times(suite)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99947:If_L30_C0", "label": "if", "type": "if", "loc": [30, 34], "level": 0, "parent": null, "vector": [4, 0, 0.9412, 0.1471, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n try:\n check_tests(*sys.argv[1:])\n except TypeError:\n print(__doc__)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99947:Try_L31_C4", "label": "try", "type": "try", "loc": [31, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99947:If_L30_C0", "vector": [7, 1, 0.9559, 0.1176, 1, 0.17, 0.0, 0, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n check_tests(*sys.argv[1:])\n except TypeError:\n print(__doc__)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99947:Expr_L32_C8", "label": "check_tests()", "type": "expression", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99947:Try_L31_C4", "vector": [8, 2, 0.9412, 0.0294, 2, 0.2, 0.0, 978, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "check_tests", "arg_names": [], "import_names": [], "rhs_call_name": "check_tests", "annotation": ""}, "snippet": " check_tests(*sys.argv[1:])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99947:Expr_L34_C8", "label": "print()", "type": "expression", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99947:Try_L31_C4", "vector": [8, 2, 1.0, 0.0294, 2, 0.2, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(__doc__)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99947:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99947:If_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99947:If_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99947:Assign_L16_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99947:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99947:Assign_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99947:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99947:Expr_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99947:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99947:Expr_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99947:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99947:For_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99947:For_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99947:If_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99947:If_L23_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99947:Assign_L24_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99947:If_L23_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99947:Assign_L25_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99947:FunctionDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99947:For_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99947:For_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99947:Expr_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99947:If_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99947:Try_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99947:Try_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99947:Expr_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99947:Try_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99947:Expr_L34_C8"}] |
class CheckMultipleItemsLibrary:
def items_should_not_contain(self, value, *items):
"""Checks that none of the given 'items' contains the given 'value'."""
items_containing_value = [ item for item in items if value in item ]
if items_containing_value:
message = "Items '%s' contains '%s'"
message = message % (', '.join(items_containing_value), value)
raise AssertionError(message)
| ajibawa-2023/Python-Code-Large/train/row_99948 | 7 | 10 | 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_99948:ClassDef_L1_C0", "label": "CheckMultipleItemsLibrary", "type": "class", "loc": [1, 10], "level": 0, "parent": null, "vector": [3, 0, 0.55, 1.0, 0, 0.66, 0.0, 960, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "CheckMultipleItemsLibrary", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class CheckMultipleItemsLibrary:\n\n def items_should_not_contain(self, value, *items):\n \"\"\"Checks that none of the given 'items' contains the given 'value'.\"\"\"\n\n items_containing_value = [ item for item in items if value in item ]\n if items_containing_value:\n message = \"Items '%s' contains '%s'\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99948:FunctionDef_L3_C4", "label": "items_should_not_contain", "type": "function", "loc": [3, 10], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99948:ClassDef_L1_C0", "vector": [2, 1, 0.65, 0.8, 1, 0.76, 0.0, 121, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "items_should_not_contain", "arg_names": ["self", "value", "items"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def items_should_not_contain(self, value, *items):\n \"\"\"Checks that none of the given 'items' contains the given 'value'.\"\"\"\n\n items_containing_value = [ item for item in items if value in item ]\n if items_containing_value:\n message = \"Items '%s' contains '%s'\"\n message = message % (', '.join(items_containing_value), value)\n raise AssertionError(message)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99948:Expr_L4_C8", "label": "expression", "type": "expression", "loc": [4, 4], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99948:FunctionDef_L3_C4", "vector": [8, 2, 0.4, 0.1, 2, 0.06, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Checks that none of the given 'items' contains the given 'value'.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99948:Assign_L6_C8", "label": "items_containing_value =", "type": "assigned_variable", "loc": [6, 6], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99948:FunctionDef_L3_C4", "vector": [14, 2, 0.6, 0.1, 2, 0.06, 0.5, 771, 5, 0, 0, 0, 0, 0, 0], "semantic": {"name": "items_containing_value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " items_containing_value = [ item for item in items if value in item ]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99948:If_L7_C8", "label": "if", "type": "if", "loc": [7, 10], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99948:FunctionDef_L3_C4", "vector": [4, 2, 0.85, 0.4, 2, 0.06, 1.0, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if items_containing_value:\n message = \"Items '%s' contains '%s'\"\n message = message % (', '.join(items_containing_value), value)\n raise AssertionError(message)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99948:Assign_L8_C12", "label": "message =", "type": "assigned_variable", "loc": [8, 8], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99948:If_L7_C8", "vector": [14, 3, 0.8, 0.1, 3, 0.1, 0.0, 635, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "message", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " message = \"Items '%s' contains '%s'\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99948:Assign_L9_C12", "label": "message =", "type": "assigned_variable", "loc": [9, 9], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99948:If_L7_C8", "vector": [14, 3, 0.9, 0.1, 3, 0.1, 1.0, 635, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "message", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " message = message % (', '.join(items_containing_value), value)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99948:ClassDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99948:FunctionDef_L3_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99948:FunctionDef_L3_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99948:Expr_L4_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99948:FunctionDef_L3_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99948:Assign_L6_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99948:FunctionDef_L3_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99948:If_L7_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99948:If_L7_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99948:Assign_L8_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99948:If_L7_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99948:Assign_L9_C12"}] |
"""Robot Framework test library example that calls C code.
This example uses Python's standard `ctypes` module, which requires
that the C code is compiled into a shared library.
It is also possible to execute this file from the command line
to test the C code manually.
"""
from ctypes import CDLL, c_char_p
LIBRARY = CDLL('./liblogin.so') # On Windows we'd use '.dll'
def check_user(username, password):
"""Validates user name and password using imported shared C library."""
if not LIBRARY.validate_user(c_char_p(username), c_char_p(password)):
raise AssertionError('Wrong username/password combination')
if __name__ == '__main__':
import sys
try:
check_user(*sys.argv[1:])
except TypeError:
print 'Usage: %s username password' % sys.argv[0]
except AssertionError, err:
print err
else:
print 'Valid password'
| ajibawa-2023/Python-Code-Large/train/row_99949 | 13 | 29 | 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_99949:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 8], "level": 0, "parent": null, "vector": [8, 0, 0.1552, 0.2759, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"Robot Framework test library example that calls C code.\n\nThis example uses Python's standard `ctypes` module, which requires\nthat the C code is compiled into a shared library.\n\nIt is also possible to execute this file from the command line \nto test the C code manually.\n\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99949:ImportFrom_L10_C0", "label": "from ctypes import CDLL, c_char_p", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.3448, 0.0345, 0, 0.66, 0.25, 182, 0, 2, 0, 0, 182, 0, 0], "semantic": {"name": "ctypes", "arg_names": [], "import_names": ["CDLL", "c_char_p"], "rhs_call_name": "", "annotation": ""}, "snippet": "from ctypes import CDLL, c_char_p"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99949:Assign_L12_C0", "label": "LIBRARY = CDLL()", "type": "assigned_variable", "loc": [12, 12], "level": 0, "parent": null, "vector": [14, 0, 0.4138, 0.0345, 0, 0.66, 0.5, 222, 3, 1, 0, 0, 453, 10, 1], "semantic": {"name": "LIBRARY", "arg_names": [], "import_names": [], "rhs_call_name": "CDLL", "annotation": ""}, "snippet": "LIBRARY = CDLL('./liblogin.so') # On Windows we'd use '.dll'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99949:FunctionDef_L15_C0", "label": "check_user", "type": "function", "loc": [15, 18], "level": 0, "parent": null, "vector": [2, 0, 0.569, 0.1379, 0, 0.66, 0.75, 253, 0, 2, 0, 0, 0, 0, 4], "semantic": {"name": "check_user", "arg_names": ["username", "password"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def check_user(username, password):\n \"\"\"Validates user name and password using imported shared C library.\"\"\"\n if not LIBRARY.validate_user(c_char_p(username), c_char_p(password)):\n raise AssertionError('Wrong username/password combination')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99949:Expr_L16_C4", "label": "expression", "type": "expression", "loc": [16, 16], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99949:FunctionDef_L15_C0", "vector": [8, 1, 0.5517, 0.0345, 1, 0.25, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Validates user name and password using imported shared C library.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99949:If_L17_C4", "label": "if", "type": "if", "loc": [17, 18], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99949:FunctionDef_L15_C0", "vector": [4, 1, 0.6034, 0.069, 1, 0.25, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not LIBRARY.validate_user(c_char_p(username), c_char_p(password)):\n raise AssertionError('Wrong username/password combination')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99949:If_L21_C0", "label": "if", "type": "if", "loc": [21, 29], "level": 0, "parent": null, "vector": [4, 0, 0.8621, 0.3103, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n import sys\n try:\n check_user(*sys.argv[1:])\n except TypeError:\n print('Usage: %s username password' % sys.argv[0])\n print(err)\n else:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99949:Import_L22_C4", "label": "sys import sys", "type": "import", "loc": [22, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99949:If_L21_C0", "vector": [1, 1, 0.7586, 0.0345, 1, 0.47, 0.0, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": " import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99949:Try_L23_C4", "label": "try", "type": "try", "loc": [23, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99949:If_L21_C0", "vector": [7, 1, 0.8966, 0.2414, 1, 0.47, 1.0, 0, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n check_user(*sys.argv[1:])\n except TypeError:\n print('Usage: %s username password' % sys.argv[0])\n print(err)\n else:\n print('Valid password')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99949:Expr_L24_C8", "label": "check_user()", "type": "expression", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99949:Try_L23_C4", "vector": [8, 2, 0.8276, 0.0345, 2, 0.48, 0.0, 253, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "check_user", "arg_names": [], "import_names": [], "rhs_call_name": "check_user", "annotation": ""}, "snippet": " check_user(*sys.argv[1:])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99949:Expr_L26_C8", "label": "print()", "type": "expression", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99949:Try_L23_C4", "vector": [8, 2, 0.8966, 0.0345, 2, 0.48, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Usage: %s username password' % sys.argv[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99949:Expr_L27_C8", "label": "print()", "type": "expression", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99949:Try_L23_C4", "vector": [8, 2, 0.931, 0.0345, 2, 0.48, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(err)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99949:Expr_L29_C8", "label": "print()", "type": "expression", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99949:Try_L23_C4", "vector": [8, 2, 1.0, 0.0345, 2, 0.48, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Valid password')"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99949:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99949:Expr_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99949:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99949:If_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99949:If_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99949:Import_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99949:If_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99949:Try_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99949:Try_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99949:Expr_L24_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99949:Try_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99949:Expr_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99949:Try_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99949:Expr_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99949:Try_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99949:Expr_L29_C8"}] |
from robot import run as run_robot
import cProfile
import pstats
filename = 'robot.profile'
cProfile.run('run_robot("/home/husa/workspace/robotframework/atest/testdata/misc/")', filename)
p = pstats.Stats(filename)
p.strip_dirs().sort_stats(-1).print_stats()
| ajibawa-2023/Python-Code-Large/train/row_99951 | 7 | 10 | 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_99951:ImportFrom_L1_C0", "label": "from robot import run_robot", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.1, 0.1, 0, 0.66, 0.0, 735, 0, 1, 0, 0, 735, 0, 0], "semantic": {"name": "robot", "arg_names": [], "import_names": ["run_robot"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot import run as run_robot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99951:Import_L2_C0", "label": "cProfile import cProfile", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.2, 0.1, 0, 0.66, 0.1667, 686, 0, 1, 0, 0, 686, 0, 0], "semantic": {"name": "cProfile", "arg_names": [], "import_names": ["cProfile"], "rhs_call_name": "", "annotation": ""}, "snippet": "import cProfile"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99951:Import_L3_C0", "label": "pstats import pstats", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.3, 0.1, 0, 0.66, 0.3333, 936, 0, 1, 0, 0, 936, 0, 0], "semantic": {"name": "pstats", "arg_names": [], "import_names": ["pstats"], "rhs_call_name": "", "annotation": ""}, "snippet": "import pstats"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99951:Assign_L6_C0", "label": "filename =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.6, 0.1, 0, 0.66, 0.5, 275, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "filename", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "filename = 'robot.profile'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99951:Expr_L7_C0", "label": "run()", "type": "expression", "loc": [7, 7], "level": 0, "parent": null, "vector": [8, 0, 0.7, 0.1, 0, 0.66, 0.6667, 679, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "run", "arg_names": [], "import_names": [], "rhs_call_name": "run", "annotation": ""}, "snippet": "cProfile.run('run_robot(\"/home/husa/workspace/robotframework/atest/testdata/misc/\")', filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99951:Assign_L8_C0", "label": "p = Stats()", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.8, 0.1, 0, 0.66, 0.8333, 491, 3, 1, 0, 0, 458, 10, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "Stats", "annotation": ""}, "snippet": "p = pstats.Stats(filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99951:Expr_L9_C0", "label": "print_stats()", "type": "expression", "loc": [9, 9], "level": 0, "parent": null, "vector": [8, 0, 0.9, 0.1, 0, 0.66, 1.0, 764, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "print_stats", "arg_names": [], "import_names": [], "rhs_call_name": "print_stats", "annotation": ""}, "snippet": "p.strip_dirs().sort_stats(-1).print_stats()"}] | [] |
from os.path import dirname, join
import subprocess
basedir = dirname(__file__)
cmd = ['pybot', '--outputdir', join(basedir, 'results'), join(basedir, 'vacalc')]
pythonpath = '%s:%s' % (join(basedir, 'lib'), join(basedir, '..', 'src'))
subprocess.call(' '.join(cmd), shell=True, env={'PYTHONPATH': pythonpath})
| ajibawa-2023/Python-Code-Large/train/row_99952 | 6 | 8 | 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_99952:ImportFrom_L1_C0", "label": "from os.path import dirname, join", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.125, 0.125, 0, 0.66, 0.0, 79, 0, 2, 0, 0, 79, 0, 0], "semantic": {"name": "os.path", "arg_names": [], "import_names": ["dirname", "join"], "rhs_call_name": "", "annotation": ""}, "snippet": "from os.path import dirname, join"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99952:Import_L2_C0", "label": "subprocess import subprocess", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.25, 0.125, 0, 0.66, 0.2, 394, 0, 1, 0, 0, 394, 0, 0], "semantic": {"name": "subprocess", "arg_names": [], "import_names": ["subprocess"], "rhs_call_name": "", "annotation": ""}, "snippet": "import subprocess"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99952:Assign_L4_C0", "label": "basedir = dirname()", "type": "assigned_variable", "loc": [4, 4], "level": 0, "parent": null, "vector": [14, 0, 0.5, 0.125, 0, 0.66, 0.4, 241, 3, 1, 0, 0, 959, 10, 1], "semantic": {"name": "basedir", "arg_names": [], "import_names": [], "rhs_call_name": "dirname", "annotation": ""}, "snippet": "basedir = dirname(__file__)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99952:Assign_L5_C0", "label": "cmd =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.625, 0.125, 0, 0.66, 0.6, 604, 0, 0, 0, 0, 0, 5, 2], "semantic": {"name": "cmd", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "cmd = ['pybot', '--outputdir', join(basedir, 'results'), join(basedir, 'vacalc')]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99952:Assign_L6_C0", "label": "pythonpath =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.75, 0.125, 0, 0.66, 0.8, 56, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "pythonpath", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "pythonpath = '%s:%s' % (join(basedir, 'lib'), join(basedir, '..', 'src'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99952:Expr_L8_C0", "label": "call()", "type": "expression", "loc": [8, 8], "level": 0, "parent": null, "vector": [8, 0, 1.0, 0.125, 0, 0.66, 1.0, 832, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "call", "arg_names": [], "import_names": [], "rhs_call_name": "call", "annotation": ""}, "snippet": "subprocess.call(' '.join(cmd), shell=True, env={'PYTHONPATH': pythonpath})"}] | [] |
import os
import sys
import subprocess
import datetime
import tempfile
import vacalc
class VacalcLibrary(object):
def __init__(self):
self._db_file = os.path.join(tempfile.gettempdir(),
'vacalc-atestdb.csv')
def count_vacation(self, startdate, year):
resource = vacalc.Employee('Test Resource', startdate)
return vacalc.Vacation(resource.startdate, int(year)).days
def clear_database(self):
if os.path.isfile(self._db_file):
print 'Removing %s' % self._db_file
os.remove(self._db_file)
def add_employee(self, name, startdate):
self._run('add_employee', name, startdate)
def get_employee(self, name):
self._run('get_employee', name)
def show_vacation(self, name, year):
self._run('show_vacation', name, year)
def _run(self, command, *args):
cmd = [sys.executable, vacalc.__file__, command] + list(args)
print subprocess.list2cmdline(cmd)
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
env={'VACALC_DB': self._db_file})
self._status = proc.stdout.read().strip()
print self._status
def status_should_be(self, status):
if self._status != status:
raise AssertionError("Expected status to be '%s' but it was '%s'"
% (status, self._status))
| ajibawa-2023/Python-Code-Large/train/row_99953 | 30 | 46 | 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_99953:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0217, 0.0217, 0, 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_99953:Import_L2_C0", "label": "sys import sys", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0435, 0.0217, 0, 0.66, 0.1667, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99953:Import_L3_C0", "label": "subprocess import subprocess", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0652, 0.0217, 0, 0.66, 0.3333, 394, 0, 1, 0, 0, 394, 0, 0], "semantic": {"name": "subprocess", "arg_names": [], "import_names": ["subprocess"], "rhs_call_name": "", "annotation": ""}, "snippet": "import subprocess"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99953:Import_L4_C0", "label": "datetime import datetime", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.087, 0.0217, 0, 0.66, 0.5, 426, 0, 1, 0, 0, 426, 0, 0], "semantic": {"name": "datetime", "arg_names": [], "import_names": ["datetime"], "rhs_call_name": "", "annotation": ""}, "snippet": "import datetime"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99953:Import_L5_C0", "label": "tempfile import tempfile", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.1087, 0.0217, 0, 0.66, 0.6667, 516, 0, 1, 0, 0, 516, 0, 0], "semantic": {"name": "tempfile", "arg_names": [], "import_names": ["tempfile"], "rhs_call_name": "", "annotation": ""}, "snippet": "import tempfile"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99953:Import_L7_C0", "label": "vacalc import vacalc", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.1522, 0.0217, 0, 0.66, 0.8333, 513, 0, 1, 0, 0, 513, 0, 0], "semantic": {"name": "vacalc", "arg_names": [], "import_names": ["vacalc"], "rhs_call_name": "", "annotation": ""}, "snippet": "import vacalc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99953:ClassDef_L10_C0", "label": "VacalcLibrary", "type": "class", "loc": [10, 46], "level": 0, "parent": null, "vector": [3, 0, 0.6087, 0.8043, 0, 0.66, 1.0, 639, 0, 8, 0, 0, 186, 0, 19], "semantic": {"name": "VacalcLibrary", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class VacalcLibrary(object):\n\n def __init__(self):\n self._db_file = os.path.join(tempfile.gettempdir(),\n 'vacalc-atestdb.csv')\n\n def count_vacation(self, startdate, year):\n resource = vacalc.Employee('Test Resource', startdate)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99953:FunctionDef_L12_C4", "label": "__init__", "type": "function", "loc": [12, 14], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99953:ClassDef_L10_C0", "vector": [2, 1, 0.2826, 0.0652, 1, 0.23, 0.0, 555, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self):\n self._db_file = os.path.join(tempfile.gettempdir(),\n 'vacalc-atestdb.csv')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99953:Assign_L13_C8", "label": "self._db_file = join()", "type": "assigned_variable", "loc": [13, 14], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99953:FunctionDef_L12_C4", "vector": [14, 2, 0.2935, 0.0435, 2, 0.17, 0.0, 383, 3, 2, 0, 0, 933, 10, 2], "semantic": {"name": "self._db_file", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " self._db_file = os.path.join(tempfile.gettempdir(),\n 'vacalc-atestdb.csv')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99953:FunctionDef_L16_C4", "label": "count_vacation", "type": "function", "loc": [16, 18], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99953:ClassDef_L10_C0", "vector": [2, 1, 0.3696, 0.0652, 1, 0.23, 0.1429, 341, 0, 3, 1, 0, 0, 0, 3], "semantic": {"name": "count_vacation", "arg_names": ["self", "startdate", "year"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def count_vacation(self, startdate, year):\n resource = vacalc.Employee('Test Resource', startdate)\n return vacalc.Vacation(resource.startdate, int(year)).days"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99953:Assign_L17_C8", "label": "resource = Employee()", "type": "assigned_variable", "loc": [17, 17], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99953:FunctionDef_L16_C4", "vector": [14, 2, 0.3696, 0.0217, 2, 0.02, 0.0, 559, 3, 2, 0, 0, 19, 10, 1], "semantic": {"name": "resource", "arg_names": [], "import_names": [], "rhs_call_name": "Employee", "annotation": ""}, "snippet": " resource = vacalc.Employee('Test Resource', startdate)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99953:Return_L18_C8", "label": "return", "type": "return", "loc": [18, 18], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99953:FunctionDef_L16_C4", "vector": [13, 2, 0.3913, 0.0217, 2, 0.02, 1.0, 0, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return vacalc.Vacation(resource.startdate, int(year)).days"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99953:FunctionDef_L20_C4", "label": "clear_database", "type": "function", "loc": [20, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99953:ClassDef_L10_C0", "vector": [2, 1, 0.4674, 0.087, 1, 0.23, 0.2857, 535, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "clear_database", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def clear_database(self):\n if os.path.isfile(self._db_file):\n print('Removing %s' % self._db_file)\n os.remove(self._db_file)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99953:If_L21_C8", "label": "if", "type": "if", "loc": [21, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99953:FunctionDef_L20_C4", "vector": [4, 2, 0.4783, 0.0652, 2, 0.35, 0.0, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if os.path.isfile(self._db_file):\n print('Removing %s' % self._db_file)\n os.remove(self._db_file)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99953:Expr_L22_C12", "label": "print()", "type": "expression", "loc": [22, 22], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99953:If_L21_C8", "vector": [8, 3, 0.4783, 0.0217, 3, 0.35, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Removing %s' % self._db_file)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99953:Expr_L23_C12", "label": "remove()", "type": "expression", "loc": [23, 23], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99953:If_L21_C8", "vector": [8, 3, 0.5, 0.0217, 3, 0.35, 1.0, 185, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "remove", "arg_names": [], "import_names": [], "rhs_call_name": "remove", "annotation": ""}, "snippet": " os.remove(self._db_file)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99953:FunctionDef_L25_C4", "label": "add_employee", "type": "function", "loc": [25, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99953:ClassDef_L10_C0", "vector": [2, 1, 0.5543, 0.0435, 1, 0.23, 0.4286, 604, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "add_employee", "arg_names": ["self", "name", "startdate"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add_employee(self, name, startdate):\n self._run('add_employee', name, startdate)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99953:Expr_L26_C8", "label": "_run()", "type": "expression", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99953:FunctionDef_L25_C4", "vector": [8, 2, 0.5652, 0.0217, 2, 0.68, 0.0, 736, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "_run", "arg_names": [], "import_names": [], "rhs_call_name": "_run", "annotation": ""}, "snippet": " self._run('add_employee', name, startdate)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99953:FunctionDef_L28_C4", "label": "get_employee", "type": "function", "loc": [28, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99953:ClassDef_L10_C0", "vector": [2, 1, 0.6196, 0.0435, 1, 0.23, 0.5714, 364, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "get_employee", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_employee(self, name):\n self._run('get_employee', name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99953:Expr_L29_C8", "label": "_run()", "type": "expression", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99953:FunctionDef_L28_C4", "vector": [8, 2, 0.6304, 0.0217, 2, 0.27, 0.0, 736, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_run", "arg_names": [], "import_names": [], "rhs_call_name": "_run", "annotation": ""}, "snippet": " self._run('get_employee', name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99953:FunctionDef_L31_C4", "label": "show_vacation", "type": "function", "loc": [31, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99953:ClassDef_L10_C0", "vector": [2, 1, 0.6848, 0.0435, 1, 0.23, 0.7143, 655, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "show_vacation", "arg_names": ["self", "name", "year"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def show_vacation(self, name, year):\n self._run('show_vacation', name, year)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99953:Expr_L32_C8", "label": "_run()", "type": "expression", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99953:FunctionDef_L31_C4", "vector": [8, 2, 0.6957, 0.0217, 2, 0.95, 0.0, 736, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "_run", "arg_names": [], "import_names": [], "rhs_call_name": "_run", "annotation": ""}, "snippet": " self._run('show_vacation', name, year)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99953:FunctionDef_L34_C4", "label": "_run", "type": "function", "loc": [34, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99953:ClassDef_L10_C0", "vector": [2, 1, 0.8152, 0.1739, 1, 0.23, 0.8571, 736, 0, 3, 0, 0, 0, 0, 7], "semantic": {"name": "_run", "arg_names": ["self", "command", "args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _run(self, command, *args):\n cmd = [sys.executable, vacalc.__file__, command] + list(args)\n print(subprocess.list2cmdline(cmd))\n proc = subprocess.Popen(cmd, stdout=subprocess.PIPE,\n stderr=subprocess.STDOUT,\n env={'VACALC_DB': self._db_file})\n self._status = proc.stdout.read().strip()\n print(self._status)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99953:Assign_L35_C8", "label": "cmd =", "type": "assigned_variable", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99953:FunctionDef_L34_C4", "vector": [14, 2, 0.7609, 0.0217, 2, 0.47, 0.0, 604, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "cmd", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cmd = [sys.executable, vacalc.__file__, command] + list(args)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99953:Expr_L36_C8", "label": "print()", "type": "expression", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99953:FunctionDef_L34_C4", "vector": [8, 2, 0.7826, 0.0217, 2, 0.47, 0.25, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(subprocess.list2cmdline(cmd))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99953:Assign_L37_C8", "label": "proc = Popen()", "type": "assigned_variable", "loc": [37, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99953:FunctionDef_L34_C4", "vector": [14, 2, 0.8261, 0.0652, 2, 0.47, 0.5, 456, 3, 4, 0, 0, 568, 10, 1], "semantic": {"name": "proc", "arg_names": [], "import_names": [], "rhs_call_name": "Popen", "annotation": ""}, "snippet": " proc = subprocess.Popen(cmd, stdout=subprocess.PIPE,\n stderr=subprocess.STDOUT,\n env={'VACALC_DB': self._db_file})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99953:Assign_L40_C8", "label": "self._status = strip()", "type": "assigned_variable", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99953:FunctionDef_L34_C4", "vector": [14, 2, 0.8696, 0.0217, 2, 0.47, 0.75, 891, 3, 0, 0, 0, 973, 10, 2], "semantic": {"name": "self._status", "arg_names": [], "import_names": [], "rhs_call_name": "strip", "annotation": ""}, "snippet": " self._status = proc.stdout.read().strip()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99953:Expr_L41_C8", "label": "print()", "type": "expression", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99953:FunctionDef_L34_C4", "vector": [8, 2, 0.8913, 0.0217, 2, 0.47, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(self._status)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99953:FunctionDef_L43_C4", "label": "status_should_be", "type": "function", "loc": [43, 46], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99953:ClassDef_L10_C0", "vector": [2, 1, 0.9674, 0.087, 1, 0.23, 1.0, 296, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "status_should_be", "arg_names": ["self", "status"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def status_should_be(self, status):\n if self._status != status:\n raise AssertionError(\"Expected status to be '%s' but it was '%s'\"\n % (status, self._status))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99953:If_L44_C8", "label": "if", "type": "if", "loc": [44, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99953:FunctionDef_L43_C4", "vector": [4, 2, 0.9783, 0.0652, 2, 0.04, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._status != status:\n raise AssertionError(\"Expected status to be '%s' but it was '%s'\"\n % (status, self._status))"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99953:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99953:FunctionDef_L12_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99953:FunctionDef_L12_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99953:Assign_L13_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99953:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99953:FunctionDef_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99953:FunctionDef_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99953:Assign_L17_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99953:FunctionDef_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99953:Return_L18_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99953:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99953:FunctionDef_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99953:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99953:If_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99953:If_L21_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99953:Expr_L22_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99953:If_L21_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99953:Expr_L23_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99953:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99953:FunctionDef_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99953:FunctionDef_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99953:Expr_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99953:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99953:FunctionDef_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99953:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99953:Expr_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99953:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99953:FunctionDef_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99953:FunctionDef_L31_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99953:Expr_L32_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99953:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99953:FunctionDef_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99953:FunctionDef_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99953:Assign_L35_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99953:FunctionDef_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99953:Expr_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99953:FunctionDef_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99953:Assign_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99953:FunctionDef_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99953:Assign_L40_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99953:FunctionDef_L34_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99953:Expr_L41_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99953:ClassDef_L10_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99953:FunctionDef_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99953:FunctionDef_L43_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99953:If_L44_C8"}] |
from __future__ import with_statement
import os
import sys
import csv
import datetime
import tempfile
class VacalcError(Exception): pass
class EmployeeStore(object):
def __init__(self, db_file):
self._db_file = db_file
if self._db_file and os.path.isfile(self._db_file):
self._employees = self._read_employees(self._db_file)
else:
self._employees = {}
def _read_employees(self, path):
employees = {}
with open(path) as db:
for row in csv.reader(db):
employee = Employee(row[0], row[1])
employees[employee.name] = employee
return employees
def get_employee(self, name):
try:
return self._employees[name]
except KeyError:
raise VacalcError("Employee '%s' not found" % name)
def get_all_employees(self):
return self._employees.values()
def add_employee(self, employee):
if employee.name in self._employees:
raise VacalcError("Employee '%s' already exists in the system" %
employee.name)
self._employees[employee.name] = employee
self._serialize(employee)
def _serialize(self, employee):
if not self._db_file:
return
with open(self._db_file, 'a') as db:
writer = csv.writer(db, lineterminator='\n')
writer.writerow([employee.name, employee.startdate])
class Employee(object):
def __init__(self, name, startdate):
self.name = name
self.startdate = self._parse_date(startdate)
def _parse_date(self, datestring):
year, month, day = datestring.split('-')
return datetime.date(int(year), int(month), int(day))
class Vacation(object):
max_vacation = 12 * 2.5
no_vacation = 0
vacation_per_month = 2
credit_start_month = 4
work_days_required= 14
def __init__(self, empstartdate, vacation_year):
self.days = self._calculate_vacation(empstartdate, vacation_year)
def _calculate_vacation(self, start, year):
if self._has_worked_longer_than_year(start, year):
return self.max_vacation
if self._started_after_holiday_credit_year_ended(start, year):
return self.no_vacation
return self._count_working_months(start) * self.vacation_per_month
def _has_worked_longer_than_year(self, start, year):
return year-start.year > 1 or \
(year-start.year == 1 and start.month < self.credit_start_month)
def _started_after_holiday_credit_year_ended(self, start, year):
return start.year-year > 0 or \
(year == start.year and start.month >= self.credit_start_month)
def _count_working_months(self, start):
months = self.credit_start_month - start.month
if months <= 0:
months += 12
if self._first_month_has_too_few_working_days(start):
months -= 1
return months
def _first_month_has_too_few_working_days(self, start):
days = 0
date = start
while date:
if self._is_working_day(date):
days += 1
date = self._next_date(date)
return days < self.work_days_required
def _is_working_day(self, date):
return date.weekday() < 5
def _next_date(self, date):
try:
return date.replace(day=date.day+1)
except ValueError:
return None
class VacationCalculator(object):
def __init__(self, employeestore):
self._employeestore = employeestore
def show_vacation(self, name, year):
employee = self._employeestore.get_employee(name)
vacation = Vacation(employee.startdate, int(year))
return "%s has %d vacation days in year %s" \
% (name, vacation.days, year)
def add_employee(self, name, startdate):
employee = Employee(name, startdate)
self._employeestore.add_employee(employee)
return "Successfully added employee '%s'." % employee.name
def get_employee(self, name):
employee = self._employeestore.get_employee(name)
return '%s: start date %s' % (employee.name, employee.startdate)
def main(args):
db_file = os.environ.get('VACALC_DB', os.path.join(tempfile.gettempdir(),
'vacalcdb.csv'))
try:
cmd = getattr(VacationCalculator(EmployeeStore(db_file)), args[0])
return cmd(*args[1:])
except (AttributeError, TypeError):
raise VacalcError('invalid command or arguments')
if __name__ == '__main__':
try:
print main(sys.argv[1:])
sys.exit(0)
except VacalcError, err:
print err
sys.exit(1)
| ajibawa-2023/Python-Code-Large/train/row_99954 | 95 | 146 | 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_99954:ImportFrom_L1_C0", "label": "from __future__ import with_statement", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0068, 0.0068, 0, 0.66, 0.0, 777, 0, 1, 0, 0, 777, 0, 0], "semantic": {"name": "__future__", "arg_names": [], "import_names": ["with_statement"], "rhs_call_name": "", "annotation": ""}, "snippet": "from __future__ import with_statement"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:Import_L2_C0", "label": "os import os", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0137, 0.0068, 0, 0.66, 0.0909, 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_99954:Import_L3_C0", "label": "sys import sys", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0205, 0.0068, 0, 0.66, 0.1818, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:Import_L4_C0", "label": "csv import csv", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0274, 0.0068, 0, 0.66, 0.2727, 312, 0, 1, 0, 0, 312, 0, 0], "semantic": {"name": "csv", "arg_names": [], "import_names": ["csv"], "rhs_call_name": "", "annotation": ""}, "snippet": "import csv"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:Import_L5_C0", "label": "datetime import datetime", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0342, 0.0068, 0, 0.66, 0.3636, 426, 0, 1, 0, 0, 426, 0, 0], "semantic": {"name": "datetime", "arg_names": [], "import_names": ["datetime"], "rhs_call_name": "", "annotation": ""}, "snippet": "import datetime"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:Import_L6_C0", "label": "tempfile import tempfile", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0411, 0.0068, 0, 0.66, 0.4545, 516, 0, 1, 0, 0, 516, 0, 0], "semantic": {"name": "tempfile", "arg_names": [], "import_names": ["tempfile"], "rhs_call_name": "", "annotation": ""}, "snippet": "import tempfile"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:ClassDef_L9_C0", "label": "VacalcError", "type": "class", "loc": [9, 9], "level": 0, "parent": null, "vector": [3, 0, 0.0616, 0.0068, 0, 0.66, 0.5455, 840, 0, 0, 0, 0, 645, 0, 0], "semantic": {"name": "VacalcError", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class VacalcError(Exception): pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:ClassDef_L12_C0", "label": "EmployeeStore", "type": "class", "loc": [12, 50], "level": 0, "parent": null, "vector": [3, 0, 0.2123, 0.2671, 0, 0.66, 0.6364, 828, 0, 6, 0, 0, 186, 0, 12], "semantic": {"name": "EmployeeStore", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class EmployeeStore(object):\n\n def __init__(self, db_file):\n self._db_file = db_file\n if self._db_file and os.path.isfile(self._db_file):\n self._employees = self._read_employees(self._db_file)\n else:\n self._employees = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L14_C4", "label": "__init__", "type": "function", "loc": [14, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:ClassDef_L12_C0", "vector": [2, 1, 0.113, 0.0411, 1, 0.64, 0.0, 555, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "db_file"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, db_file):\n self._db_file = db_file\n if self._db_file and os.path.isfile(self._db_file):\n self._employees = self._read_employees(self._db_file)\n else:\n self._employees = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:Assign_L15_C8", "label": "self._db_file =", "type": "assigned_variable", "loc": [15, 15], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L14_C4", "vector": [14, 2, 0.1027, 0.0068, 2, 0.88, 0.0, 383, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._db_file", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._db_file = db_file"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:If_L16_C8", "label": "if", "type": "if", "loc": [16, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L14_C4", "vector": [4, 2, 0.1199, 0.0274, 2, 0.88, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._db_file and os.path.isfile(self._db_file):\n self._employees = self._read_employees(self._db_file)\n else:\n self._employees = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:Assign_L17_C12", "label": "self._employees = _read_employees()", "type": "assigned_variable", "loc": [17, 17], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:If_L16_C8", "vector": [14, 3, 0.1164, 0.0068, 3, 0.71, 0.0, 73, 3, 1, 0, 0, 181, 10, 1], "semantic": {"name": "self._employees", "arg_names": [], "import_names": [], "rhs_call_name": "_read_employees", "annotation": ""}, "snippet": " self._employees = self._read_employees(self._db_file)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:Assign_L19_C12", "label": "self._employees =", "type": "assigned_variable", "loc": [19, 19], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:If_L16_C8", "vector": [14, 3, 0.1301, 0.0068, 3, 0.71, 1.0, 73, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self._employees", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._employees = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L21_C4", "label": "_read_employees", "type": "function", "loc": [21, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:ClassDef_L12_C0", "vector": [2, 1, 0.1644, 0.0479, 1, 0.64, 0.2, 181, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "_read_employees", "arg_names": ["self", "path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _read_employees(self, path):\n employees = {}\n with open(path) as db:\n for row in csv.reader(db):\n employee = Employee(row[0], row[1])\n employees[employee.name] = employee\n return employees"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:Assign_L22_C8", "label": "employees =", "type": "assigned_variable", "loc": [22, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L21_C4", "vector": [14, 2, 0.1507, 0.0068, 2, 0.76, 0.0, 670, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "employees", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " employees = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:For_L24_C12", "label": "for row", "type": "for", "loc": [24, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L21_C4", "vector": [6, 2, 0.1712, 0.0205, 2, 0.76, 0.0, 767, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "row", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for row in csv.reader(db):\n employee = Employee(row[0], row[1])\n employees[employee.name] = employee"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:Assign_L25_C16", "label": "employee = Employee()", "type": "assigned_variable", "loc": [25, 25], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:For_L24_C12", "vector": [14, 3, 0.1712, 0.0068, 3, 0.04, 0.0, 70, 3, 2, 0, 0, 19, 10, 1], "semantic": {"name": "employee", "arg_names": [], "import_names": [], "rhs_call_name": "Employee", "annotation": ""}, "snippet": " employee = Employee(row[0], row[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:Assign_L26_C16", "label": "assign", "type": "assigned_variable", "loc": [26, 26], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:For_L24_C12", "vector": [14, 3, 0.1781, 0.0068, 3, 0.04, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " employees[employee.name] = employee"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:Return_L27_C8", "label": "return", "type": "return", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L21_C4", "vector": [13, 2, 0.1849, 0.0068, 2, 0.76, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return employees"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L29_C4", "label": "get_employee", "type": "function", "loc": [29, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:ClassDef_L12_C0", "vector": [2, 1, 0.2123, 0.0342, 1, 0.64, 0.4, 364, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "get_employee", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_employee(self, name):\n try:\n return self._employees[name]\n except KeyError:\n raise VacalcError(\"Employee '%s' not found\" % name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:Try_L30_C8", "label": "try", "type": "try", "loc": [30, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L29_C4", "vector": [7, 2, 0.2158, 0.0274, 2, 0.17, 0.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n return self._employees[name]\n except KeyError:\n raise VacalcError(\"Employee '%s' not found\" % name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:Return_L31_C12", "label": "return", "type": "return", "loc": [31, 31], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:Try_L30_C8", "vector": [13, 3, 0.2123, 0.0068, 3, 0.9, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._employees[name]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L35_C4", "label": "get_all_employees", "type": "function", "loc": [35, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:ClassDef_L12_C0", "vector": [2, 1, 0.2432, 0.0137, 1, 0.64, 0.6, 173, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "get_all_employees", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_all_employees(self):\n return self._employees.values()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:Return_L36_C8", "label": "return", "type": "return", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L35_C4", "vector": [13, 2, 0.2466, 0.0068, 2, 0.76, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._employees.values()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L38_C4", "label": "add_employee", "type": "function", "loc": [38, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:ClassDef_L12_C0", "vector": [2, 1, 0.2774, 0.0411, 1, 0.64, 0.8, 604, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "add_employee", "arg_names": ["self", "employee"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add_employee(self, employee):\n if employee.name in self._employees:\n raise VacalcError(\"Employee '%s' already exists in the system\" %\n employee.name)\n self._employees[employee.name] = employee\n self._serialize(employee)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:If_L39_C8", "label": "if", "type": "if", "loc": [39, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L38_C4", "vector": [4, 2, 0.274, 0.0205, 2, 0.46, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if employee.name in self._employees:\n raise VacalcError(\"Employee '%s' already exists in the system\" %\n employee.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:Assign_L42_C8", "label": "assign", "type": "assigned_variable", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L38_C4", "vector": [14, 2, 0.2877, 0.0068, 2, 0.46, 0.5, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._employees[employee.name] = employee"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:Expr_L43_C8", "label": "_serialize()", "type": "expression", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L38_C4", "vector": [8, 2, 0.2945, 0.0068, 2, 0.46, 1.0, 898, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_serialize", "arg_names": [], "import_names": [], "rhs_call_name": "_serialize", "annotation": ""}, "snippet": " self._serialize(employee)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L45_C4", "label": "_serialize", "type": "function", "loc": [45, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:ClassDef_L12_C0", "vector": [2, 1, 0.3253, 0.0411, 1, 0.64, 1.0, 898, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "_serialize", "arg_names": ["self", "employee"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _serialize(self, employee):\n if not self._db_file:\n return\n with open(self._db_file, 'a') as db:\n writer = csv.writer(db, lineterminator='\\n')\n writer.writerow([employee.name, employee.startdate])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:If_L46_C8", "label": "if", "type": "if", "loc": [46, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L45_C4", "vector": [4, 2, 0.3185, 0.0137, 2, 0.31, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self._db_file:\n return"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:Return_L47_C12", "label": "return", "type": "return", "loc": [47, 47], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:If_L46_C8", "vector": [13, 3, 0.3219, 0.0068, 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_99954:Assign_L49_C12", "label": "writer = writer()", "type": "assigned_variable", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L45_C4", "vector": [14, 2, 0.3356, 0.0068, 2, 0.31, 0.0, 614, 3, 2, 0, 0, 614, 10, 1], "semantic": {"name": "writer", "arg_names": [], "import_names": [], "rhs_call_name": "writer", "annotation": ""}, "snippet": " writer = csv.writer(db, lineterminator='\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:Expr_L50_C12", "label": "writerow()", "type": "expression", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L45_C4", "vector": [8, 2, 0.3425, 0.0068, 2, 0.31, 1.0, 941, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "writerow", "arg_names": [], "import_names": [], "rhs_call_name": "writerow", "annotation": ""}, "snippet": " writer.writerow([employee.name, employee.startdate])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:ClassDef_L53_C0", "label": "Employee", "type": "class", "loc": [53, 61], "level": 0, "parent": null, "vector": [3, 0, 0.3904, 0.0616, 0, 0.66, 0.7273, 19, 0, 2, 0, 0, 186, 0, 6], "semantic": {"name": "Employee", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Employee(object):\n\n def __init__(self, name, startdate):\n self.name = name\n self.startdate = self._parse_date(startdate)\n\n def _parse_date(self, datestring):\n year, month, day = datestring.split('-')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L55_C4", "label": "__init__", "type": "function", "loc": [55, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:ClassDef_L53_C0", "vector": [2, 1, 0.3836, 0.0205, 1, 0.23, 0.0, 555, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "name", "startdate"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, name, startdate):\n self.name = name\n self.startdate = self._parse_date(startdate)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:Assign_L56_C8", "label": "self.name =", "type": "assigned_variable", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L55_C4", "vector": [14, 2, 0.3836, 0.0068, 2, 0.22, 0.0, 689, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.name = name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:Assign_L57_C8", "label": "self.startdate = _parse_date()", "type": "assigned_variable", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L55_C4", "vector": [14, 2, 0.3904, 0.0068, 2, 0.22, 1.0, 239, 3, 1, 0, 0, 813, 10, 1], "semantic": {"name": "self.startdate", "arg_names": [], "import_names": [], "rhs_call_name": "_parse_date", "annotation": ""}, "snippet": " self.startdate = self._parse_date(startdate)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L59_C4", "label": "_parse_date", "type": "function", "loc": [59, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:ClassDef_L53_C0", "vector": [2, 1, 0.411, 0.0205, 1, 0.23, 1.0, 813, 0, 2, 1, 0, 0, 0, 5], "semantic": {"name": "_parse_date", "arg_names": ["self", "datestring"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _parse_date(self, datestring):\n year, month, day = datestring.split('-')\n return datetime.date(int(year), int(month), int(day))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:Assign_L60_C8", "label": "year, month, day = split()", "type": "assigned_variable", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L59_C4", "vector": [14, 2, 0.411, 0.0068, 2, 0.32, 0.0, 389, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "year, month, day", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " year, month, day = datestring.split('-')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:Return_L61_C8", "label": "return", "type": "return", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L59_C4", "vector": [13, 2, 0.4178, 0.0068, 2, 0.32, 1.0, 0, 3, 0, 0, 0, 0, 10, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return datetime.date(int(year), int(month), int(day))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:ClassDef_L64_C0", "label": "Vacation", "type": "class", "loc": [64, 113], "level": 0, "parent": null, "vector": [3, 0, 0.6062, 0.3425, 0, 0.66, 0.8182, 929, 0, 8, 0, 0, 186, 0, 9], "semantic": {"name": "Vacation", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Vacation(object):\n max_vacation = 12 * 2.5\n no_vacation = 0\n vacation_per_month = 2\n credit_start_month = 4\n work_days_required= 14\n\n def __init__(self, empstartdate, vacation_year):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:Assign_L65_C4", "label": "max_vacation =", "type": "assigned_variable", "loc": [65, 65], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:ClassDef_L64_C0", "vector": [14, 1, 0.4452, 0.0068, 1, 0.58, 0.0, 900, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "max_vacation", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " max_vacation = 12 * 2.5"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:Assign_L66_C4", "label": "no_vacation =", "type": "assigned_variable", "loc": [66, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:ClassDef_L64_C0", "vector": [14, 1, 0.4521, 0.0068, 1, 0.58, 0.0833, 143, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "no_vacation", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " no_vacation = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:Assign_L67_C4", "label": "vacation_per_month =", "type": "assigned_variable", "loc": [67, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:ClassDef_L64_C0", "vector": [14, 1, 0.4589, 0.0068, 1, 0.58, 0.1667, 315, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "vacation_per_month", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " vacation_per_month = 2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:Assign_L68_C4", "label": "credit_start_month =", "type": "assigned_variable", "loc": [68, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:ClassDef_L64_C0", "vector": [14, 1, 0.4658, 0.0068, 1, 0.58, 0.25, 816, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "credit_start_month", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " credit_start_month = 4"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:Assign_L69_C4", "label": "work_days_required =", "type": "assigned_variable", "loc": [69, 69], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:ClassDef_L64_C0", "vector": [14, 1, 0.4726, 0.0068, 1, 0.58, 0.3333, 578, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "work_days_required", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " work_days_required= 14"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L71_C4", "label": "__init__", "type": "function", "loc": [71, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:ClassDef_L64_C0", "vector": [2, 1, 0.4897, 0.0137, 1, 0.58, 0.4167, 555, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "empstartdate", "vacation_year"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, empstartdate, vacation_year):\n self.days = self._calculate_vacation(empstartdate, vacation_year)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:Assign_L72_C8", "label": "self.days = _calculate_vacation()", "type": "assigned_variable", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L71_C4", "vector": [14, 2, 0.4932, 0.0068, 2, 0.07, 0.0, 705, 3, 2, 0, 0, 599, 10, 1], "semantic": {"name": "self.days", "arg_names": [], "import_names": [], "rhs_call_name": "_calculate_vacation", "annotation": ""}, "snippet": " self.days = self._calculate_vacation(empstartdate, vacation_year)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L74_C4", "label": "_calculate_vacation", "type": "function", "loc": [74, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:ClassDef_L64_C0", "vector": [2, 1, 0.524, 0.0411, 1, 0.58, 0.5, 599, 0, 3, 1, 0, 0, 0, 3], "semantic": {"name": "_calculate_vacation", "arg_names": ["self", "start", "year"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _calculate_vacation(self, start, year):\n if self._has_worked_longer_than_year(start, year):\n return self.max_vacation\n if self._started_after_holiday_credit_year_ended(start, year):\n return self.no_vacation\n return self._count_working_months(start) * self.vacation_per_month"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:If_L75_C8", "label": "if", "type": "if", "loc": [75, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L74_C4", "vector": [4, 2, 0.5171, 0.0137, 2, 0.36, 0.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._has_worked_longer_than_year(start, year):\n return self.max_vacation"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:Return_L76_C12", "label": "return", "type": "return", "loc": [76, 76], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:If_L75_C8", "vector": [13, 3, 0.5205, 0.0068, 3, 0.43, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.max_vacation"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:If_L77_C8", "label": "if", "type": "if", "loc": [77, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L74_C4", "vector": [4, 2, 0.5308, 0.0137, 2, 0.36, 0.5, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._started_after_holiday_credit_year_ended(start, year):\n return self.no_vacation"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:Return_L78_C12", "label": "return", "type": "return", "loc": [78, 78], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:If_L77_C8", "vector": [13, 3, 0.5342, 0.0068, 3, 0.79, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self.no_vacation"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:Return_L79_C8", "label": "return", "type": "return", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L74_C4", "vector": [13, 2, 0.5411, 0.0068, 2, 0.36, 1.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._count_working_months(start) * self.vacation_per_month"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L81_C4", "label": "_has_worked_longer_than_year", "type": "function", "loc": [81, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:ClassDef_L64_C0", "vector": [2, 1, 0.5616, 0.0205, 1, 0.58, 0.5833, 781, 0, 3, 1, 0, 0, 0, 0], "semantic": {"name": "_has_worked_longer_than_year", "arg_names": ["self", "start", "year"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _has_worked_longer_than_year(self, start, year):\n return year-start.year > 1 or \\\n (year-start.year == 1 and start.month < self.credit_start_month)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:Return_L82_C8", "label": "return", "type": "return", "loc": [82, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L81_C4", "vector": [13, 2, 0.5651, 0.0137, 2, 0.72, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return year-start.year > 1 or \\\n (year-start.year == 1 and start.month < self.credit_start_month)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L85_C4", "label": "_started_after_holiday_credit_year_ended", "type": "function", "loc": [85, 87], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:ClassDef_L64_C0", "vector": [2, 1, 0.589, 0.0205, 1, 0.58, 0.6667, 773, 0, 3, 1, 0, 0, 0, 0], "semantic": {"name": "_started_after_holiday_credit_year_ended", "arg_names": ["self", "start", "year"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _started_after_holiday_credit_year_ended(self, start, year):\n return start.year-year > 0 or \\\n (year == start.year and start.month >= self.credit_start_month)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:Return_L86_C8", "label": "return", "type": "return", "loc": [86, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L85_C4", "vector": [13, 2, 0.5925, 0.0137, 2, 0.14, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return start.year-year > 0 or \\\n (year == start.year and start.month >= self.credit_start_month)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L89_C4", "label": "_count_working_months", "type": "function", "loc": [89, 95], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:ClassDef_L64_C0", "vector": [2, 1, 0.6301, 0.0479, 1, 0.58, 0.75, 145, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "_count_working_months", "arg_names": ["self", "start"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _count_working_months(self, start):\n months = self.credit_start_month - start.month\n if months <= 0:\n months += 12\n if self._first_month_has_too_few_working_days(start):\n months -= 1\n return months"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:Assign_L90_C8", "label": "months =", "type": "assigned_variable", "loc": [90, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L89_C4", "vector": [14, 2, 0.6164, 0.0068, 2, 0.31, 0.0, 458, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "months", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " months = self.credit_start_month - start.month"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:If_L91_C8", "label": "if", "type": "if", "loc": [91, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L89_C4", "vector": [4, 2, 0.6267, 0.0137, 2, 0.31, 0.3333, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if months <= 0:\n months += 12"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:If_L93_C8", "label": "if", "type": "if", "loc": [93, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L89_C4", "vector": [4, 2, 0.6404, 0.0137, 2, 0.31, 0.6667, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._first_month_has_too_few_working_days(start):\n months -= 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:Return_L95_C8", "label": "return", "type": "return", "loc": [95, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L89_C4", "vector": [13, 2, 0.6507, 0.0068, 2, 0.31, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return months"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L97_C4", "label": "_first_month_has_too_few_working_days", "type": "function", "loc": [97, 104], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:ClassDef_L64_C0", "vector": [2, 1, 0.6884, 0.0548, 1, 0.58, 0.8333, 177, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "_first_month_has_too_few_working_days", "arg_names": ["self", "start"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _first_month_has_too_few_working_days(self, start):\n days = 0\n date = start\n while date:\n if self._is_working_day(date):\n days += 1\n date = self._next_date(date)\n return days < self.work_days_required"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:Assign_L98_C8", "label": "days =", "type": "assigned_variable", "loc": [98, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L97_C4", "vector": [14, 2, 0.6712, 0.0068, 2, 0.77, 0.0, 939, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "days", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " days = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:Assign_L99_C8", "label": "date =", "type": "assigned_variable", "loc": [99, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L97_C4", "vector": [14, 2, 0.6781, 0.0068, 2, 0.77, 0.3333, 56, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "date", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " date = start"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:While_L100_C8", "label": "while", "type": "while", "loc": [100, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L97_C4", "vector": [5, 2, 0.6952, 0.0274, 2, 0.77, 0.6667, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " while date:\n if self._is_working_day(date):\n days += 1\n date = self._next_date(date)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:If_L101_C12", "label": "if", "type": "if", "loc": [101, 102], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:While_L100_C8", "vector": [4, 3, 0.6952, 0.0137, 3, 0.94, 0.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._is_working_day(date):\n days += 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:Assign_L103_C12", "label": "date = _next_date()", "type": "assigned_variable", "loc": [103, 103], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:While_L100_C8", "vector": [14, 3, 0.7055, 0.0068, 3, 0.94, 1.0, 56, 3, 1, 0, 0, 187, 10, 1], "semantic": {"name": "date", "arg_names": [], "import_names": [], "rhs_call_name": "_next_date", "annotation": ""}, "snippet": " date = self._next_date(date)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:Return_L104_C8", "label": "return", "type": "return", "loc": [104, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L97_C4", "vector": [13, 2, 0.7123, 0.0068, 2, 0.77, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return days < self.work_days_required"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L106_C4", "label": "_is_working_day", "type": "function", "loc": [106, 107], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:ClassDef_L64_C0", "vector": [2, 1, 0.7295, 0.0137, 1, 0.58, 0.9167, 927, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "_is_working_day", "arg_names": ["self", "date"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _is_working_day(self, date):\n return date.weekday() < 5"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:Return_L107_C8", "label": "return", "type": "return", "loc": [107, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L106_C4", "vector": [13, 2, 0.7329, 0.0068, 2, 0.21, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return date.weekday() < 5"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L109_C4", "label": "_next_date", "type": "function", "loc": [109, 113], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:ClassDef_L64_C0", "vector": [2, 1, 0.7603, 0.0342, 1, 0.58, 1.0, 187, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "_next_date", "arg_names": ["self", "date"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _next_date(self, date):\n try:\n return date.replace(day=date.day+1)\n except ValueError:\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:Try_L110_C8", "label": "try", "type": "try", "loc": [110, 113], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L109_C4", "vector": [7, 2, 0.7637, 0.0274, 2, 0.96, 0.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n return date.replace(day=date.day+1)\n except ValueError:\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:Return_L111_C12", "label": "return", "type": "return", "loc": [111, 111], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:Try_L110_C8", "vector": [13, 3, 0.7603, 0.0068, 3, 0.31, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return date.replace(day=date.day+1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:Return_L113_C12", "label": "return", "type": "return", "loc": [113, 113], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:Try_L110_C8", "vector": [13, 3, 0.774, 0.0068, 3, 0.31, 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_99954:ClassDef_L116_C0", "label": "VacationCalculator", "type": "class", "loc": [116, 134], "level": 0, "parent": null, "vector": [3, 0, 0.8562, 0.1301, 0, 0.66, 0.9091, 305, 0, 4, 0, 0, 186, 0, 6], "semantic": {"name": "VacationCalculator", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class VacationCalculator(object):\n\n def __init__(self, employeestore):\n self._employeestore = employeestore\n\n def show_vacation(self, name, year):\n employee = self._employeestore.get_employee(name)\n vacation = Vacation(employee.startdate, int(year))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L118_C4", "label": "__init__", "type": "function", "loc": [118, 119], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:ClassDef_L116_C0", "vector": [2, 1, 0.8116, 0.0137, 1, 0.25, 0.0, 555, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "employeestore"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, employeestore):\n self._employeestore = employeestore"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:Assign_L119_C8", "label": "self._employeestore =", "type": "assigned_variable", "loc": [119, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L118_C4", "vector": [14, 2, 0.8151, 0.0068, 2, 0.34, 0.0, 222, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._employeestore", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._employeestore = employeestore"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L121_C4", "label": "show_vacation", "type": "function", "loc": [121, 125], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:ClassDef_L116_C0", "vector": [2, 1, 0.8425, 0.0342, 1, 0.25, 0.3333, 655, 0, 3, 1, 0, 0, 0, 3], "semantic": {"name": "show_vacation", "arg_names": ["self", "name", "year"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def show_vacation(self, name, year):\n employee = self._employeestore.get_employee(name)\n vacation = Vacation(employee.startdate, int(year))\n return \"%s has %d vacation days in year %s\" \\\n % (name, vacation.days, year)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:Assign_L122_C8", "label": "employee = get_employee()", "type": "assigned_variable", "loc": [122, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L121_C4", "vector": [14, 2, 0.8356, 0.0068, 2, 0.83, 0.0, 70, 3, 1, 0, 0, 364, 10, 1], "semantic": {"name": "employee", "arg_names": [], "import_names": [], "rhs_call_name": "get_employee", "annotation": ""}, "snippet": " employee = self._employeestore.get_employee(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:Assign_L123_C8", "label": "vacation = Vacation()", "type": "assigned_variable", "loc": [123, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L121_C4", "vector": [14, 2, 0.8425, 0.0068, 2, 0.83, 0.5, 474, 3, 2, 0, 0, 929, 10, 2], "semantic": {"name": "vacation", "arg_names": [], "import_names": [], "rhs_call_name": "Vacation", "annotation": ""}, "snippet": " vacation = Vacation(employee.startdate, int(year))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:Return_L124_C8", "label": "return", "type": "return", "loc": [124, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L121_C4", "vector": [13, 2, 0.8527, 0.0137, 2, 0.83, 1.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return \"%s has %d vacation days in year %s\" \\\n % (name, vacation.days, year)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L127_C4", "label": "add_employee", "type": "function", "loc": [127, 130], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:ClassDef_L116_C0", "vector": [2, 1, 0.8801, 0.0274, 1, 0.25, 0.6667, 604, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "add_employee", "arg_names": ["self", "name", "startdate"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add_employee(self, name, startdate):\n employee = Employee(name, startdate)\n self._employeestore.add_employee(employee)\n return \"Successfully added employee '%s'.\" % employee.name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:Assign_L128_C8", "label": "employee = Employee()", "type": "assigned_variable", "loc": [128, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L127_C4", "vector": [14, 2, 0.8767, 0.0068, 2, 0.65, 0.0, 70, 3, 2, 0, 0, 19, 10, 1], "semantic": {"name": "employee", "arg_names": [], "import_names": [], "rhs_call_name": "Employee", "annotation": ""}, "snippet": " employee = Employee(name, startdate)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:Expr_L129_C8", "label": "add_employee()", "type": "expression", "loc": [129, 129], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L127_C4", "vector": [8, 2, 0.8836, 0.0068, 2, 0.65, 0.5, 604, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add_employee", "arg_names": [], "import_names": [], "rhs_call_name": "add_employee", "annotation": ""}, "snippet": " self._employeestore.add_employee(employee)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:Return_L130_C8", "label": "return", "type": "return", "loc": [130, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L127_C4", "vector": [13, 2, 0.8904, 0.0068, 2, 0.65, 1.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return \"Successfully added employee '%s'.\" % employee.name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L132_C4", "label": "get_employee", "type": "function", "loc": [132, 134], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:ClassDef_L116_C0", "vector": [2, 1, 0.911, 0.0205, 1, 0.25, 1.0, 364, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "get_employee", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def get_employee(self, name):\n employee = self._employeestore.get_employee(name)\n return '%s: start date %s' % (employee.name, employee.startdate)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:Assign_L133_C8", "label": "employee = get_employee()", "type": "assigned_variable", "loc": [133, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L132_C4", "vector": [14, 2, 0.911, 0.0068, 2, 0.68, 0.0, 70, 3, 1, 0, 0, 364, 10, 1], "semantic": {"name": "employee", "arg_names": [], "import_names": [], "rhs_call_name": "get_employee", "annotation": ""}, "snippet": " employee = self._employeestore.get_employee(name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:Return_L134_C8", "label": "return", "type": "return", "loc": [134, 134], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L132_C4", "vector": [13, 2, 0.9178, 0.0068, 2, 0.68, 1.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '%s: start date %s' % (employee.name, employee.startdate)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L137_C0", "label": "main", "type": "function", "loc": [137, 144], "level": 0, "parent": null, "vector": [2, 0, 0.9623, 0.0548, 0, 0.66, 1.0, 624, 0, 1, 1, 0, 0, 0, 8], "semantic": {"name": "main", "arg_names": ["args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def main(args):\n db_file = os.environ.get('VACALC_DB', os.path.join(tempfile.gettempdir(),\n 'vacalcdb.csv'))\n try:\n cmd = getattr(VacationCalculator(EmployeeStore(db_file)), args[0])\n return cmd(*args[1:])\n except (AttributeError, TypeError):\n raise VacalcError('invalid command or arguments')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:Assign_L138_C4", "label": "db_file = get()", "type": "assigned_variable", "loc": [138, 139], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L137_C0", "vector": [14, 1, 0.9486, 0.0137, 1, 0.61, 0.0, 129, 3, 2, 0, 0, 607, 10, 3], "semantic": {"name": "db_file", "arg_names": [], "import_names": [], "rhs_call_name": "get", "annotation": ""}, "snippet": " db_file = os.environ.get('VACALC_DB', os.path.join(tempfile.gettempdir(),\n 'vacalcdb.csv'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:Try_L140_C4", "label": "try", "type": "try", "loc": [140, 144], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L137_C0", "vector": [7, 1, 0.9726, 0.0342, 1, 0.61, 1.0, 0, 0, 1, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n cmd = getattr(VacationCalculator(EmployeeStore(db_file)), args[0])\n return cmd(*args[1:])\n except (AttributeError, TypeError):\n raise VacalcError('invalid command or arguments')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:Assign_L141_C8", "label": "cmd = getattr()", "type": "assigned_variable", "loc": [141, 141], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:Try_L140_C4", "vector": [14, 2, 0.9658, 0.0068, 2, 0.42, 0.0, 604, 3, 2, 0, 0, 121, 10, 3], "semantic": {"name": "cmd", "arg_names": [], "import_names": [], "rhs_call_name": "getattr", "annotation": ""}, "snippet": " cmd = getattr(VacationCalculator(EmployeeStore(db_file)), args[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99954:Return_L142_C8", "label": "return", "type": "return", "loc": [142, 142], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99954:Try_L140_C4", "vector": [13, 2, 0.9726, 0.0068, 2, 0.42, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return cmd(*args[1:])"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99954:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L14_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:Assign_L15_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L14_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:If_L16_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:If_L16_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:Assign_L17_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:If_L16_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:Assign_L19_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:Assign_L22_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:For_L24_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:For_L24_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:Assign_L25_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:For_L24_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:Assign_L26_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L21_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:Return_L27_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L29_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:Try_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:Try_L30_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:Return_L31_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L35_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L35_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:Return_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:If_L39_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:Assign_L42_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:Expr_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:ClassDef_L12_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:If_L46_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:If_L46_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:Return_L47_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:Assign_L49_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L45_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:Expr_L50_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:ClassDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:Assign_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L55_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:Assign_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:ClassDef_L53_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:Assign_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:Return_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:Assign_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:Assign_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:Assign_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:Assign_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:Assign_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L71_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:Assign_L72_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:If_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:If_L75_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:Return_L76_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:If_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:If_L77_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:Return_L78_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L74_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:Return_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:Return_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L85_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L85_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:Return_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L89_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:Assign_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:If_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:If_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:Return_L95_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L97_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:Assign_L98_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:Assign_L99_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:While_L100_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:While_L100_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:If_L101_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:While_L100_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:Assign_L103_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L97_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:Return_L104_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L106_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L106_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:Return_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:ClassDef_L64_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L109_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:Try_L110_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:Try_L110_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:Return_L111_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:Try_L110_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:Return_L113_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:ClassDef_L116_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L118_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L118_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:Assign_L119_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:ClassDef_L116_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L121_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:Assign_L122_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:Assign_L123_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:Return_L124_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:ClassDef_L116_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L127_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L127_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:Assign_L128_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L127_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:Expr_L129_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L127_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:Return_L130_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:ClassDef_L116_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L132_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L132_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:Assign_L133_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L132_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:Return_L134_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L137_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:Assign_L138_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:FunctionDef_L137_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:Try_L140_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:Try_L140_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:Assign_L141_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99954:Try_L140_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99954:Return_L142_C8"}] |
VALUE_FROM_VAR_FILE='Expected Value'
| ajibawa-2023/Python-Code-Large/train/row_99955 | 1 | 1 | 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_99955:Assign_L1_C0", "label": "VALUE_FROM_VAR_FILE =", "type": "assigned_variable", "loc": [1, 1], "level": 0, "parent": null, "vector": [14, 0, 1.0, 1.0, 0, 0.66, 0.0, 246, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "VALUE_FROM_VAR_FILE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "VALUE_FROM_VAR_FILE='Expected Value'"}] | [] |
def this_keyword_is_in_funnylib():
print 'jee'
| ajibawa-2023/Python-Code-Large/train/row_99956 | 2 | 2 | 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_99956:FunctionDef_L1_C0", "label": "this_keyword_is_in_funnylib", "type": "function", "loc": [1, 2], "level": 0, "parent": null, "vector": [2, 0, 0.75, 1.0, 0, 0.66, 0.0, 708, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "this_keyword_is_in_funnylib", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def this_keyword_is_in_funnylib():\n print('jee')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99956:Expr_L2_C4", "label": "print()", "type": "expression", "loc": [2, 2], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99956:FunctionDef_L1_C0", "vector": [8, 1, 1.0, 0.5, 1, 0.01, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('jee')"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99956:FunctionDef_L1_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99956:Expr_L2_C4"}] |
# Copyright 2008-2011 Nokia Siemens Networks Oyj
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import with_statement
import subprocess
import time
from random import randint
import os
import re
import sys
from robot.libraries import BuiltIn
from robot.utils import html_escape, ArgumentParser
from robot.version import get_version
class Parallel(object):
"""
Library for executing tests in parallel from inside of a robot test case.
Tests are executed in subprocesses.
You can add arguments to all parallel test runs from `library importing`,
for a set of parallel tests with `Add Arguments For Parallel Tests` and
for an individual parallel test by passing the arguments in `Start Parallel Test`.
The following command line arguments (also from argument files) are automatically
passed to parallel tests:
--loglevel, --runmode, --pythonpath, --variable, --variablefile
Example:
| *Settings* |
| Library | Parallel | pybot |
| *Test Cases* |
| Runner |
| | Run Parallel Tests | Hello | World |
| Hello |
| | [Tags] | parallel |
| | Log | Hello ${WORLD} |
| World |
| | [Tags] | parallel |
| | Log | ${HELLO} World |
`pybot --exclude parallel --variable HELLO:Hello --variable WORLD:World .`
"""
def __init__(self, runner_script, *arguments):
"""
`runner_script` is pybot or jybot or a custom script.
`arguments` are default arguments given to every test execution.
Example:
| Library | Parallel | pybot | --variable | variable:value | --loglevel | DEBUG |
"""
self._script = runner_script
self._arguments = self._get_arguments(arguments)
self._processes = []
self._data_source = None
def _get_arguments(self, additional_arguments):
options,_ = ArgumentParser(_get_cmd_arguments()).parse_args(sys.argv[1:], argfile='argumentfile', unescape='escape')
args = []
for arg in ['loglevel', 'runmode', 'pythonpath', 'variable', 'variablefile']:
args += self._get_type_arguments(options, arg)
args += list(additional_arguments)
return args
def _get_type_arguments(self, options, key):
value = options[key]
args = []
if value is not None:
if not isinstance(value, list):
value = [value]
for var in value:
args += ['--%s' % key, var]
return args
def add_arguments_for_parallel_tests(self, *arguments):
"""Adds `arguments` to be used when parallel test is started.
`arguments` is a list of arguments to pass to parallel executions.
In the following example variable my_var is used in both of the tests
started with the keyword `Run Parallel Tests`:
| Add Arguments For Parallel Tests | --variable | my_var:value |
| Run Parallel Tests | Test | Another Test |
"""
self._arguments += list(arguments)
def set_data_source_for_parallel_tests(self, data_source):
"""Sets data source which is used when parallel tests are started.
`data_source` is path to file which contains the test/tests which are
started/executed with keywords `Start Parallel Test` or `Run Parallel
Tests`.
If tests to be executed are in the same suite and Robot Framework 2.5
or later is used, there is no need to use this keyword as `data_source`
can be automatically resolved.
Examples:
| Set Data Source For Parallel Tests | ${CURDIR}${/}my_parallel_suite.txt |
| Start Parallel Test | My Parallel Test |
| Wait All Parallel Tests |
"""
self._data_source = data_source
def start_parallel_test(self, test_name, *arguments):
"""Starts executing test with given `test_name` and `arguments`.
`arguments` is a list of Robot Framework command line arguments passed to
the started test execution. It should not include data source. Use
`Set Data Source For Parallel Tests` keyword for setting the data
source. Additional arguments can also be set in library import and with
`Add Arguments For Parallel Tests` keyword.
Returns a process object that represents this execution.
Example:
| Set Data Source For Parallel Tests | MySuite.txt |
| Start Parallel Test | Test From My Suite |
| Set Data Source For Parallel Tests | MyFriendsSuite.txt |
| Start Parallel Test | Test From My Friends Suite |
| Wait All Parallel Tests |
"""
if self._data_source is None:
self._data_source = BuiltIn.BuiltIn().replace_variables('${SUITE_SOURCE}')
process = _ParaRobo(test_name, self._data_source,
self._arguments+list(arguments))
process.run(self._script)
self._processes.append(process)
return process
def run_parallel_tests(self, *test_names):
"""Executes all given tests parallel and wait those to be ready.
Arguments can be set with keyword `Add Arguments For Parallel Tests`
and data source with keyword `Set Data Source For Parallel Tests`.
Example:
| Add Arguments For Parallel Tests | --variable | SOME_VARIABLE:someValue |
| Set Data Source For Parallel Tests | MySuite.txt |
| Run Parallel Tests | My Parallel Test | My Another Parallel Test |
When the parallel tests are from different data sources see the example in `Start Parallel Test`.
"""
processes = []
for name in test_names:
processes += [self.start_parallel_test(name)]
self.wait_parallel_tests(*processes)
def wait_parallel_tests(self, *processes):
"""Waits given `processes` to be ready and fails if any of the tests failed.
`Processes` are list of test execution processes returned from keyword
`Start Parallel Test`.
Example
| ${test 1}= | Start Parallel Test | First Test |
| ${test 2}= | Start Parallel Test | Test That Runs All The Time |
| Wait Parallel Tests | ${test 1} |
| ${test 3}= | Start Parallel Test | Third Test |
| Wait Parallel Tests | ${test 2} | ${test 3} |
"""
failed = []
for process in processes:
if process.wait() != 0:
failed += [process.test]
process.report()
self._processes.remove(process)
if failed:
raise AssertionError("Following tests failed:\n%s" % "\n".join(failed))
def wait_all_parallel_tests(self):
"""Wait all started test executions to be ready and fails if any of those failed."""
self.wait_parallel_tests(*self._processes)
def stop_all_parallel_tests(self):
"""Forcefully stops all the test executions.
NOTE: Requires Python 2.6 or later.
"""
for process in self._processes:
process.stop_test_execution()
self._processes = []
class _ParaRobo(object):
def __init__(self, test, data_source, arguments):
self.test = test
self._data_source = data_source
self._args = arguments
self._built_in = BuiltIn.BuiltIn()
id = self._create_id()
self._output = 'output_%s.xml' % id
self._log = 'log_%s.html' % id
self._output_dir = self._built_in.replace_variables("${OUTPUT DIR}")
self._monitor_out = os.path.join(self._output_dir, 'monitor_%s.txt' % id)
@property
def _suite_name(self):
name = os.path.splitext(os.path.basename(self._data_source))[0]
name = name.split('__', 1)[-1] # Strip possible prefix
name = name.replace('_', ' ').strip()
if name.islower():
name = name.title()
return name
def _create_id(self):
return "%s_%s" % (randint(0, 10000), time.strftime('%Y%m%d_%H%m%S.')+\
('%03d' % (int(time.time()*1000) % 1000)))
def run(self, script):
self._monitor_file = open(self._monitor_out, 'w')
cmd = [script,
'--outputdir', self._output_dir,
'--output', self._output,
'--report', 'None',
'--log', self._log,
'--monitorcolors', 'off',
'--test', self.test]+\
self._args + [self._data_source]
print "Starting test execution: %s" % " ".join(cmd)
self._process = subprocess.Popen(cmd,
shell=os.sep == '\\',
stdout=self._monitor_file,
stderr=self._monitor_file,
env=self._get_environment_variables())
def _get_environment_variables(self):
environment_variables = os.environ.copy()
if environment_variables.has_key("ROBOT_SYSLOG_FILE"):
del(environment_variables["ROBOT_SYSLOG_FILE"])
return environment_variables
def wait(self):
rc = self._process.wait()
self._monitor_file.close()
return rc
def report(self):
with open(self._monitor_out, 'r') as monitor_file:
monitor_output = monitor_file.read()
try:
os.remove(self._monitor_out)
except:
pass
match = re.search('^Log: (.*)$', monitor_output, re.MULTILINE)
monitor_output = self._replace_stdout_log_message_levels(monitor_output)
monitor_output = html_escape(monitor_output)
if match:
monitor_output = monitor_output.replace(match.group(1), '<a href="%s#test_%s.%s">%s</a>' % (self._log, self._suite_name, self.test, match.group(1)))
monitor_output = self._add_colours(monitor_output)
print "*HTML* %s" % monitor_output
def _replace_stdout_log_message_levels(self, output):
for level in ['TRACE', 'WARN', 'DEBUG', 'INFO', 'HTML']:
output = output.replace('\n*%s*' % level, '\n *%s*' % level)
return output
def _add_colours(self, output):
for name, colour in [("PASS", "pass"), ("FAIL", "fail"), ("ERROR", "fail")]:
output = output.replace(' %s ' % name, ' <span class="%s">%s</span> ' % (colour, name))
return output
def stop_test_execution(self):
try:
self._process.terminate()
except AttributeError:
pass
self.report()
def _get_cmd_arguments():
import robot
runner_path = os.path.join(os.path.dirname(os.path.abspath(robot.__file__)),
'runner.py')
with open(runner_path, 'r') as runner_file:
runner_content = runner_file.read()
return re.search('"""(.+)"""', runner_content, re.DOTALL).groups()[0]
| ajibawa-2023/Python-Code-Large/train/row_99957 | 126 | 295 | 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_99957:ImportFrom_L16_C0", "label": "from __future__ import with_statement", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.0542, 0.0034, 0, 0.66, 0.0, 777, 0, 1, 0, 0, 777, 0, 0], "semantic": {"name": "__future__", "arg_names": [], "import_names": ["with_statement"], "rhs_call_name": "", "annotation": ""}, "snippet": "from __future__ import with_statement"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Import_L17_C0", "label": "subprocess import subprocess", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.0576, 0.0034, 0, 0.66, 0.0833, 394, 0, 1, 0, 0, 394, 0, 0], "semantic": {"name": "subprocess", "arg_names": [], "import_names": ["subprocess"], "rhs_call_name": "", "annotation": ""}, "snippet": "import subprocess"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Import_L18_C0", "label": "time import time", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.061, 0.0034, 0, 0.66, 0.1667, 654, 0, 1, 0, 0, 654, 0, 0], "semantic": {"name": "time", "arg_names": [], "import_names": ["time"], "rhs_call_name": "", "annotation": ""}, "snippet": "import time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:ImportFrom_L19_C0", "label": "from random import randint", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.0644, 0.0034, 0, 0.66, 0.25, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "random", "arg_names": [], "import_names": ["randint"], "rhs_call_name": "", "annotation": ""}, "snippet": "from random import randint"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Import_L20_C0", "label": "os import os", "type": "import", "loc": [20, 20], "level": 0, "parent": null, "vector": [1, 0, 0.0678, 0.0034, 0, 0.66, 0.3333, 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_99957:Import_L21_C0", "label": "re import re", "type": "import", "loc": [21, 21], "level": 0, "parent": null, "vector": [1, 0, 0.0712, 0.0034, 0, 0.66, 0.4167, 540, 0, 1, 0, 0, 540, 0, 0], "semantic": {"name": "re", "arg_names": [], "import_names": ["re"], "rhs_call_name": "", "annotation": ""}, "snippet": "import re"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Import_L22_C0", "label": "sys import sys", "type": "import", "loc": [22, 22], "level": 0, "parent": null, "vector": [1, 0, 0.0746, 0.0034, 0, 0.66, 0.5, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:ImportFrom_L23_C0", "label": "from robot.libraries import BuiltIn", "type": "import", "loc": [23, 23], "level": 0, "parent": null, "vector": [1, 0, 0.078, 0.0034, 0, 0.66, 0.5833, 665, 0, 1, 0, 0, 665, 0, 0], "semantic": {"name": "robot.libraries", "arg_names": [], "import_names": ["BuiltIn"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot.libraries import BuiltIn"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:ImportFrom_L24_C0", "label": "from robot.utils import html_escape, ArgumentParser", "type": "import", "loc": [24, 24], "level": 0, "parent": null, "vector": [1, 0, 0.0814, 0.0034, 0, 0.66, 0.6667, 417, 0, 2, 0, 0, 417, 0, 0], "semantic": {"name": "robot.utils", "arg_names": [], "import_names": ["html_escape", "ArgumentParser"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot.utils import html_escape, ArgumentParser"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:ImportFrom_L25_C0", "label": "from robot.version import get_version", "type": "import", "loc": [25, 25], "level": 0, "parent": null, "vector": [1, 0, 0.0847, 0.0034, 0, 0.66, 0.75, 622, 0, 1, 0, 0, 622, 0, 0], "semantic": {"name": "robot.version", "arg_names": [], "import_names": ["get_version"], "rhs_call_name": "", "annotation": ""}, "snippet": "from robot.version import get_version"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:ClassDef_L28_C0", "label": "Parallel", "type": "class", "loc": [28, 198], "level": 0, "parent": null, "vector": [3, 0, 0.3831, 0.5797, 0, 0.66, 0.8333, 6, 0, 10, 0, 0, 186, 0, 23], "semantic": {"name": "Parallel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Parallel(object):\n \"\"\"\n Library for executing tests in parallel from inside of a robot test case.\n Tests are executed in subprocesses. \n \n You can add arguments to all parallel test runs from `library importing`,\n for a set of parallel tests with `Add Arguments For Parallel Tests` and\n for an individual parallel test by passing the arguments in `Start Parallel Test`."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Expr_L29_C4", "label": "expression", "type": "expression", "loc": [29, 57], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:ClassDef_L28_C0", "vector": [8, 1, 0.1458, 0.0983, 1, 0.65, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n Library for executing tests in parallel from inside of a robot test case.\n Tests are executed in subprocesses. \n \n You can add arguments to all parallel test runs from `library importing`,\n for a set of parallel tests with `Add Arguments For Parallel Tests` and\n for an individual parallel test by passing the arguments in `Start Parallel Test`.\n "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L59_C4", "label": "__init__", "type": "function", "loc": [59, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:ClassDef_L28_C0", "vector": [2, 1, 0.2203, 0.0441, 1, 0.65, 0.1, 555, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "runner_script", "arguments"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, runner_script, *arguments):\n \"\"\"\n `runner_script` is pybot or jybot or a custom script.\n\n `arguments` are default arguments given to every test execution.\n\n Example:\n | Library | Parallel | pybot | --variable | variable:value | --loglevel | DEBUG |"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Expr_L60_C8", "label": "expression", "type": "expression", "loc": [60, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L59_C4", "vector": [8, 2, 0.2153, 0.0271, 2, 0.2, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n `runner_script` is pybot or jybot or a custom script.\n\n `arguments` are default arguments given to every test execution.\n\n Example:\n | Library | Parallel | pybot | --variable | variable:value | --loglevel | DEBUG |\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L68_C8", "label": "self._script =", "type": "assigned_variable", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L59_C4", "vector": [14, 2, 0.2305, 0.0034, 2, 0.2, 0.25, 130, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._script", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._script = runner_script"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L69_C8", "label": "self._arguments = _get_arguments()", "type": "assigned_variable", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L59_C4", "vector": [14, 2, 0.2339, 0.0034, 2, 0.2, 0.5, 637, 3, 1, 0, 0, 261, 10, 1], "semantic": {"name": "self._arguments", "arg_names": [], "import_names": [], "rhs_call_name": "_get_arguments", "annotation": ""}, "snippet": " self._arguments = self._get_arguments(arguments)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L70_C8", "label": "self._processes =", "type": "assigned_variable", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L59_C4", "vector": [14, 2, 0.2373, 0.0034, 2, 0.2, 0.75, 649, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self._processes", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._processes = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L71_C8", "label": "self._data_source =", "type": "assigned_variable", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L59_C4", "vector": [14, 2, 0.2407, 0.0034, 2, 0.2, 1.0, 540, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self._data_source", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._data_source = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L73_C4", "label": "_get_arguments", "type": "function", "loc": [73, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:ClassDef_L28_C0", "vector": [2, 1, 0.2576, 0.0237, 1, 0.65, 0.2, 261, 0, 2, 1, 0, 0, 0, 5], "semantic": {"name": "_get_arguments", "arg_names": ["self", "additional_arguments"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_arguments(self, additional_arguments):\n options,_ = ArgumentParser(_get_cmd_arguments()).parse_args(sys.argv[1:], argfile='argumentfile', unescape='escape')\n args = []\n for arg in ['loglevel', 'runmode', 'pythonpath', 'variable', 'variablefile']:\n args += self._get_type_arguments(options, arg)\n args += list(additional_arguments)\n return args"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L74_C8", "label": "options, _ = parse_args()", "type": "assigned_variable", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L73_C4", "vector": [14, 2, 0.2508, 0.0034, 2, 0.46, 0.0, 735, 3, 3, 0, 0, 187, 10, 3], "semantic": {"name": "options, _", "arg_names": [], "import_names": [], "rhs_call_name": "parse_args", "annotation": ""}, "snippet": " options,_ = ArgumentParser(_get_cmd_arguments()).parse_args(sys.argv[1:], argfile='argumentfile', unescape='escape')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L75_C8", "label": "args =", "type": "assigned_variable", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L73_C4", "vector": [14, 2, 0.2542, 0.0034, 2, 0.46, 0.3333, 805, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "args", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " args = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:For_L76_C8", "label": "for arg", "type": "for", "loc": [76, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L73_C4", "vector": [6, 2, 0.2593, 0.0068, 2, 0.46, 0.6667, 447, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "arg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for arg in ['loglevel', 'runmode', 'pythonpath', 'variable', 'variablefile']:\n args += self._get_type_arguments(options, arg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Return_L79_C8", "label": "return", "type": "return", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L73_C4", "vector": [13, 2, 0.2678, 0.0034, 2, 0.46, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return args"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L81_C4", "label": "_get_type_arguments", "type": "function", "loc": [81, 89], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:ClassDef_L28_C0", "vector": [2, 1, 0.2881, 0.0305, 1, 0.65, 0.3, 126, 0, 3, 1, 0, 0, 0, 1], "semantic": {"name": "_get_type_arguments", "arg_names": ["self", "options", "key"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_type_arguments(self, options, key):\n value = options[key]\n args = []\n if value is not None:\n if not isinstance(value, list):\n value = [value]\n for var in value:\n args += ['--%s' % key, var]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L82_C8", "label": "value =", "type": "assigned_variable", "loc": [82, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L81_C4", "vector": [14, 2, 0.278, 0.0034, 2, 0.01, 0.0, 441, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " value = options[key]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L83_C8", "label": "args =", "type": "assigned_variable", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L81_C4", "vector": [14, 2, 0.2814, 0.0034, 2, 0.01, 0.3333, 805, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "args", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " args = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:If_L84_C8", "label": "if", "type": "if", "loc": [84, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L81_C4", "vector": [4, 2, 0.2915, 0.0169, 2, 0.01, 0.6667, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if value is not None:\n if not isinstance(value, list):\n value = [value]\n for var in value:\n args += ['--%s' % key, var]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:If_L85_C12", "label": "if", "type": "if", "loc": [85, 86], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:If_L84_C8", "vector": [4, 3, 0.2898, 0.0068, 3, 0.75, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not isinstance(value, list):\n value = [value]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L86_C16", "label": "value =", "type": "assigned_variable", "loc": [86, 86], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:If_L85_C12", "vector": [14, 4, 0.2915, 0.0034, 4, 0.92, 0.0, 441, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " value = [value]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:For_L87_C12", "label": "for var", "type": "for", "loc": [87, 88], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:If_L84_C8", "vector": [6, 3, 0.2966, 0.0068, 3, 0.75, 1.0, 265, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "var", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for var in value:\n args += ['--%s' % key, var]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Return_L89_C8", "label": "return", "type": "return", "loc": [89, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L81_C4", "vector": [13, 2, 0.3017, 0.0034, 2, 0.01, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return args "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L91_C4", "label": "add_arguments_for_parallel_tests", "type": "function", "loc": [91, 101], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:ClassDef_L28_C0", "vector": [2, 1, 0.3254, 0.0373, 1, 0.65, 0.4, 723, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "add_arguments_for_parallel_tests", "arg_names": ["self", "arguments"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add_arguments_for_parallel_tests(self, *arguments):\n \"\"\"Adds `arguments` to be used when parallel test is started.\n\n `arguments` is a list of arguments to pass to parallel executions.\n\n In the following example variable my_var is used in both of the tests \n started with the keyword `Run Parallel Tests`:\n | Add Arguments For Parallel Tests | --variable | my_var:value |"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Expr_L92_C8", "label": "expression", "type": "expression", "loc": [92, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L91_C4", "vector": [8, 2, 0.3254, 0.0305, 2, 0.24, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Adds `arguments` to be used when parallel test is started.\n\n `arguments` is a list of arguments to pass to parallel executions.\n\n In the following example variable my_var is used in both of the tests \n started with the keyword `Run Parallel Tests`:\n | Add Arguments For Parallel Tests | --variable | my_var:value |\n | Run Parallel Tests | Test | Another Test |"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L103_C4", "label": "set_data_source_for_parallel_tests", "type": "function", "loc": [103, 119], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:ClassDef_L28_C0", "vector": [2, 1, 0.3763, 0.0576, 1, 0.65, 0.5, 866, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "set_data_source_for_parallel_tests", "arg_names": ["self", "data_source"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def set_data_source_for_parallel_tests(self, data_source):\n \"\"\"Sets data source which is used when parallel tests are started.\n\n `data_source` is path to file which contains the test/tests which are\n started/executed with keywords `Start Parallel Test` or `Run Parallel\n Tests`.\n\n If tests to be executed are in the same suite and Robot Framework 2.5"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Expr_L104_C8", "label": "expression", "type": "expression", "loc": [104, 118], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L103_C4", "vector": [8, 2, 0.3763, 0.0508, 2, 0.05, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Sets data source which is used when parallel tests are started.\n\n `data_source` is path to file which contains the test/tests which are\n started/executed with keywords `Start Parallel Test` or `Run Parallel\n Tests`.\n\n If tests to be executed are in the same suite and Robot Framework 2.5\n or later is used, there is no need to use this keyword as `data_source`"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L119_C8", "label": "self._data_source =", "type": "assigned_variable", "loc": [119, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L103_C4", "vector": [14, 2, 0.4034, 0.0034, 2, 0.05, 1.0, 540, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._data_source", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._data_source = data_source"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L121_C4", "label": "start_parallel_test", "type": "function", "loc": [121, 145], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:ClassDef_L28_C0", "vector": [2, 1, 0.4508, 0.0847, 1, 0.65, 0.6, 888, 0, 3, 1, 0, 0, 0, 6], "semantic": {"name": "start_parallel_test", "arg_names": ["self", "test_name", "arguments"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start_parallel_test(self, test_name, *arguments):\n \"\"\"Starts executing test with given `test_name` and `arguments`.\n\n `arguments` is a list of Robot Framework command line arguments passed to \n the started test execution. It should not include data source. Use\n `Set Data Source For Parallel Tests` keyword for setting the data\n source. Additional arguments can also be set in library import and with\n `Add Arguments For Parallel Tests` keyword."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Expr_L122_C8", "label": "expression", "type": "expression", "loc": [122, 138], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L121_C4", "vector": [8, 2, 0.4407, 0.0576, 2, 0.52, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Starts executing test with given `test_name` and `arguments`.\n\n `arguments` is a list of Robot Framework command line arguments passed to \n the started test execution. It should not include data source. Use\n `Set Data Source For Parallel Tests` keyword for setting the data\n source. Additional arguments can also be set in library import and with\n `Add Arguments For Parallel Tests` keyword.\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:If_L139_C8", "label": "if", "type": "if", "loc": [139, 140], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L121_C4", "vector": [4, 2, 0.4729, 0.0068, 2, 0.52, 0.2, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._data_source is None:\n self._data_source = BuiltIn.BuiltIn().replace_variables('${SUITE_SOURCE}')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L140_C12", "label": "self._data_source = replace_variables()", "type": "assigned_variable", "loc": [140, 140], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:If_L139_C8", "vector": [14, 3, 0.4746, 0.0034, 3, 0.79, 0.0, 540, 3, 1, 0, 0, 133, 10, 2], "semantic": {"name": "self._data_source", "arg_names": [], "import_names": [], "rhs_call_name": "replace_variables", "annotation": ""}, "snippet": " self._data_source = BuiltIn.BuiltIn().replace_variables('${SUITE_SOURCE}')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L141_C8", "label": "process = _ParaRobo()", "type": "assigned_variable", "loc": [141, 142], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L121_C4", "vector": [14, 2, 0.4797, 0.0068, 2, 0.52, 0.4, 712, 3, 3, 0, 0, 406, 10, 2], "semantic": {"name": "process", "arg_names": [], "import_names": [], "rhs_call_name": "_ParaRobo", "annotation": ""}, "snippet": " process = _ParaRobo(test_name, self._data_source, \n self._arguments+list(arguments))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Expr_L143_C8", "label": "run()", "type": "expression", "loc": [143, 143], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L121_C4", "vector": [8, 2, 0.4847, 0.0034, 2, 0.52, 0.6, 679, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "run", "arg_names": [], "import_names": [], "rhs_call_name": "run", "annotation": ""}, "snippet": " process.run(self._script)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Expr_L144_C8", "label": "append()", "type": "expression", "loc": [144, 144], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L121_C4", "vector": [8, 2, 0.4881, 0.0034, 2, 0.52, 0.8, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self._processes.append(process)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Return_L145_C8", "label": "return", "type": "return", "loc": [145, 145], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L121_C4", "vector": [13, 2, 0.4915, 0.0034, 2, 0.52, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return process"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L147_C4", "label": "run_parallel_tests", "type": "function", "loc": [147, 163], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:ClassDef_L28_C0", "vector": [2, 1, 0.5254, 0.0576, 1, 0.65, 0.7, 400, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "run_parallel_tests", "arg_names": ["self", "test_names"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def run_parallel_tests(self, *test_names):\n \"\"\"Executes all given tests parallel and wait those to be ready.\n\n Arguments can be set with keyword `Add Arguments For Parallel Tests`\n and data source with keyword `Set Data Source For Parallel Tests`. \n \n Example:\n | Add Arguments For Parallel Tests | --variable | SOME_VARIABLE:someValue |"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Expr_L148_C8", "label": "expression", "type": "expression", "loc": [148, 159], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L147_C4", "vector": [8, 2, 0.5203, 0.0407, 2, 0.44, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Executes all given tests parallel and wait those to be ready.\n\n Arguments can be set with keyword `Add Arguments For Parallel Tests`\n and data source with keyword `Set Data Source For Parallel Tests`. \n \n Example:\n | Add Arguments For Parallel Tests | --variable | SOME_VARIABLE:someValue |\n | Set Data Source For Parallel Tests | MySuite.txt |"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L160_C8", "label": "processes =", "type": "assigned_variable", "loc": [160, 160], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L147_C4", "vector": [14, 2, 0.5424, 0.0034, 2, 0.44, 0.3333, 282, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "processes", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " processes = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:For_L161_C8", "label": "for name", "type": "for", "loc": [161, 162], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L147_C4", "vector": [6, 2, 0.5475, 0.0068, 2, 0.44, 0.6667, 57, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for name in test_names:\n processes += [self.start_parallel_test(name)]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Expr_L163_C8", "label": "wait_parallel_tests()", "type": "expression", "loc": [163, 163], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L147_C4", "vector": [8, 2, 0.5525, 0.0034, 2, 0.44, 1.0, 262, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "wait_parallel_tests", "arg_names": [], "import_names": [], "rhs_call_name": "wait_parallel_tests", "annotation": ""}, "snippet": " self.wait_parallel_tests(*processes)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L165_C4", "label": "wait_parallel_tests", "type": "function", "loc": [165, 185], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:ClassDef_L28_C0", "vector": [2, 1, 0.5932, 0.0712, 1, 0.65, 0.8, 262, 0, 2, 0, 0, 0, 0, 5], "semantic": {"name": "wait_parallel_tests", "arg_names": ["self", "processes"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def wait_parallel_tests(self, *processes):\n \"\"\"Waits given `processes` to be ready and fails if any of the tests failed.\n\n `Processes` are list of test execution processes returned from keyword \n `Start Parallel Test`.\n \n Example\n | ${test 1}= | Start Parallel Test | First Test |"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Expr_L166_C8", "label": "expression", "type": "expression", "loc": [166, 177], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L165_C4", "vector": [8, 2, 0.5814, 0.0407, 2, 0.87, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Waits given `processes` to be ready and fails if any of the tests failed.\n\n `Processes` are list of test execution processes returned from keyword \n `Start Parallel Test`.\n \n Example\n | ${test 1}= | Start Parallel Test | First Test |\n | ${test 2}= | Start Parallel Test | Test That Runs All The Time |"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L178_C8", "label": "failed =", "type": "assigned_variable", "loc": [178, 178], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L165_C4", "vector": [14, 2, 0.6034, 0.0034, 2, 0.87, 0.3333, 277, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "failed", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " failed = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:For_L179_C8", "label": "for process", "type": "for", "loc": [179, 183], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L165_C4", "vector": [6, 2, 0.6136, 0.0169, 2, 0.87, 0.6667, 712, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "process", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for process in processes:\n if process.wait() != 0:\n failed += [process.test]\n process.report()\n self._processes.remove(process)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:If_L180_C12", "label": "if", "type": "if", "loc": [180, 181], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:For_L179_C8", "vector": [4, 3, 0.6119, 0.0068, 3, 0.27, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if process.wait() != 0:\n failed += [process.test]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Expr_L182_C12", "label": "report()", "type": "expression", "loc": [182, 182], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:For_L179_C8", "vector": [8, 3, 0.6169, 0.0034, 3, 0.27, 0.5, 57, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "report", "arg_names": [], "import_names": [], "rhs_call_name": "report", "annotation": ""}, "snippet": " process.report()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Expr_L183_C12", "label": "remove()", "type": "expression", "loc": [183, 183], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:For_L179_C8", "vector": [8, 3, 0.6203, 0.0034, 3, 0.27, 1.0, 185, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "remove", "arg_names": [], "import_names": [], "rhs_call_name": "remove", "annotation": ""}, "snippet": " self._processes.remove(process)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:If_L184_C8", "label": "if", "type": "if", "loc": [184, 185], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L165_C4", "vector": [4, 2, 0.6254, 0.0068, 2, 0.87, 1.0, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if failed:\n raise AssertionError(\"Following tests failed:\\n%s\" % \"\\n\".join(failed))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L187_C4", "label": "wait_all_parallel_tests", "type": "function", "loc": [187, 189], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:ClassDef_L28_C0", "vector": [2, 1, 0.6373, 0.0102, 1, 0.65, 0.9, 346, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "wait_all_parallel_tests", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def wait_all_parallel_tests(self):\n \"\"\"Wait all started test executions to be ready and fails if any of those failed.\"\"\"\n self.wait_parallel_tests(*self._processes)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Expr_L188_C8", "label": "expression", "type": "expression", "loc": [188, 188], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L187_C4", "vector": [8, 2, 0.6373, 0.0034, 2, 0.77, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Wait all started test executions to be ready and fails if any of those failed.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Expr_L189_C8", "label": "wait_parallel_tests()", "type": "expression", "loc": [189, 189], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L187_C4", "vector": [8, 2, 0.6407, 0.0034, 2, 0.77, 1.0, 262, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "wait_parallel_tests", "arg_names": [], "import_names": [], "rhs_call_name": "wait_parallel_tests", "annotation": ""}, "snippet": " self.wait_parallel_tests(*self._processes)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L191_C4", "label": "stop_all_parallel_tests", "type": "function", "loc": [191, 198], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:ClassDef_L28_C0", "vector": [2, 1, 0.6593, 0.0271, 1, 0.65, 1.0, 556, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "stop_all_parallel_tests", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def stop_all_parallel_tests(self):\n \"\"\"Forcefully stops all the test executions.\n \n NOTE: Requires Python 2.6 or later.\n \"\"\"\n for process in self._processes:\n process.stop_test_execution()\n self._processes = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Expr_L192_C8", "label": "expression", "type": "expression", "loc": [192, 195], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L191_C4", "vector": [8, 2, 0.6559, 0.0136, 2, 0.77, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Forcefully stops all the test executions.\n \n NOTE: Requires Python 2.6 or later.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:For_L196_C8", "label": "for process", "type": "for", "loc": [196, 197], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L191_C4", "vector": [6, 2, 0.6661, 0.0068, 2, 0.77, 0.5, 712, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "process", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for process in self._processes:\n process.stop_test_execution()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Expr_L197_C12", "label": "stop_test_execution()", "type": "expression", "loc": [197, 197], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:For_L196_C8", "vector": [8, 3, 0.6678, 0.0034, 3, 0.11, 0.0, 888, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "stop_test_execution", "arg_names": [], "import_names": [], "rhs_call_name": "stop_test_execution", "annotation": ""}, "snippet": " process.stop_test_execution()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L198_C8", "label": "self._processes =", "type": "assigned_variable", "loc": [198, 198], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L191_C4", "vector": [14, 2, 0.6712, 0.0034, 2, 0.77, 1.0, 649, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self._processes", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._processes = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:ClassDef_L201_C0", "label": "_ParaRobo", "type": "class", "loc": [201, 285], "level": 0, "parent": null, "vector": [3, 0, 0.8237, 0.2881, 0, 0.66, 0.9167, 406, 0, 10, 0, 0, 186, 0, 39], "semantic": {"name": "_ParaRobo", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _ParaRobo(object):\n\n def __init__(self, test, data_source, arguments):\n self.test = test\n self._data_source = data_source\n self._args = arguments\n self._built_in = BuiltIn.BuiltIn()\n id = self._create_id()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L203_C4", "label": "__init__", "type": "function", "loc": [203, 212], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:ClassDef_L201_C0", "vector": [2, 1, 0.7034, 0.0339, 1, 0.77, 0.0, 555, 0, 4, 0, 0, 0, 0, 4], "semantic": {"name": "__init__", "arg_names": ["self", "test", "data_source", "arguments"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, test, data_source, arguments):\n self.test = test\n self._data_source = data_source\n self._args = arguments\n self._built_in = BuiltIn.BuiltIn()\n id = self._create_id()\n self._output = 'output_%s.xml' % id\n self._log = 'log_%s.html' % id"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L204_C8", "label": "self.test =", "type": "assigned_variable", "loc": [204, 204], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L203_C4", "vector": [14, 2, 0.6915, 0.0034, 2, 0.68, 0.0, 272, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.test", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.test = test"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L205_C8", "label": "self._data_source =", "type": "assigned_variable", "loc": [205, 205], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L203_C4", "vector": [14, 2, 0.6949, 0.0034, 2, 0.68, 0.125, 540, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._data_source", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._data_source = data_source"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L206_C8", "label": "self._args =", "type": "assigned_variable", "loc": [206, 206], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L203_C4", "vector": [14, 2, 0.6983, 0.0034, 2, 0.68, 0.25, 816, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._args", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._args = arguments"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L207_C8", "label": "self._built_in = BuiltIn()", "type": "assigned_variable", "loc": [207, 207], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L203_C4", "vector": [14, 2, 0.7017, 0.0034, 2, 0.68, 0.375, 882, 3, 0, 0, 0, 961, 10, 1], "semantic": {"name": "self._built_in", "arg_names": [], "import_names": [], "rhs_call_name": "BuiltIn", "annotation": ""}, "snippet": " self._built_in = BuiltIn.BuiltIn()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L208_C8", "label": "id = _create_id()", "type": "assigned_variable", "loc": [208, 208], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L203_C4", "vector": [14, 2, 0.7051, 0.0034, 2, 0.68, 0.5, 941, 3, 0, 0, 0, 37, 10, 1], "semantic": {"name": "id", "arg_names": [], "import_names": [], "rhs_call_name": "_create_id", "annotation": ""}, "snippet": " id = self._create_id()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L209_C8", "label": "self._output =", "type": "assigned_variable", "loc": [209, 209], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L203_C4", "vector": [14, 2, 0.7085, 0.0034, 2, 0.68, 0.625, 867, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._output", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._output = 'output_%s.xml' % id"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L210_C8", "label": "self._log =", "type": "assigned_variable", "loc": [210, 210], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L203_C4", "vector": [14, 2, 0.7119, 0.0034, 2, 0.68, 0.75, 607, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._log", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._log = 'log_%s.html' % id"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L211_C8", "label": "self._output_dir = replace_variables()", "type": "assigned_variable", "loc": [211, 211], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L203_C4", "vector": [14, 2, 0.7153, 0.0034, 2, 0.68, 0.875, 711, 3, 1, 0, 0, 133, 10, 1], "semantic": {"name": "self._output_dir", "arg_names": [], "import_names": [], "rhs_call_name": "replace_variables", "annotation": ""}, "snippet": " self._output_dir = self._built_in.replace_variables(\"${OUTPUT DIR}\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L212_C8", "label": "self._monitor_out = join()", "type": "assigned_variable", "loc": [212, 212], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L203_C4", "vector": [14, 2, 0.7186, 0.0034, 2, 0.68, 1.0, 542, 3, 2, 0, 0, 933, 10, 1], "semantic": {"name": "self._monitor_out", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " self._monitor_out = os.path.join(self._output_dir, 'monitor_%s.txt' % id)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L215_C4", "label": "_suite_name", "type": "function", "loc": [215, 221], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:ClassDef_L201_C0", "vector": [2, 1, 0.739, 0.0237, 1, 0.77, 0.1111, 448, 0, 1, 1, 0, 0, 0, 7], "semantic": {"name": "_suite_name", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _suite_name(self):\n name = os.path.splitext(os.path.basename(self._data_source))[0]\n name = name.split('__', 1)[-1] # Strip possible prefix\n name = name.replace('_', ' ').strip()\n if name.islower():\n name = name.title()\n return name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L216_C8", "label": "name =", "type": "assigned_variable", "loc": [216, 216], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L215_C4", "vector": [14, 2, 0.7322, 0.0034, 2, 0.2, 0.0, 57, 6, 0, 0, 0, 0, 0, 2], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " name = os.path.splitext(os.path.basename(self._data_source))[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L217_C8", "label": "name =", "type": "assigned_variable", "loc": [217, 217], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L215_C4", "vector": [14, 2, 0.7356, 0.0034, 2, 0.2, 0.25, 57, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " name = name.split('__', 1)[-1] # Strip possible prefix"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L218_C8", "label": "name = strip()", "type": "assigned_variable", "loc": [218, 218], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L215_C4", "vector": [14, 2, 0.739, 0.0034, 2, 0.2, 0.5, 57, 3, 0, 0, 0, 973, 10, 2], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "strip", "annotation": ""}, "snippet": " name = name.replace('_', ' ').strip()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:If_L219_C8", "label": "if", "type": "if", "loc": [219, 220], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L215_C4", "vector": [4, 2, 0.7441, 0.0068, 2, 0.2, 0.75, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if name.islower():\n name = name.title()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L220_C12", "label": "name = title()", "type": "assigned_variable", "loc": [220, 220], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:If_L219_C8", "vector": [14, 3, 0.7458, 0.0034, 3, 0.01, 0.0, 57, 3, 0, 0, 0, 48, 10, 1], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "title", "annotation": ""}, "snippet": " name = name.title()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Return_L221_C8", "label": "return", "type": "return", "loc": [221, 221], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L215_C4", "vector": [13, 2, 0.7492, 0.0034, 2, 0.2, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L223_C4", "label": "_create_id", "type": "function", "loc": [223, 225], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:ClassDef_L201_C0", "vector": [2, 1, 0.7593, 0.0102, 1, 0.77, 0.2222, 37, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "_create_id", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _create_id(self):\n return \"%s_%s\" % (randint(0, 10000), time.strftime('%Y%m%d_%H%m%S.')+\\\n ('%03d' % (int(time.time()*1000) % 1000)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Return_L224_C8", "label": "return", "type": "return", "loc": [224, 225], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L223_C4", "vector": [13, 2, 0.761, 0.0068, 2, 0.06, 0.0, 0, 4, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return \"%s_%s\" % (randint(0, 10000), time.strftime('%Y%m%d_%H%m%S.')+\\\n ('%03d' % (int(time.time()*1000) % 1000)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L227_C4", "label": "run", "type": "function", "loc": [227, 242], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:ClassDef_L201_C0", "vector": [2, 1, 0.7949, 0.0542, 1, 0.77, 0.3333, 679, 0, 2, 0, 0, 0, 0, 5], "semantic": {"name": "run", "arg_names": ["self", "script"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def run(self, script):\n self._monitor_file = open(self._monitor_out, 'w')\n cmd = [script,\n '--outputdir', self._output_dir,\n '--output', self._output,\n '--report', 'None',\n '--log', self._log,\n '--monitorcolors', 'off',"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L228_C8", "label": "self._monitor_file = open()", "type": "assigned_variable", "loc": [228, 228], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L227_C4", "vector": [14, 2, 0.7729, 0.0034, 2, 0.3, 0.0, 315, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "self._monitor_file", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": " self._monitor_file = open(self._monitor_out, 'w')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L229_C8", "label": "cmd =", "type": "assigned_variable", "loc": [229, 236], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L227_C4", "vector": [14, 2, 0.7881, 0.0271, 2, 0.3, 0.3333, 604, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cmd", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cmd = [script,\n '--outputdir', self._output_dir,\n '--output', self._output,\n '--report', 'None',\n '--log', self._log,\n '--monitorcolors', 'off',\n '--test', self.test]+\\\n self._args + [self._data_source]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Expr_L237_C8", "label": "print()", "type": "expression", "loc": [237, 237], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L227_C4", "vector": [8, 2, 0.8034, 0.0034, 2, 0.3, 0.6667, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Starting test execution: %s\" % \" \".join(cmd))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L238_C8", "label": "self._process = Popen()", "type": "assigned_variable", "loc": [238, 242], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L227_C4", "vector": [14, 2, 0.8136, 0.0169, 2, 0.3, 1.0, 594, 3, 5, 0, 0, 568, 10, 2], "semantic": {"name": "self._process", "arg_names": [], "import_names": [], "rhs_call_name": "Popen", "annotation": ""}, "snippet": " self._process = subprocess.Popen(cmd,\n shell=os.sep == '\\\\',\n stdout=self._monitor_file, \n stderr=self._monitor_file,\n env=self._get_environment_variables())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L244_C4", "label": "_get_environment_variables", "type": "function", "loc": [244, 248], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:ClassDef_L201_C0", "vector": [2, 1, 0.8339, 0.0169, 1, 0.77, 0.4444, 162, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "_get_environment_variables", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_environment_variables(self):\n environment_variables = os.environ.copy()\n if environment_variables.has_key(\"ROBOT_SYSLOG_FILE\"):\n del(environment_variables[\"ROBOT_SYSLOG_FILE\"])\n return environment_variables"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L245_C8", "label": "environment_variables = copy()", "type": "assigned_variable", "loc": [245, 245], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L244_C4", "vector": [14, 2, 0.8305, 0.0034, 2, 0.91, 0.0, 627, 3, 0, 0, 0, 739, 10, 1], "semantic": {"name": "environment_variables", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " environment_variables = os.environ.copy()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:If_L246_C8", "label": "if", "type": "if", "loc": [246, 247], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L244_C4", "vector": [4, 2, 0.8356, 0.0068, 2, 0.91, 0.5, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if environment_variables.has_key(\"ROBOT_SYSLOG_FILE\"):\n del(environment_variables[\"ROBOT_SYSLOG_FILE\"])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Return_L248_C8", "label": "return", "type": "return", "loc": [248, 248], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L244_C4", "vector": [13, 2, 0.8407, 0.0034, 2, 0.91, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return environment_variables"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L250_C4", "label": "wait", "type": "function", "loc": [250, 253], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:ClassDef_L201_C0", "vector": [2, 1, 0.8525, 0.0136, 1, 0.77, 0.5556, 243, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "wait", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def wait(self):\n rc = self._process.wait()\n self._monitor_file.close()\n return rc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L251_C8", "label": "rc = wait()", "type": "assigned_variable", "loc": [251, 251], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L250_C4", "vector": [14, 2, 0.8508, 0.0034, 2, 0.74, 0.0, 401, 3, 0, 0, 0, 243, 10, 1], "semantic": {"name": "rc", "arg_names": [], "import_names": [], "rhs_call_name": "wait", "annotation": ""}, "snippet": " rc = self._process.wait()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Expr_L252_C8", "label": "close()", "type": "expression", "loc": [252, 252], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L250_C4", "vector": [8, 2, 0.8542, 0.0034, 2, 0.74, 0.5, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " self._monitor_file.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Return_L253_C8", "label": "return", "type": "return", "loc": [253, 253], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L250_C4", "vector": [13, 2, 0.8576, 0.0034, 2, 0.74, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return rc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L255_C4", "label": "report", "type": "function", "loc": [255, 268], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:ClassDef_L201_C0", "vector": [2, 1, 0.8864, 0.0475, 1, 0.77, 0.6667, 57, 0, 1, 0, 0, 0, 0, 11], "semantic": {"name": "report", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def report(self):\n with open(self._monitor_out, 'r') as monitor_file:\n monitor_output = monitor_file.read()\n try:\n os.remove(self._monitor_out)\n except:\n pass\n match = re.search('^Log: (.*)$', monitor_output, re.MULTILINE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L257_C12", "label": "monitor_output = read()", "type": "assigned_variable", "loc": [257, 257], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L255_C4", "vector": [14, 2, 0.8712, 0.0034, 2, 0.79, 0.0, 846, 3, 0, 0, 0, 453, 10, 1], "semantic": {"name": "monitor_output", "arg_names": [], "import_names": [], "rhs_call_name": "read", "annotation": ""}, "snippet": " monitor_output = monitor_file.read()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Try_L258_C8", "label": "try", "type": "try", "loc": [258, 261], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L255_C4", "vector": [7, 2, 0.8797, 0.0136, 2, 0.79, 0.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n os.remove(self._monitor_out)\n except:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Expr_L259_C12", "label": "remove()", "type": "expression", "loc": [259, 259], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:Try_L258_C8", "vector": [8, 3, 0.878, 0.0034, 3, 0.15, 0.0, 185, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "remove", "arg_names": [], "import_names": [], "rhs_call_name": "remove", "annotation": ""}, "snippet": " os.remove(self._monitor_out)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L262_C8", "label": "match = search()", "type": "assigned_variable", "loc": [262, 262], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L255_C4", "vector": [14, 2, 0.8881, 0.0034, 2, 0.79, 0.1667, 36, 3, 3, 0, 0, 163, 10, 1], "semantic": {"name": "match", "arg_names": [], "import_names": [], "rhs_call_name": "search", "annotation": ""}, "snippet": " match = re.search('^Log: (.*)$', monitor_output, re.MULTILINE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L263_C8", "label": "monitor_output = _replace_stdout_log_message_levels()", "type": "assigned_variable", "loc": [263, 263], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L255_C4", "vector": [14, 2, 0.8915, 0.0034, 2, 0.79, 0.3333, 846, 3, 1, 0, 0, 756, 10, 1], "semantic": {"name": "monitor_output", "arg_names": [], "import_names": [], "rhs_call_name": "_replace_stdout_log_message_levels", "annotation": ""}, "snippet": " monitor_output = self._replace_stdout_log_message_levels(monitor_output)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L264_C8", "label": "monitor_output = html_escape()", "type": "assigned_variable", "loc": [264, 264], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L255_C4", "vector": [14, 2, 0.8949, 0.0034, 2, 0.79, 0.5, 846, 3, 1, 0, 0, 435, 10, 1], "semantic": {"name": "monitor_output", "arg_names": [], "import_names": [], "rhs_call_name": "html_escape", "annotation": ""}, "snippet": " monitor_output = html_escape(monitor_output)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:If_L265_C8", "label": "if", "type": "if", "loc": [265, 266], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L255_C4", "vector": [4, 2, 0.9, 0.0068, 2, 0.79, 0.6667, 0, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if match:\n monitor_output = monitor_output.replace(match.group(1), '<a href=\"%s#test_%s.%s\">%s</a>' % (self._log, self._suite_name, self.test, match.group(1)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L266_C12", "label": "monitor_output = replace()", "type": "assigned_variable", "loc": [266, 266], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:If_L265_C8", "vector": [14, 3, 0.9017, 0.0034, 3, 0.05, 0.0, 846, 3, 2, 0, 0, 293, 10, 3], "semantic": {"name": "monitor_output", "arg_names": [], "import_names": [], "rhs_call_name": "replace", "annotation": ""}, "snippet": " monitor_output = monitor_output.replace(match.group(1), '<a href=\"%s#test_%s.%s\">%s</a>' % (self._log, self._suite_name, self.test, match.group(1)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L267_C8", "label": "monitor_output = _add_colours()", "type": "assigned_variable", "loc": [267, 267], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L255_C4", "vector": [14, 2, 0.9051, 0.0034, 2, 0.79, 0.8333, 846, 3, 1, 0, 0, 482, 10, 1], "semantic": {"name": "monitor_output", "arg_names": [], "import_names": [], "rhs_call_name": "_add_colours", "annotation": ""}, "snippet": " monitor_output = self._add_colours(monitor_output)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Expr_L268_C8", "label": "print()", "type": "expression", "loc": [268, 268], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L255_C4", "vector": [8, 2, 0.9085, 0.0034, 2, 0.79, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"*HTML* %s\" % monitor_output)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L270_C4", "label": "_replace_stdout_log_message_levels", "type": "function", "loc": [270, 273], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:ClassDef_L201_C0", "vector": [2, 1, 0.9203, 0.0136, 1, 0.77, 0.7778, 756, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "_replace_stdout_log_message_levels", "arg_names": ["self", "output"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _replace_stdout_log_message_levels(self, output):\n for level in ['TRACE', 'WARN', 'DEBUG', 'INFO', 'HTML']:\n output = output.replace('\\n*%s*' % level, '\\n *%s*' % level)\n return output"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:For_L271_C8", "label": "for level", "type": "for", "loc": [271, 272], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L270_C4", "vector": [6, 2, 0.9203, 0.0068, 2, 0.8, 0.0, 479, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "level", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for level in ['TRACE', 'WARN', 'DEBUG', 'INFO', 'HTML']:\n output = output.replace('\\n*%s*' % level, '\\n *%s*' % level)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L272_C12", "label": "output = replace()", "type": "assigned_variable", "loc": [272, 272], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:For_L271_C8", "vector": [14, 3, 0.922, 0.0034, 3, 0.52, 0.0, 886, 3, 2, 0, 0, 293, 10, 1], "semantic": {"name": "output", "arg_names": [], "import_names": [], "rhs_call_name": "replace", "annotation": ""}, "snippet": " output = output.replace('\\n*%s*' % level, '\\n *%s*' % level)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Return_L273_C8", "label": "return", "type": "return", "loc": [273, 273], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L270_C4", "vector": [13, 2, 0.9254, 0.0034, 2, 0.8, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return output"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L275_C4", "label": "_add_colours", "type": "function", "loc": [275, 278], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:ClassDef_L201_C0", "vector": [2, 1, 0.9373, 0.0136, 1, 0.77, 0.8889, 482, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "_add_colours", "arg_names": ["self", "output"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _add_colours(self, output):\n for name, colour in [(\"PASS\", \"pass\"), (\"FAIL\", \"fail\"), (\"ERROR\", \"fail\")]:\n output = output.replace(' %s ' % name, ' <span class=\"%s\">%s</span> ' % (colour, name))\n return output"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:For_L276_C8", "label": "for name, colour", "type": "for", "loc": [276, 277], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L275_C4", "vector": [6, 2, 0.9373, 0.0068, 2, 0.86, 0.0, 649, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "name, colour", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for name, colour in [(\"PASS\", \"pass\"), (\"FAIL\", \"fail\"), (\"ERROR\", \"fail\")]:\n output = output.replace(' %s ' % name, ' <span class=\"%s\">%s</span> ' % (colour, name))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L277_C12", "label": "output = replace()", "type": "assigned_variable", "loc": [277, 277], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:For_L276_C8", "vector": [14, 3, 0.939, 0.0034, 3, 0.95, 0.0, 886, 3, 2, 0, 0, 293, 10, 1], "semantic": {"name": "output", "arg_names": [], "import_names": [], "rhs_call_name": "replace", "annotation": ""}, "snippet": " output = output.replace(' %s ' % name, ' <span class=\"%s\">%s</span> ' % (colour, name))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Return_L278_C8", "label": "return", "type": "return", "loc": [278, 278], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L275_C4", "vector": [13, 2, 0.9424, 0.0034, 2, 0.86, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return output"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L280_C4", "label": "stop_test_execution", "type": "function", "loc": [280, 285], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:ClassDef_L201_C0", "vector": [2, 1, 0.9576, 0.0203, 1, 0.77, 1.0, 888, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "stop_test_execution", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def stop_test_execution(self):\n try:\n self._process.terminate()\n except AttributeError:\n pass\n self.report()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Try_L281_C8", "label": "try", "type": "try", "loc": [281, 284], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L280_C4", "vector": [7, 2, 0.9576, 0.0136, 2, 0.35, 0.0, 0, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n self._process.terminate()\n except AttributeError:\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Expr_L282_C12", "label": "terminate()", "type": "expression", "loc": [282, 282], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:Try_L281_C8", "vector": [8, 3, 0.9559, 0.0034, 3, 0.21, 0.0, 617, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "terminate", "arg_names": [], "import_names": [], "rhs_call_name": "terminate", "annotation": ""}, "snippet": " self._process.terminate()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Expr_L285_C8", "label": "report()", "type": "expression", "loc": [285, 285], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L280_C4", "vector": [8, 2, 0.9661, 0.0034, 2, 0.35, 1.0, 57, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "report", "arg_names": [], "import_names": [], "rhs_call_name": "report", "annotation": ""}, "snippet": " self.report()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L288_C0", "label": "_get_cmd_arguments", "type": "function", "loc": [288, 294], "level": 0, "parent": null, "vector": [2, 0, 0.9864, 0.0237, 0, 0.66, 1.0, 693, 0, 0, 1, 0, 0, 0, 7], "semantic": {"name": "_get_cmd_arguments", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _get_cmd_arguments():\n import robot\n runner_path = os.path.join(os.path.dirname(os.path.abspath(robot.__file__)),\n 'runner.py')\n with open(runner_path, 'r') as runner_file:\n runner_content = runner_file.read()\n return re.search('\"\"\"(.+)\"\"\"', runner_content, re.DOTALL).groups()[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Import_L289_C4", "label": "robot import robot", "type": "import", "loc": [289, 289], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L288_C0", "vector": [1, 1, 0.9797, 0.0034, 1, 0.34, 0.0, 735, 0, 1, 0, 0, 735, 0, 0], "semantic": {"name": "robot", "arg_names": [], "import_names": ["robot"], "rhs_call_name": "", "annotation": ""}, "snippet": " import robot"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L290_C4", "label": "runner_path = join()", "type": "assigned_variable", "loc": [290, 291], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L288_C0", "vector": [14, 1, 0.9847, 0.0068, 1, 0.34, 0.5, 90, 3, 2, 0, 0, 933, 10, 3], "semantic": {"name": "runner_path", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " runner_path = os.path.join(os.path.dirname(os.path.abspath(robot.__file__)),\n 'runner.py')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L293_C8", "label": "runner_content = read()", "type": "assigned_variable", "loc": [293, 293], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L288_C0", "vector": [14, 1, 0.9932, 0.0034, 1, 0.34, 0.0, 941, 3, 0, 0, 0, 453, 10, 1], "semantic": {"name": "runner_content", "arg_names": [], "import_names": [], "rhs_call_name": "read", "annotation": ""}, "snippet": " runner_content = runner_file.read()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99957:Return_L294_C4", "label": "return", "type": "return", "loc": [294, 294], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L288_C0", "vector": [13, 1, 0.9966, 0.0034, 1, 0.34, 1.0, 0, 6, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return re.search('\"\"\"(.+)\"\"\"', runner_content, re.DOTALL).groups()[0]"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99957:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Expr_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Expr_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L68_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L73_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L73_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L73_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:For_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L73_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Return_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:If_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:If_L84_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:If_L85_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:If_L85_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L86_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:If_L84_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:For_L87_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Return_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L91_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L91_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Expr_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L103_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Expr_L104_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L119_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L121_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Expr_L122_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:If_L139_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:If_L139_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L140_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L141_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Expr_L143_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Expr_L144_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L121_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Return_L145_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L147_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Expr_L148_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L160_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:For_L161_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L147_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Expr_L163_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L165_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L165_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Expr_L166_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L165_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L178_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L165_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:For_L179_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:For_L179_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:If_L180_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:For_L179_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Expr_L182_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:For_L179_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Expr_L183_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L165_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:If_L184_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L187_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L187_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Expr_L188_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L187_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Expr_L189_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:ClassDef_L28_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L191_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L191_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Expr_L192_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L191_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:For_L196_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:For_L196_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Expr_L197_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L191_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L198_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:ClassDef_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L203_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L203_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L204_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L203_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L205_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L203_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L206_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L203_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L207_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L203_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L208_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L203_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L209_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L203_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L210_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L203_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L211_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L203_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L212_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:ClassDef_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L215_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L215_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L216_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L215_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L217_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L215_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L218_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L215_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:If_L219_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:If_L219_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L220_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L215_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Return_L221_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:ClassDef_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L223_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L223_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Return_L224_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:ClassDef_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L227_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L227_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L228_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L227_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L229_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L227_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Expr_L237_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L227_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L238_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:ClassDef_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L244_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L244_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L245_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L244_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:If_L246_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L244_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Return_L248_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:ClassDef_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L250_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L250_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L251_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L250_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Expr_L252_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L250_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Return_L253_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:ClassDef_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L255_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L255_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L257_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L255_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Try_L258_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:Try_L258_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Expr_L259_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L255_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L262_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L255_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L263_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L255_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L264_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L255_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:If_L265_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:If_L265_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L266_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L255_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L267_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L255_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Expr_L268_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:ClassDef_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L270_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L270_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:For_L271_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:For_L271_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L272_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L270_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Return_L273_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:ClassDef_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L275_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L275_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:For_L276_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:For_L276_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L277_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L275_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Return_L278_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:ClassDef_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L280_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L280_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Try_L281_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:Try_L281_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Expr_L282_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L280_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Expr_L285_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L288_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Import_L289_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L288_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L290_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L288_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Assign_L293_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99957:FunctionDef_L288_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99957:Return_L294_C4"}] |
from Queue import Queue
from threading import Event
try:
from multiprocessing.managers import BaseManager
except ImportError:
class Python26Required(object):
def __call__(self, *args):
raise RuntimeError('Requires Python > 2.6')
def __getattr__(self, name):
raise RuntimeError('Requires Python > 2.6')
BaseManager = Python26Required()
class _create_caching_getter(object):
def __init__(self, clazz):
self._clazz = clazz
self._objects = {}
def __call__(self, key):
if key not in self._objects:
self._objects[key] = self._clazz()
return self._objects[key]
class Communicate(object):
"""Library for communication between processes.
For example this can be used to handle communication between processes of the Parallel robot library.
Requires Python 2.6
Example:
Process 1 test file:
| *Settings* |
| Library | Communicate |
| *Test Cases* |
| Communicator |
| | [Setup] | Start Communication Service |
| | Send Message To | my message queue | hello world! |
| | ${message}= | Receive Message From | other message queue |
| | Should Be Equal | ${message} | hello! |
| | [Teardown] | Stop Communication Service |
Process 2 test file:
| *Settings* |
| Library | Communicate | ${process 1 ip address if on a different machine} |
| *Test Cases* |
| Helloer |
| | ${message}= | Receive Message From | my message queue |
| | Should Be Equal | ${message} | hello world! |
| | Send Message To | other message queue | hello! |
"""
def __init__(self, address='127.0.0.1', port=2187):
"""
`address` of the communication server.
`port` of the communication server.
"""
self._address = address
self._port = int(port)
self._authkey = 'live long and prosper'
self._queue = None
self._connected = False
def _connect(self):
self._create_manager().connect()
self._connected = True
def start_communication_service(self):
"""Starts a communication server that will be used to share messages and objects between processes.
"""
self._create_manager(_create_caching_getter(Queue),
_create_caching_getter(Event)).start()
self._connected = True
def stop_communication_service(self):
"""Stops a started communication server.
This ensures that the server and the messages that it has don't influence the next tests.
To ensure that this keyword really happens place this in the teardown section.
"""
self._manager.shutdown()
self._connected = False
def _create_manager(self, queue_getter=None, event_getter=None):
BaseManager.register('get_queue', queue_getter)
BaseManager.register('get_event', event_getter)
self._manager = BaseManager((self._address, self._port), self._authkey)
return self._manager
def send_message_to(self, queue_id, value):
"""Send a message to a message queue.
`queue_id` is the identifier for the queue.
`value` is the message. This can be a string, a number or any serializable object.
Example:
In one process
| Send Message To | my queue | hello world! |
...
In another process
| ${message}= | Receive Message From | my queue |
| Should Be Equal | ${message} | hello world! |
"""
self._get_queue(queue_id).put(value)
def receive_message_from(self, queue_id, timeout=None):
"""Receive and consume a message from a message queue.
By default this keyword will block until there is a message in the queue.
`queue_id` is the identifier for the queue.
`timeout` is the time out in seconds to wait.
Returns the value from the message queue. Fails if timeout expires.
Example:
In one process
| Send Message To | my queue | hello world! |
...
In another process
| ${message}= | Receive Message From | my queue |
| Should Be Equal | ${message} | hello world! |
"""
timeout = float(timeout) if timeout is not None else None
return self._get_queue(queue_id).get(timeout=timeout)
def _get_queue(self, queue_id):
if not self._connected:
self._connect()
return self._manager.get_queue(queue_id)
def wait_for_event(self, event_id, timeout=None):
"""Waits until event with `event_id` is signaled.
Fails if optional timeout expires.
`timeout` is the time out in seconds to wait.
Example:
In one process
| Wait For Event | my event |
...
In another process
| Signal Event | my event |
"""
timeout = float(timeout) if timeout is not None else None
self._get_event(event_id).wait(timeout=timeout)
#NOTE! If Event#clear is ever exposed it has to be secured (for example r/w lock) that none
#of the processes can do it while another is at this position.
if not self._get_event(event_id).isSet():
raise Exception('Timeout')
def signal_event(self, event_id):
"""Signals an event.
If a process is waiting for this event it will stop waiting after the signal.
`event` is the identifier for the event.
Example:
In one process
| Wait For Event | my event |
...
In another process
| Signal Event | my event |
"""
return self._get_event(event_id).set()
def _get_event(self, event_id):
if not self._connected:
self._connect()
return self._manager.get_event(event_id)
| ajibawa-2023/Python-Code-Large/train/row_99958 | 64 | 176 | 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_99958:ImportFrom_L1_C0", "label": "from Queue import Queue", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0057, 0.0057, 0, 0.66, 0.0, 952, 0, 1, 0, 0, 952, 0, 0], "semantic": {"name": "Queue", "arg_names": [], "import_names": ["Queue"], "rhs_call_name": "", "annotation": ""}, "snippet": "from Queue import Queue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99958:ImportFrom_L2_C0", "label": "from threading import Event", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0114, 0.0057, 0, 0.66, 0.25, 83, 0, 1, 0, 0, 83, 0, 0], "semantic": {"name": "threading", "arg_names": [], "import_names": ["Event"], "rhs_call_name": "", "annotation": ""}, "snippet": "from threading import Event"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99958:Try_L3_C0", "label": "try", "type": "try", "loc": [3, 11], "level": 0, "parent": null, "vector": [7, 0, 0.0398, 0.0511, 0, 0.66, 0.5, 0, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "try:\n from multiprocessing.managers import BaseManager\nexcept ImportError:\n class Python26Required(object):\n def __call__(self, *args):\n raise RuntimeError('Requires Python > 2.6')\n def __getattr__(self, name):\n raise RuntimeError('Requires Python > 2.6')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99958:ImportFrom_L4_C4", "label": "from multiprocessing.managers import BaseManager", "type": "import", "loc": [4, 4], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99958:Try_L3_C0", "vector": [1, 1, 0.0227, 0.0057, 1, 0.29, 0.0, 70, 0, 1, 0, 0, 70, 0, 0], "semantic": {"name": "multiprocessing.managers", "arg_names": [], "import_names": ["BaseManager"], "rhs_call_name": "", "annotation": ""}, "snippet": " from multiprocessing.managers import BaseManager"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99958:ClassDef_L6_C4", "label": "Python26Required", "type": "class", "loc": [6, 10], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99958:Try_L3_C0", "vector": [3, 1, 0.0455, 0.0284, 1, 0.29, 0.0, 468, 0, 2, 0, 0, 186, 0, 2], "semantic": {"name": "Python26Required", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " class Python26Required(object):\n def __call__(self, *args):\n raise RuntimeError('Requires Python > 2.6')\n def __getattr__(self, name):\n raise RuntimeError('Requires Python > 2.6')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L7_C10", "label": "__call__", "type": "function", "loc": [7, 8], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99958:ClassDef_L6_C4", "vector": [2, 2, 0.0426, 0.0114, 2, 0.93, 0.0, 319, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__call__", "arg_names": ["self", "args"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __call__(self, *args):\n raise RuntimeError('Requires Python > 2.6')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L9_C10", "label": "__getattr__", "type": "function", "loc": [9, 10], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99958:ClassDef_L6_C4", "vector": [2, 2, 0.054, 0.0114, 2, 0.93, 1.0, 210, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__getattr__", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __getattr__(self, name):\n raise RuntimeError('Requires Python > 2.6')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99958:Assign_L11_C4", "label": "BaseManager = Python26Required()", "type": "assigned_variable", "loc": [11, 11], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99958:Try_L3_C0", "vector": [14, 1, 0.0625, 0.0057, 1, 0.29, 1.0, 729, 3, 0, 0, 0, 468, 10, 1], "semantic": {"name": "BaseManager", "arg_names": [], "import_names": [], "rhs_call_name": "Python26Required", "annotation": ""}, "snippet": " BaseManager = Python26Required()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99958:ClassDef_L13_C0", "label": "_create_caching_getter", "type": "class", "loc": [13, 22], "level": 0, "parent": null, "vector": [3, 0, 0.0994, 0.0568, 0, 0.66, 0.75, 711, 0, 2, 0, 0, 186, 0, 1], "semantic": {"name": "_create_caching_getter", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class _create_caching_getter(object):\n\n def __init__(self, clazz):\n self._clazz = clazz\n self._objects = {}\n\n def __call__(self, key):\n if key not in self._objects:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L15_C4", "label": "__init__", "type": "function", "loc": [15, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99958:ClassDef_L13_C0", "vector": [2, 1, 0.0909, 0.017, 1, 0.91, 0.0, 555, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "clazz"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, clazz):\n self._clazz = clazz\n self._objects = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99958:Assign_L16_C8", "label": "self._clazz =", "type": "assigned_variable", "loc": [16, 16], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L15_C4", "vector": [14, 2, 0.0909, 0.0057, 2, 0.34, 0.0, 204, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._clazz", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._clazz = clazz"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99958:Assign_L17_C8", "label": "self._objects =", "type": "assigned_variable", "loc": [17, 17], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L15_C4", "vector": [14, 2, 0.0966, 0.0057, 2, 0.34, 1.0, 7, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self._objects", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._objects = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L19_C4", "label": "__call__", "type": "function", "loc": [19, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99958:ClassDef_L13_C0", "vector": [2, 1, 0.1165, 0.0227, 1, 0.91, 1.0, 319, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "__call__", "arg_names": ["self", "key"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __call__(self, key):\n if key not in self._objects:\n self._objects[key] = self._clazz()\n return self._objects[key]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99958:If_L20_C8", "label": "if", "type": "if", "loc": [20, 21], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L19_C4", "vector": [4, 2, 0.1165, 0.0114, 2, 0.01, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if key not in self._objects:\n self._objects[key] = self._clazz()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99958:Assign_L21_C12", "label": " = _clazz()", "type": "assigned_variable", "loc": [21, 21], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99958:If_L20_C8", "vector": [14, 3, 0.1193, 0.0057, 3, 0.94, 0.0, 0, 3, 0, 0, 0, 167, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "_clazz", "annotation": ""}, "snippet": " self._objects[key] = self._clazz()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99958:Return_L22_C8", "label": "return", "type": "return", "loc": [22, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L19_C4", "vector": [13, 2, 0.125, 0.0057, 2, 0.01, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._objects[key]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99958:ClassDef_L24_C0", "label": "Communicate", "type": "class", "loc": [24, 175], "level": 0, "parent": null, "vector": [3, 0, 0.5653, 0.8636, 0, 0.66, 1.0, 420, 0, 11, 0, 0, 186, 0, 28], "semantic": {"name": "Communicate", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Communicate(object):\n \"\"\"Library for communication between processes.\n For example this can be used to handle communication between processes of the Parallel robot library.\n \n Requires Python 2.6\n \n Example:\n "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99958:Expr_L25_C4", "label": "expression", "type": "expression", "loc": [25, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99958:ClassDef_L24_C0", "vector": [8, 1, 0.2301, 0.1818, 1, 0.37, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Library for communication between processes.\n For example this can be used to handle communication between processes of the Parallel robot library.\n \n Requires Python 2.6\n \n Example:\n \n Process 1 test file:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L58_C4", "label": "__init__", "type": "function", "loc": [58, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99958:ClassDef_L24_C0", "vector": [2, 1, 0.3551, 0.0568, 1, 0.37, 0.0909, 555, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "address", "port"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, address='127.0.0.1', port=2187):\n \"\"\"\n `address` of the communication server.\n `port` of the communication server.\n \"\"\"\n self._address = address\n self._port = int(port)\n self._authkey = 'live long and prosper'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99958:Expr_L59_C8", "label": "expression", "type": "expression", "loc": [59, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L58_C4", "vector": [8, 2, 0.3438, 0.0227, 2, 0.99, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"\n `address` of the communication server.\n `port` of the communication server.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99958:Assign_L63_C8", "label": "self._address =", "type": "assigned_variable", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L58_C4", "vector": [14, 2, 0.358, 0.0057, 2, 0.99, 0.2, 824, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._address", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._address = address"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99958:Assign_L64_C8", "label": "self._port = int()", "type": "assigned_variable", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L58_C4", "vector": [14, 2, 0.3636, 0.0057, 2, 0.99, 0.4, 324, 3, 1, 0, 0, 901, 10, 1], "semantic": {"name": "self._port", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " self._port = int(port)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99958:Assign_L65_C8", "label": "self._authkey =", "type": "assigned_variable", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L58_C4", "vector": [14, 2, 0.3693, 0.0057, 2, 0.99, 0.6, 525, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self._authkey", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._authkey = 'live long and prosper'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99958:Assign_L66_C8", "label": "self._queue =", "type": "assigned_variable", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L58_C4", "vector": [14, 2, 0.375, 0.0057, 2, 0.99, 0.8, 544, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self._queue", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._queue = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99958:Assign_L67_C8", "label": "self._connected =", "type": "assigned_variable", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L58_C4", "vector": [14, 2, 0.3807, 0.0057, 2, 0.99, 1.0, 194, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self._connected", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._connected = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L69_C4", "label": "_connect", "type": "function", "loc": [69, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99958:ClassDef_L24_C0", "vector": [2, 1, 0.3977, 0.017, 1, 0.37, 0.1818, 394, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "_connect", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _connect(self):\n self._create_manager().connect()\n self._connected = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99958:Expr_L70_C8", "label": "connect()", "type": "expression", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L69_C4", "vector": [8, 2, 0.3977, 0.0057, 2, 0.48, 0.0, 242, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "connect", "arg_names": [], "import_names": [], "rhs_call_name": "connect", "annotation": ""}, "snippet": " self._create_manager().connect()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99958:Assign_L71_C8", "label": "self._connected =", "type": "assigned_variable", "loc": [71, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L69_C4", "vector": [14, 2, 0.4034, 0.0057, 2, 0.48, 1.0, 194, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self._connected", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._connected = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L73_C4", "label": "start_communication_service", "type": "function", "loc": [73, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99958:ClassDef_L24_C0", "vector": [2, 1, 0.429, 0.0341, 1, 0.37, 0.2727, 168, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "start_communication_service", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def start_communication_service(self):\n \"\"\"Starts a communication server that will be used to share messages and objects between processes.\n \"\"\"\n self._create_manager(_create_caching_getter(Queue),\n _create_caching_getter(Event)).start()\n self._connected = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99958:Expr_L74_C8", "label": "expression", "type": "expression", "loc": [74, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L73_C4", "vector": [8, 2, 0.4233, 0.0114, 2, 0.93, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Starts a communication server that will be used to share messages and objects between processes.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99958:Expr_L76_C8", "label": "start()", "type": "expression", "loc": [76, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L73_C4", "vector": [8, 2, 0.4347, 0.0114, 2, 0.93, 0.5, 511, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": " self._create_manager(_create_caching_getter(Queue),\n _create_caching_getter(Event)).start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99958:Assign_L78_C8", "label": "self._connected =", "type": "assigned_variable", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L73_C4", "vector": [14, 2, 0.4432, 0.0057, 2, 0.93, 1.0, 194, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self._connected", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._connected = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L80_C4", "label": "stop_communication_service", "type": "function", "loc": [80, 86], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99958:ClassDef_L24_C0", "vector": [2, 1, 0.4716, 0.0398, 1, 0.37, 0.3636, 446, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "stop_communication_service", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def stop_communication_service(self):\n \"\"\"Stops a started communication server. \n This ensures that the server and the messages that it has don't influence the next tests.\n To ensure that this keyword really happens place this in the teardown section.\n \"\"\"\n self._manager.shutdown()\n self._connected = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99958:Expr_L81_C8", "label": "expression", "type": "expression", "loc": [81, 84], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L80_C4", "vector": [8, 2, 0.4688, 0.0227, 2, 0.44, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Stops a started communication server. \n This ensures that the server and the messages that it has don't influence the next tests.\n To ensure that this keyword really happens place this in the teardown section.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99958:Expr_L85_C8", "label": "shutdown()", "type": "expression", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L80_C4", "vector": [8, 2, 0.483, 0.0057, 2, 0.44, 0.5, 322, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "shutdown", "arg_names": [], "import_names": [], "rhs_call_name": "shutdown", "annotation": ""}, "snippet": " self._manager.shutdown()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99958:Assign_L86_C8", "label": "self._connected =", "type": "assigned_variable", "loc": [86, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L80_C4", "vector": [14, 2, 0.4886, 0.0057, 2, 0.44, 1.0, 194, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self._connected", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._connected = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L88_C4", "label": "_create_manager", "type": "function", "loc": [88, 92], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99958:ClassDef_L24_C0", "vector": [2, 1, 0.5114, 0.0284, 1, 0.37, 0.4545, 869, 0, 3, 1, 0, 0, 0, 3], "semantic": {"name": "_create_manager", "arg_names": ["self", "queue_getter", "event_getter"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _create_manager(self, queue_getter=None, event_getter=None):\n BaseManager.register('get_queue', queue_getter)\n BaseManager.register('get_event', event_getter)\n self._manager = BaseManager((self._address, self._port), self._authkey)\n return self._manager"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99958:Expr_L89_C8", "label": "register()", "type": "expression", "loc": [89, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L88_C4", "vector": [8, 2, 0.5057, 0.0057, 2, 0.13, 0.0, 276, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "register", "arg_names": [], "import_names": [], "rhs_call_name": "register", "annotation": ""}, "snippet": " BaseManager.register('get_queue', queue_getter)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99958:Expr_L90_C8", "label": "register()", "type": "expression", "loc": [90, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L88_C4", "vector": [8, 2, 0.5114, 0.0057, 2, 0.13, 0.3333, 276, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "register", "arg_names": [], "import_names": [], "rhs_call_name": "register", "annotation": ""}, "snippet": " BaseManager.register('get_event', event_getter)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99958:Assign_L91_C8", "label": "self._manager = BaseManager()", "type": "assigned_variable", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L88_C4", "vector": [14, 2, 0.517, 0.0057, 2, 0.13, 0.6667, 176, 3, 2, 0, 0, 729, 10, 1], "semantic": {"name": "self._manager", "arg_names": [], "import_names": [], "rhs_call_name": "BaseManager", "annotation": ""}, "snippet": " self._manager = BaseManager((self._address, self._port), self._authkey)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99958:Return_L92_C8", "label": "return", "type": "return", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L88_C4", "vector": [13, 2, 0.5227, 0.0057, 2, 0.13, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._manager"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L94_C4", "label": "send_message_to", "type": "function", "loc": [94, 109], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99958:ClassDef_L24_C0", "vector": [2, 1, 0.5767, 0.0909, 1, 0.37, 0.5455, 869, 0, 3, 0, 0, 0, 0, 2], "semantic": {"name": "send_message_to", "arg_names": ["self", "queue_id", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def send_message_to(self, queue_id, value):\n \"\"\"Send a message to a message queue.\n\n `queue_id` is the identifier for the queue.\n\n `value` is the message. This can be a string, a number or any serializable object.\n\n Example:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99958:Expr_L95_C8", "label": "expression", "type": "expression", "loc": [95, 108], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L94_C4", "vector": [8, 2, 0.5767, 0.0795, 2, 0.34, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Send a message to a message queue.\n\n `queue_id` is the identifier for the queue.\n\n `value` is the message. This can be a string, a number or any serializable object.\n\n Example:\n In one process"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99958:Expr_L109_C8", "label": "put()", "type": "expression", "loc": [109, 109], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L94_C4", "vector": [8, 2, 0.6193, 0.0057, 2, 0.34, 1.0, 636, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "put", "arg_names": [], "import_names": [], "rhs_call_name": "put", "annotation": ""}, "snippet": " self._get_queue(queue_id).put(value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L111_C4", "label": "receive_message_from", "type": "function", "loc": [111, 130], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99958:ClassDef_L24_C0", "vector": [2, 1, 0.6847, 0.1136, 1, 0.37, 0.6364, 852, 0, 3, 1, 0, 0, 0, 3], "semantic": {"name": "receive_message_from", "arg_names": ["self", "queue_id", "timeout"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def receive_message_from(self, queue_id, timeout=None):\n \"\"\"Receive and consume a message from a message queue.\n By default this keyword will block until there is a message in the queue.\n\n `queue_id` is the identifier for the queue.\n\n `timeout` is the time out in seconds to wait.\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99958:Expr_L112_C8", "label": "expression", "type": "expression", "loc": [112, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L111_C4", "vector": [8, 2, 0.6818, 0.0966, 2, 0.7, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Receive and consume a message from a message queue.\n By default this keyword will block until there is a message in the queue.\n\n `queue_id` is the identifier for the queue.\n\n `timeout` is the time out in seconds to wait.\n\n Returns the value from the message queue. Fails if timeout expires."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99958:Assign_L129_C8", "label": "timeout =", "type": "assigned_variable", "loc": [129, 129], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L111_C4", "vector": [14, 2, 0.733, 0.0057, 2, 0.7, 0.5, 616, 8, 0, 0, 0, 0, 0, 1], "semantic": {"name": "timeout", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " timeout = float(timeout) if timeout is not None else None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99958:Return_L130_C8", "label": "return", "type": "return", "loc": [130, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L111_C4", "vector": [13, 2, 0.7386, 0.0057, 2, 0.7, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._get_queue(queue_id).get(timeout=timeout)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L132_C4", "label": "_get_queue", "type": "function", "loc": [132, 135], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99958:ClassDef_L24_C0", "vector": [2, 1, 0.7585, 0.0227, 1, 0.37, 0.7273, 281, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "_get_queue", "arg_names": ["self", "queue_id"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_queue(self, queue_id):\n if not self._connected:\n self._connect()\n return self._manager.get_queue(queue_id)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99958:If_L133_C8", "label": "if", "type": "if", "loc": [133, 134], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L132_C4", "vector": [4, 2, 0.7585, 0.0114, 2, 0.17, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self._connected:\n self._connect()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99958:Expr_L134_C12", "label": "_connect()", "type": "expression", "loc": [134, 134], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99958:If_L133_C8", "vector": [8, 3, 0.7614, 0.0057, 3, 0.71, 0.0, 394, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_connect", "arg_names": [], "import_names": [], "rhs_call_name": "_connect", "annotation": ""}, "snippet": " self._connect()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99958:Return_L135_C8", "label": "return", "type": "return", "loc": [135, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L132_C4", "vector": [13, 2, 0.767, 0.0057, 2, 0.17, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._manager.get_queue(queue_id)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L137_C4", "label": "wait_for_event", "type": "function", "loc": [137, 155], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99958:ClassDef_L24_C0", "vector": [2, 1, 0.8295, 0.108, 1, 0.37, 0.8182, 4, 0, 3, 0, 0, 0, 0, 6], "semantic": {"name": "wait_for_event", "arg_names": ["self", "event_id", "timeout"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def wait_for_event(self, event_id, timeout=None):\n \"\"\"Waits until event with `event_id` is signaled.\n Fails if optional timeout expires.\n\n `timeout` is the time out in seconds to wait.\n\n Example:\n In one process"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99958:Expr_L138_C8", "label": "expression", "type": "expression", "loc": [138, 149], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L137_C4", "vector": [8, 2, 0.8153, 0.0682, 2, 0.31, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Waits until event with `event_id` is signaled.\n Fails if optional timeout expires.\n\n `timeout` is the time out in seconds to wait.\n\n Example:\n In one process\n | Wait For Event | my event |"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99958:Assign_L150_C8", "label": "timeout =", "type": "assigned_variable", "loc": [150, 150], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L137_C4", "vector": [14, 2, 0.8523, 0.0057, 2, 0.31, 0.3333, 616, 8, 0, 0, 0, 0, 0, 1], "semantic": {"name": "timeout", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " timeout = float(timeout) if timeout is not None else None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99958:Expr_L151_C8", "label": "wait()", "type": "expression", "loc": [151, 151], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L137_C4", "vector": [8, 2, 0.858, 0.0057, 2, 0.31, 0.6667, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "wait", "arg_names": [], "import_names": [], "rhs_call_name": "wait", "annotation": ""}, "snippet": " self._get_event(event_id).wait(timeout=timeout)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99958:If_L154_C8", "label": "if", "type": "if", "loc": [154, 155], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L137_C4", "vector": [4, 2, 0.8778, 0.0114, 2, 0.31, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self._get_event(event_id).isSet():\n raise Exception('Timeout')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L157_C4", "label": "signal_event", "type": "function", "loc": [157, 170], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99958:ClassDef_L24_C0", "vector": [2, 1, 0.929, 0.0795, 1, 0.37, 0.9091, 247, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "signal_event", "arg_names": ["self", "event_id"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def signal_event(self, event_id):\n \"\"\"Signals an event.\n If a process is waiting for this event it will stop waiting after the signal.\n\n `event` is the identifier for the event.\n\n Example:\n In one process"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99958:Expr_L158_C8", "label": "expression", "type": "expression", "loc": [158, 169], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L157_C4", "vector": [8, 2, 0.929, 0.0682, 2, 0.95, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Signals an event.\n If a process is waiting for this event it will stop waiting after the signal.\n\n `event` is the identifier for the event.\n\n Example:\n In one process\n | Wait For Event | my event |"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99958:Return_L170_C8", "label": "return", "type": "return", "loc": [170, 170], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L157_C4", "vector": [13, 2, 0.9659, 0.0057, 2, 0.95, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._get_event(event_id).set()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L172_C4", "label": "_get_event", "type": "function", "loc": [172, 175], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99958:ClassDef_L24_C0", "vector": [2, 1, 0.9858, 0.0227, 1, 0.37, 1.0, 874, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "_get_event", "arg_names": ["self", "event_id"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _get_event(self, event_id):\n if not self._connected:\n self._connect()\n return self._manager.get_event(event_id)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99958:If_L173_C8", "label": "if", "type": "if", "loc": [173, 174], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L172_C4", "vector": [4, 2, 0.9858, 0.0114, 2, 0.09, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not self._connected:\n self._connect()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99958:Expr_L174_C12", "label": "_connect()", "type": "expression", "loc": [174, 174], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99958:If_L173_C8", "vector": [8, 3, 0.9886, 0.0057, 3, 0.07, 0.0, 394, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_connect", "arg_names": [], "import_names": [], "rhs_call_name": "_connect", "annotation": ""}, "snippet": " self._connect()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99958:Return_L175_C8", "label": "return", "type": "return", "loc": [175, 175], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L172_C4", "vector": [13, 2, 0.9943, 0.0057, 2, 0.09, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._manager.get_event(event_id)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99958:Try_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99958:ImportFrom_L4_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99958:Try_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99958:ClassDef_L6_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99958:ClassDef_L6_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L7_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99958:ClassDef_L6_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L9_C10"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99958:Try_L3_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99958:Assign_L11_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99958:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L15_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99958:Assign_L16_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L15_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99958:Assign_L17_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99958:ClassDef_L13_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99958:If_L20_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99958:If_L20_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99958:Assign_L21_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L19_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99958:Return_L22_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99958:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99958:Expr_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99958:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L58_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99958:Expr_L59_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99958:Assign_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99958:Assign_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99958:Assign_L65_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99958:Assign_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L58_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99958:Assign_L67_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99958:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99958:Expr_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L69_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99958:Assign_L71_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99958:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L73_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99958:Expr_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L73_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99958:Expr_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L73_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99958:Assign_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99958:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L80_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99958:Expr_L81_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L80_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99958:Expr_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L80_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99958:Assign_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99958:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L88_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L88_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99958:Expr_L89_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L88_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99958:Expr_L90_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L88_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99958:Assign_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L88_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99958:Return_L92_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99958:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L94_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L94_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99958:Expr_L95_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L94_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99958:Expr_L109_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99958:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L111_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99958:Expr_L112_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99958:Assign_L129_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99958:Return_L130_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99958:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L132_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L132_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99958:If_L133_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99958:If_L133_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99958:Expr_L134_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L132_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99958:Return_L135_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99958:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L137_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L137_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99958:Expr_L138_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L137_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99958:Assign_L150_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L137_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99958:Expr_L151_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L137_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99958:If_L154_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99958:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L157_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L157_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99958:Expr_L158_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L157_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99958:Return_L170_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99958:ClassDef_L24_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L172_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L172_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99958:If_L173_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99958:If_L173_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99958:Expr_L174_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99958:FunctionDef_L172_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99958:Return_L175_C8"}] |
# -*- python -*-
# ex: set syntax=python:
import os
ROBOT_FRAMEWORK_REPOSITORY = 'http://robotframework.googlecode.com/svn/trunk/'
# This is the dictionary that the buildmaster pays attention to. We also use
# a shorter alias to save typing.
c = BuildmasterConfig = {}
####### BUILDSLAVES
from buildbot.buildslave import BuildSlave
c['slaves'] = [BuildSlave("debian-py2.4", "robotci")]
c['slavePortnum'] = 9989
####### CHANGESOURCES
from buildbot.changes.svnpoller import SVNPoller
c['change_source'] = SVNPoller(ROBOT_FRAMEWORK_REPOSITORY, pollinterval=180)
####### SCHEDULERS
from buildbot.scheduler import Scheduler
c['schedulers'] = []
c['schedulers'].append(Scheduler(name="all", branch=None, treeStableTimer=180,
builderNames=["PybotTests"]))
####### BUILDERS
# the 'builders' list defines the Builders. Each one is configured with a
# dictionary, using the following keys:
# name (required): the name used to describe this bilder
# slavename (required): which slave to use, must appear in c['bots']
# builddir (required): which subdirectory to run the builder in
# factory (required): a BuildFactory to define how the build is run
# periodicBuildTime (optional): if set, force a build every N seconds
from buildbot.process import factory
from buildbot.steps.source import SVN
from buildbot.steps.shell import ShellCommand
from buildbot.steps.master import MasterShellCommand
from buildbot.steps.transfer import FileUpload
import glob
OUTPUT_ARCHIVE = 'outputs.zip'
RESULT_DIR = 'results'
class ReportGenerator(MasterShellCommand):
def __init__(self, **kwargs):
command = ['./generate_reports.sh', RESULT_DIR]
MasterShellCommand.__init__(self, command)
self.addFactoryArguments(command=command)
def finished(self, results):
report = open(RESULT_DIR + '/report.html').read().replace('<a href="log.html',
'<a href="log')
self.addHTMLLog('report', report)
self.addHTMLLog('log', open(RESULT_DIR + '/log.html').read())
for sublog in sorted(glob.glob(RESULT_DIR + '/log-*.html')):
self.addHTMLLog(os.path.basename(sublog), open(sublog).read())
return MasterShellCommand.finished(self, results)
f1 = factory.BuildFactory()
f1.addStep(SVN(svnurl=ROBOT_FRAMEWORK_REPOSITORY))
f1.addStep(ShellCommand(command=['python', './install.py', 'in'],
description='Installing',
descriptionDone='Install'))
f1.addStep(ShellCommand(command=['atest/run_atests.py', 'buildbot', 'python',
'--monitorcolors off',
'--exclude manual',
'atest/robot/'],
description='Robot Tests',
descriptionDone='Robot Tests',
timeout=60*60))
f1.addStep(FileUpload(slavesrc='atest/results/' + OUTPUT_ARCHIVE,
masterdest=RESULT_DIR +'/'+ OUTPUT_ARCHIVE))
f1.addStep(ReportGenerator())
b1 = {'name': "PybotTests",
'slavename': "debian-py2.4",
'builddir': "pybot-build",
'factory': f1}
c['builders'] = [b1]
####### STATUS TARGETS
from buildbot.status import html
c['status'] = []
c['status'].append(html.WebStatus(http_port=8010))
from buildbot.status import mail
c['status'].append(mail.MailNotifier(fromaddr="buildbot@robot.radiaatto.ri.fi",
extraRecipients=["robotframework-commit@googlegroups.com"],
sendToInterestedUsers=False,
relayhost='10.127.0.12'))
#
# from buildbot.status import words
# c['status'].append(words.IRC(host="irc.example.com", nick="bb",
# channels=["#example"]))
#
# from buildbot.status import client
# c['status'].append(client.PBListener(9988))
####### DEBUGGING OPTIONS
# if you set 'debugPassword', then you can connect to the buildmaster with
# the diagnostic tool in contrib/debugclient.py . From this tool, you can
# manually force builds and inject changes, which may be useful for testing
# your buildmaster without actually commiting changes to your repository (or
# before you have a functioning 'sources' set up). The debug tool uses the
# same port number as the slaves do: 'slavePortnum'.
c['debugPassword'] = "passwd"
# if you set 'manhole', you can ssh into the buildmaster and get an
# interactive python shell, which may be useful for debugging buildbot
# internals. It is probably only useful for buildbot developers. You can also
# use an authorized_keys file, or plain telnet.
#from buildbot import manhole
#c['manhole'] = manhole.PasswordManhole("tcp:9999:interface=127.0.0.1",
# "admin", "password")
####### PROJECT IDENTITY
# the 'projectName' string will be used to describe the project that this
# buildbot is working on. For example, it is used as the title of the
# waterfall HTML page. The 'projectURL' string will be used to provide a link
# from buildbot HTML pages to your project's home page.
c['projectName'] = "Robot Framework"
c['projectURL'] = "http://robotframework.org/"
# the 'buildbotURL' string should point to the location where the buildbot's
# internal web server (usually the html.Waterfall page) is visible. This
# typically uses the port number set in the Waterfall 'status' entry, but
# with an externally-visible host name which the buildbot cannot figure out
# without some help.
c['buildbotURL'] = "http://robot.radiaatto.ri.fi:8080/"
| ajibawa-2023/Python-Code-Large/train/row_99959 | 48 | 141 | 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_99959:Import_L3_C0", "label": "os import os", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0213, 0.0071, 0, 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_99959:Assign_L5_C0", "label": "ROBOT_FRAMEWORK_REPOSITORY =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.0355, 0.0071, 0, 0.66, 0.0278, 358, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ROBOT_FRAMEWORK_REPOSITORY", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "ROBOT_FRAMEWORK_REPOSITORY = 'http://robotframework.googlecode.com/svn/trunk/'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99959:Assign_L8_C0", "label": "c =", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.0567, 0.0071, 0, 0.66, 0.0556, 411, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "c", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "c = BuildmasterConfig = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99959:ImportFrom_L11_C0", "label": "from buildbot.buildslave import BuildSlave", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.078, 0.0071, 0, 0.66, 0.0833, 425, 0, 1, 0, 0, 425, 0, 0], "semantic": {"name": "buildbot.buildslave", "arg_names": [], "import_names": ["BuildSlave"], "rhs_call_name": "", "annotation": ""}, "snippet": "from buildbot.buildslave import BuildSlave"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99959:Assign_L12_C0", "label": "assign", "type": "assigned_variable", "loc": [12, 12], "level": 0, "parent": null, "vector": [14, 0, 0.0851, 0.0071, 0, 0.66, 0.1111, 0, 0, 0, 0, 0, 0, 5, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "c['slaves'] = [BuildSlave(\"debian-py2.4\", \"robotci\")]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99959:Assign_L13_C0", "label": "assign", "type": "assigned_variable", "loc": [13, 13], "level": 0, "parent": null, "vector": [14, 0, 0.0922, 0.0071, 0, 0.66, 0.1389, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "c['slavePortnum'] = 9989"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99959:ImportFrom_L16_C0", "label": "from buildbot.changes.svnpoller import SVNPoller", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.1135, 0.0071, 0, 0.66, 0.1667, 382, 0, 1, 0, 0, 382, 0, 0], "semantic": {"name": "buildbot.changes.svnpoller", "arg_names": [], "import_names": ["SVNPoller"], "rhs_call_name": "", "annotation": ""}, "snippet": "from buildbot.changes.svnpoller import SVNPoller"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99959:Assign_L17_C0", "label": " = SVNPoller()", "type": "assigned_variable", "loc": [17, 17], "level": 0, "parent": null, "vector": [14, 0, 0.1206, 0.0071, 0, 0.66, 0.1944, 0, 3, 2, 0, 0, 346, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "SVNPoller", "annotation": ""}, "snippet": "c['change_source'] = SVNPoller(ROBOT_FRAMEWORK_REPOSITORY, pollinterval=180)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99959:ImportFrom_L20_C0", "label": "from buildbot.scheduler import Scheduler", "type": "import", "loc": [20, 20], "level": 0, "parent": null, "vector": [1, 0, 0.1418, 0.0071, 0, 0.66, 0.2222, 490, 0, 1, 0, 0, 490, 0, 0], "semantic": {"name": "buildbot.scheduler", "arg_names": [], "import_names": ["Scheduler"], "rhs_call_name": "", "annotation": ""}, "snippet": "from buildbot.scheduler import Scheduler"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99959:Assign_L21_C0", "label": "assign", "type": "assigned_variable", "loc": [21, 21], "level": 0, "parent": null, "vector": [14, 0, 0.1489, 0.0071, 0, 0.66, 0.25, 0, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "c['schedulers'] = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99959:Expr_L22_C0", "label": "append()", "type": "expression", "loc": [22, 23], "level": 0, "parent": null, "vector": [8, 0, 0.1596, 0.0142, 0, 0.66, 0.2778, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": "c['schedulers'].append(Scheduler(name=\"all\", branch=None, treeStableTimer=180,\n builderNames=[\"PybotTests\"]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99959:ImportFrom_L35_C0", "label": "from buildbot.process import factory", "type": "import", "loc": [35, 35], "level": 0, "parent": null, "vector": [1, 0, 0.2482, 0.0071, 0, 0.66, 0.3056, 586, 0, 1, 0, 0, 586, 0, 0], "semantic": {"name": "buildbot.process", "arg_names": [], "import_names": ["factory"], "rhs_call_name": "", "annotation": ""}, "snippet": "from buildbot.process import factory"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99959:ImportFrom_L36_C0", "label": "from buildbot.steps.source import SVN", "type": "import", "loc": [36, 36], "level": 0, "parent": null, "vector": [1, 0, 0.2553, 0.0071, 0, 0.66, 0.3333, 697, 0, 1, 0, 0, 697, 0, 0], "semantic": {"name": "buildbot.steps.source", "arg_names": [], "import_names": ["SVN"], "rhs_call_name": "", "annotation": ""}, "snippet": "from buildbot.steps.source import SVN"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99959:ImportFrom_L37_C0", "label": "from buildbot.steps.shell import ShellCommand", "type": "import", "loc": [37, 37], "level": 0, "parent": null, "vector": [1, 0, 0.2624, 0.0071, 0, 0.66, 0.3611, 418, 0, 1, 0, 0, 418, 0, 0], "semantic": {"name": "buildbot.steps.shell", "arg_names": [], "import_names": ["ShellCommand"], "rhs_call_name": "", "annotation": ""}, "snippet": "from buildbot.steps.shell import ShellCommand"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99959:ImportFrom_L38_C0", "label": "from buildbot.steps.master import MasterShellCommand", "type": "import", "loc": [38, 38], "level": 0, "parent": null, "vector": [1, 0, 0.2695, 0.0071, 0, 0.66, 0.3889, 153, 0, 1, 0, 0, 153, 0, 0], "semantic": {"name": "buildbot.steps.master", "arg_names": [], "import_names": ["MasterShellCommand"], "rhs_call_name": "", "annotation": ""}, "snippet": "from buildbot.steps.master import MasterShellCommand"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99959:ImportFrom_L39_C0", "label": "from buildbot.steps.transfer import FileUpload", "type": "import", "loc": [39, 39], "level": 0, "parent": null, "vector": [1, 0, 0.2766, 0.0071, 0, 0.66, 0.4167, 40, 0, 1, 0, 0, 40, 0, 0], "semantic": {"name": "buildbot.steps.transfer", "arg_names": [], "import_names": ["FileUpload"], "rhs_call_name": "", "annotation": ""}, "snippet": "from buildbot.steps.transfer import FileUpload"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99959:Import_L40_C0", "label": "glob import glob", "type": "import", "loc": [40, 40], "level": 0, "parent": null, "vector": [1, 0, 0.2837, 0.0071, 0, 0.66, 0.4444, 958, 0, 1, 0, 0, 958, 0, 0], "semantic": {"name": "glob", "arg_names": [], "import_names": ["glob"], "rhs_call_name": "", "annotation": ""}, "snippet": "import glob"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99959:Assign_L42_C0", "label": "OUTPUT_ARCHIVE =", "type": "assigned_variable", "loc": [42, 42], "level": 0, "parent": null, "vector": [14, 0, 0.2979, 0.0071, 0, 0.66, 0.4722, 626, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "OUTPUT_ARCHIVE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "OUTPUT_ARCHIVE = 'outputs.zip'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99959:Assign_L43_C0", "label": "RESULT_DIR =", "type": "assigned_variable", "loc": [43, 43], "level": 0, "parent": null, "vector": [14, 0, 0.305, 0.0071, 0, 0.66, 0.5, 36, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "RESULT_DIR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "RESULT_DIR = 'results'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99959:ClassDef_L45_C0", "label": "ReportGenerator", "type": "class", "loc": [45, 59], "level": 0, "parent": null, "vector": [3, 0, 0.3688, 0.1064, 0, 0.66, 0.5278, 654, 0, 2, 0, 0, 911, 0, 16], "semantic": {"name": "ReportGenerator", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ReportGenerator(MasterShellCommand):\n \n def __init__(self, **kwargs):\n command = ['./generate_reports.sh', RESULT_DIR]\n MasterShellCommand.__init__(self, command)\n self.addFactoryArguments(command=command)\n\n def finished(self, results):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99959:FunctionDef_L47_C4", "label": "__init__", "type": "function", "loc": [47, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99959:ClassDef_L45_C0", "vector": [2, 1, 0.344, 0.0284, 1, 0.86, 0.0, 555, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "kwargs"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, **kwargs):\n command = ['./generate_reports.sh', RESULT_DIR]\n MasterShellCommand.__init__(self, command)\n self.addFactoryArguments(command=command)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99959:Assign_L48_C8", "label": "command =", "type": "assigned_variable", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99959:FunctionDef_L47_C4", "vector": [14, 2, 0.3404, 0.0071, 2, 0.63, 0.0, 842, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "command", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " command = ['./generate_reports.sh', RESULT_DIR]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99959:Expr_L49_C8", "label": "__init__()", "type": "expression", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99959:FunctionDef_L47_C4", "vector": [8, 2, 0.3475, 0.0071, 2, 0.63, 0.5, 555, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " MasterShellCommand.__init__(self, command)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99959:Expr_L50_C8", "label": "addFactoryArguments()", "type": "expression", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99959:FunctionDef_L47_C4", "vector": [8, 2, 0.3546, 0.0071, 2, 0.63, 1.0, 293, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "addFactoryArguments", "arg_names": [], "import_names": [], "rhs_call_name": "addFactoryArguments", "annotation": ""}, "snippet": " self.addFactoryArguments(command=command)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99959:FunctionDef_L52_C4", "label": "finished", "type": "function", "loc": [52, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99959:ClassDef_L45_C0", "vector": [2, 1, 0.3936, 0.0567, 1, 0.86, 1.0, 145, 0, 2, 1, 0, 0, 0, 14], "semantic": {"name": "finished", "arg_names": ["self", "results"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def finished(self, results):\n report = open(RESULT_DIR + '/report.html').read().replace('<a href=\"log.html', \n '<a href=\"log')\n self.addHTMLLog('report', report)\n self.addHTMLLog('log', open(RESULT_DIR + '/log.html').read())\n for sublog in sorted(glob.glob(RESULT_DIR + '/log-*.html')):\n self.addHTMLLog(os.path.basename(sublog), open(sublog).read())\n return MasterShellCommand.finished(self, results)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99959:Assign_L53_C8", "label": "report = replace()", "type": "assigned_variable", "loc": [53, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99959:FunctionDef_L52_C4", "vector": [14, 2, 0.3794, 0.0142, 2, 0.53, 0.0, 57, 3, 2, 0, 0, 293, 10, 3], "semantic": {"name": "report", "arg_names": [], "import_names": [], "rhs_call_name": "replace", "annotation": ""}, "snippet": " report = open(RESULT_DIR + '/report.html').read().replace('<a href=\"log.html', \n '<a href=\"log')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99959:Expr_L55_C8", "label": "addHTMLLog()", "type": "expression", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99959:FunctionDef_L52_C4", "vector": [8, 2, 0.3901, 0.0071, 2, 0.53, 0.25, 146, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "addHTMLLog", "arg_names": [], "import_names": [], "rhs_call_name": "addHTMLLog", "annotation": ""}, "snippet": " self.addHTMLLog('report', report)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99959:Expr_L56_C8", "label": "addHTMLLog()", "type": "expression", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99959:FunctionDef_L52_C4", "vector": [8, 2, 0.3972, 0.0071, 2, 0.53, 0.5, 146, 3, 2, 0, 0, 0, 0, 3], "semantic": {"name": "addHTMLLog", "arg_names": [], "import_names": [], "rhs_call_name": "addHTMLLog", "annotation": ""}, "snippet": " self.addHTMLLog('log', open(RESULT_DIR + '/log.html').read())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99959:For_L57_C8", "label": "for sublog", "type": "for", "loc": [57, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99959:FunctionDef_L52_C4", "vector": [6, 2, 0.4078, 0.0142, 2, 0.53, 0.75, 257, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "sublog", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for sublog in sorted(glob.glob(RESULT_DIR + '/log-*.html')):\n self.addHTMLLog(os.path.basename(sublog), open(sublog).read())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99959:Expr_L58_C12", "label": "addHTMLLog()", "type": "expression", "loc": [58, 58], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99959:For_L57_C8", "vector": [8, 3, 0.4113, 0.0071, 3, 0.94, 0.0, 146, 3, 2, 0, 0, 0, 0, 4], "semantic": {"name": "addHTMLLog", "arg_names": [], "import_names": [], "rhs_call_name": "addHTMLLog", "annotation": ""}, "snippet": " self.addHTMLLog(os.path.basename(sublog), open(sublog).read())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99959:Return_L59_C8", "label": "return", "type": "return", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99959:FunctionDef_L52_C4", "vector": [13, 2, 0.4184, 0.0071, 2, 0.53, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return MasterShellCommand.finished(self, results)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99959:Assign_L62_C0", "label": "f1 = BuildFactory()", "type": "assigned_variable", "loc": [62, 62], "level": 0, "parent": null, "vector": [14, 0, 0.4397, 0.0071, 0, 0.66, 0.5556, 282, 3, 0, 0, 0, 983, 10, 1], "semantic": {"name": "f1", "arg_names": [], "import_names": [], "rhs_call_name": "BuildFactory", "annotation": ""}, "snippet": "f1 = factory.BuildFactory()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99959:Expr_L63_C0", "label": "addStep()", "type": "expression", "loc": [63, 63], "level": 0, "parent": null, "vector": [8, 0, 0.4468, 0.0071, 0, 0.66, 0.5833, 868, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "addStep", "arg_names": [], "import_names": [], "rhs_call_name": "addStep", "annotation": ""}, "snippet": "f1.addStep(SVN(svnurl=ROBOT_FRAMEWORK_REPOSITORY))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99959:Expr_L64_C0", "label": "addStep()", "type": "expression", "loc": [64, 66], "level": 0, "parent": null, "vector": [8, 0, 0.461, 0.0213, 0, 0.66, 0.6111, 868, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "addStep", "arg_names": [], "import_names": [], "rhs_call_name": "addStep", "annotation": ""}, "snippet": "f1.addStep(ShellCommand(command=['python', './install.py', 'in'], \n\t\t\t\t description='Installing', \n\t\t\t\t descriptionDone='Install'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99959:Expr_L67_C0", "label": "addStep()", "type": "expression", "loc": [67, 73], "level": 0, "parent": null, "vector": [8, 0, 0.4965, 0.0496, 0, 0.66, 0.6389, 868, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "addStep", "arg_names": [], "import_names": [], "rhs_call_name": "addStep", "annotation": ""}, "snippet": "f1.addStep(ShellCommand(command=['atest/run_atests.py', 'buildbot', 'python', \n\t\t\t\t '--monitorcolors off', \n '--exclude manual',\n 'atest/robot/'],\n description='Robot Tests',\n\t\t\t\t descriptionDone='Robot Tests',\n timeout=60*60))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99959:Expr_L74_C0", "label": "addStep()", "type": "expression", "loc": [74, 75], "level": 0, "parent": null, "vector": [8, 0, 0.5284, 0.0142, 0, 0.66, 0.6667, 868, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "addStep", "arg_names": [], "import_names": [], "rhs_call_name": "addStep", "annotation": ""}, "snippet": "f1.addStep(FileUpload(slavesrc='atest/results/' + OUTPUT_ARCHIVE, \n masterdest=RESULT_DIR +'/'+ OUTPUT_ARCHIVE))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99959:Expr_L76_C0", "label": "addStep()", "type": "expression", "loc": [76, 76], "level": 0, "parent": null, "vector": [8, 0, 0.539, 0.0071, 0, 0.66, 0.6944, 868, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "addStep", "arg_names": [], "import_names": [], "rhs_call_name": "addStep", "annotation": ""}, "snippet": "f1.addStep(ReportGenerator())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99959:Assign_L78_C0", "label": "b1 =", "type": "assigned_variable", "loc": [78, 81], "level": 0, "parent": null, "vector": [14, 0, 0.5638, 0.0284, 0, 0.66, 0.7222, 341, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "b1", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "b1 = {'name': \"PybotTests\",\n 'slavename': \"debian-py2.4\",\n 'builddir': \"pybot-build\",\n 'factory': f1}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99959:Assign_L82_C0", "label": "assign", "type": "assigned_variable", "loc": [82, 82], "level": 0, "parent": null, "vector": [14, 0, 0.5816, 0.0071, 0, 0.66, 0.75, 0, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "c['builders'] = [b1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99959:ImportFrom_L87_C0", "label": "from buildbot.status import html", "type": "import", "loc": [87, 87], "level": 0, "parent": null, "vector": [1, 0, 0.617, 0.0071, 0, 0.66, 0.7778, 325, 0, 1, 0, 0, 325, 0, 0], "semantic": {"name": "buildbot.status", "arg_names": [], "import_names": ["html"], "rhs_call_name": "", "annotation": ""}, "snippet": "from buildbot.status import html"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99959:Assign_L88_C0", "label": "assign", "type": "assigned_variable", "loc": [88, 88], "level": 0, "parent": null, "vector": [14, 0, 0.6241, 0.0071, 0, 0.66, 0.8056, 0, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "c['status'] = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99959:Expr_L89_C0", "label": "append()", "type": "expression", "loc": [89, 89], "level": 0, "parent": null, "vector": [8, 0, 0.6312, 0.0071, 0, 0.66, 0.8333, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": "c['status'].append(html.WebStatus(http_port=8010))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99959:ImportFrom_L91_C0", "label": "from buildbot.status import mail", "type": "import", "loc": [91, 91], "level": 0, "parent": null, "vector": [1, 0, 0.6454, 0.0071, 0, 0.66, 0.8611, 325, 0, 1, 0, 0, 325, 0, 0], "semantic": {"name": "buildbot.status", "arg_names": [], "import_names": ["mail"], "rhs_call_name": "", "annotation": ""}, "snippet": "from buildbot.status import mail"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99959:Expr_L92_C0", "label": "append()", "type": "expression", "loc": [92, 95], "level": 0, "parent": null, "vector": [8, 0, 0.6631, 0.0284, 0, 0.66, 0.8889, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": "c['status'].append(mail.MailNotifier(fromaddr=\"buildbot@robot.radiaatto.ri.fi\",\n extraRecipients=[\"robotframework-commit@googlegroups.com\"],\n sendToInterestedUsers=False,\n\t\t\t\t relayhost='10.127.0.12'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99959:Assign_L114_C0", "label": "assign", "type": "assigned_variable", "loc": [114, 114], "level": 0, "parent": null, "vector": [14, 0, 0.8085, 0.0071, 0, 0.66, 0.9167, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "c['debugPassword'] = \"passwd\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99959:Assign_L132_C0", "label": "assign", "type": "assigned_variable", "loc": [132, 132], "level": 0, "parent": null, "vector": [14, 0, 0.9362, 0.0071, 0, 0.66, 0.9444, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "c['projectName'] = \"Robot Framework\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99959:Assign_L133_C0", "label": "assign", "type": "assigned_variable", "loc": [133, 133], "level": 0, "parent": null, "vector": [14, 0, 0.9433, 0.0071, 0, 0.66, 0.9722, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "c['projectURL'] = \"http://robotframework.org/\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99959:Assign_L141_C0", "label": "assign", "type": "assigned_variable", "loc": [141, 141], "level": 0, "parent": null, "vector": [14, 0, 1.0, 0.0071, 0, 0.66, 1.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "c['buildbotURL'] = \"http://robot.radiaatto.ri.fi:8080/\""}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99959:ClassDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99959:FunctionDef_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99959:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99959:Assign_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99959:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99959:Expr_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99959:FunctionDef_L47_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99959:Expr_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99959:ClassDef_L45_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99959:FunctionDef_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99959:FunctionDef_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99959:Assign_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99959:FunctionDef_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99959:Expr_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99959:FunctionDef_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99959:Expr_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99959:FunctionDef_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99959:For_L57_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99959:For_L57_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99959:Expr_L58_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99959:FunctionDef_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99959:Return_L59_C8"}] |
from javax.swing import JFrame, JList, JPanel, JLabel, JTextField, JButton, Box, BoxLayout, JTable
from javax.swing.event import ListSelectionListener
from javax.swing.table import AbstractTableModel
from java.awt.event import ActionListener
from java.awt import FlowLayout, BorderLayout, Dimension, Font, Color
class VacalcFrame(object):
def __init__(self, employees):
self._frame = JFrame('Vacation Calculator',
defaultCloseOperation=JFrame.EXIT_ON_CLOSE)
self._frame.setContentPane(self._create_ui(employees))
self._frame.pack()
def _create_ui(self, employees):
panel = JPanel(layout=FlowLayout())
self._overview = EmployeeOverview(employees, self)
self._details = EmployeeDetails(employees)
self._welcome = Welcome()
panel.add(self._overview)
panel.add(self._welcome)
return panel
def show(self):
self._frame.setVisible(True)
def employee_selected(self, employee):
self._ensure_details_shown()
self._details.show_employee(employee)
def edit_new_employee(self):
self._ensure_details_shown()
self._details.edit_new_employee()
def _ensure_details_shown(self):
if self._welcome:
self._frame.contentPane.remove(self._welcome)
self._frame.contentPane.add(self._details)
self._frame.pack()
self._welcome = None
class EmployeeOverview(JPanel):
def __init__(self, employees, overview_listener):
JPanel.__init__(self, layout=BorderLayout())
self._listener = overview_listener
self._employee_list = self._create_employee_list(employees)
new_emp_btn = self._create_new_employee_button()
self.add(self._employee_list.widget, BorderLayout.PAGE_START)
self.add(new_emp_btn, BorderLayout.PAGE_END)
def _create_employee_list(self, employees):
list = EmployeeList(employees)
list.add_selection_listener(ListenerFactory(ListSelectionListener,
self._list_item_selected))
return list
def _create_new_employee_button(self):
btn = JButton('New Employee', name='new_employee_button')
btn.addActionListener(ListenerFactory(ActionListener, self._new_employee))
return btn
def _list_item_selected(self, event):
self._listener.employee_selected(self._employee_list.selected_employee())
def _new_employee(self, event):
self._employee_list.clear_selection()
self._listener.edit_new_employee()
class EmployeeList(object):
def __init__(self, employees):
self._employees = employees
self._employees.add_change_listener(self)
self._list = JList(preferredSize=(200, 200), name='employee_list')
self._populate_list()
def _populate_list(self):
self._list.setListData(self._employee_names())
def _employee_names(self):
return [e.name for e in self._employees.all()]
def add_selection_listener(self, listener):
self._list.addListSelectionListener(listener)
def selected_employee(self):
return self._employees.all()[self._list.getSelectedIndex()]
def employee_added(self, employee):
self._populate_list()
self._list.setSelectedValue(employee.name, True)
def adding_employee_failed(self, error):
pass
def clear_selection(self):
self._list.clearSelection()
@property
def widget(self):
return self._list
class EmployeeDetails(JPanel):
def __init__(self, employees):
JPanel.__init__(self, preferredSize=(400, 200))
layout = BoxLayout(self, BoxLayout.Y_AXIS)
self.setLayout(layout)
self._employees = employees
employees.add_change_listener(self)
self._create_status_label()
self._create_name_editor()
self._create_start_date_editor()
self._create_save_button()
self._create_vacation_display()
self._adding_employee = False
def _create_status_label(self):
self._status_label = JLabel(name='status_label',
font=Font(Font.SANS_SERIF, Font.PLAIN, 11))
self.add(self._status_label)
self._add_with_padding(self._status_label, 5)
def _create_name_editor(self):
self.add(JLabel(text='Employee Name:'))
self._name_editor = FixedHeightTextField('name_input')
self._add_with_padding(self._name_editor, 5)
def _create_start_date_editor(self):
self.add(JLabel(text='Start Date (yyyy-mm-dd):'))
self._start_date_editor = FixedHeightTextField('start_input')
self._add_with_padding(self._start_date_editor, 5)
def _create_save_button(self):
self._save_button = JButton('Save', name='save_button', visible=False)
self._save_button.addActionListener(ListenerFactory(ActionListener,
self._save_button_pushed))
self._add_with_padding(self._save_button, 5)
def _create_vacation_display(self):
# self._display = JTable()
# self._header = self._display.getTableHeader()
# self.add(self._header)
# self.add(self._display)
pass
def _add_with_padding(self, component, padding):
self.add(component)
self.add(Box.createRigidArea(Dimension(0, padding)))
def show_employee(self, employee):
self._name_editor.setText(employee.name)
self._start_date_editor.setText(str(employee.startdate))
self._name_editor.setEditable(False)
self._start_date_editor.setEditable(False)
self._save_button.setVisible(False)
if self._adding_employee:
self._adding_employee = False
else:
self._status_label.setText('')
# self._display.setVisible(True)
# self._display.setModel(VacationTableModel(employee))
# self._header.setVisible(True)
def edit_new_employee(self):
self._name_editor.setText('')
self._start_date_editor.setText('')
self._name_editor.setEditable(True)
self._start_date_editor.setEditable(True)
self._save_button.setVisible(True)
# self._display.setVisible(False)
# self._header.setVisible(False)
self._adding_employee = True
def _save_button_pushed(self, event):
self._employees.add(self._name_editor.getText(),
self._start_date_editor.getText())
def employee_added(self, employee):
self._status_label.setForeground(Color.BLACK)
self._status_label.setText("Employee '%s' was added successfully." % employee.name)
self._save_button.setVisible(False)
def adding_employee_failed(self, reason):
self._status_label.setForeground(Color.RED)
self._status_label.setText(reason)
class FixedHeightTextField(JTextField):
def __init__(self, name):
JTextField.__init__(self, name=name)
prefsize = self.preferredSize
maxsize = self.maximumSize
self.setMaximumSize(Dimension(maxsize.width, prefsize.height))
class Welcome(JPanel):
def __init__(self):
JPanel.__init__(self, preferredSize=(400,200))
self.add(JLabel('VaCalc v0.1'))
class VacationTableModel(AbstractTableModel):
_columns = ['Year', 'Vacation']
def __init__(self, employee):
self._employee = employee
def getColumnName(self, index):
return self._columns[index]
def getColumnCount(self):
return 2
def getRowCount(self):
return 1
def getValueAt(self, row, col):
if col == 0:
return '2010'
return '%s days' % self._employee.count_vacation(2010)
def ListenerFactory(interface, func):
from java.lang import Object
method = list(set(dir(interface)) - set(dir(Object)))[0]
return type('Listener', (interface,), {method: func})()
| ajibawa-2023/Python-Code-Large/train/row_99963 | 161 | 234 | 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_99963:ImportFrom_L1_C0", "label": "from javax.swing import JFrame, JList, JPanel\u2026", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0043, 0.0043, 0, 0.66, 0.0, 828, 0, 9, 0, 0, 828, 0, 0], "semantic": {"name": "javax.swing", "arg_names": [], "import_names": ["JFrame", "JList", "JPanel", "JLabel", "JTextField", "JButton", "Box", "BoxLayout", "JTable"], "rhs_call_name": "", "annotation": ""}, "snippet": "from javax.swing import JFrame, JList, JPanel, JLabel, JTextField, JButton, Box, BoxLayout, JTable"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:ImportFrom_L2_C0", "label": "from javax.swing.event import ListSelectionListener", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0085, 0.0043, 0, 0.66, 0.0833, 182, 0, 1, 0, 0, 182, 0, 0], "semantic": {"name": "javax.swing.event", "arg_names": [], "import_names": ["ListSelectionListener"], "rhs_call_name": "", "annotation": ""}, "snippet": "from javax.swing.event import ListSelectionListener"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:ImportFrom_L3_C0", "label": "from javax.swing.table import AbstractTableModel", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0128, 0.0043, 0, 0.66, 0.1667, 234, 0, 1, 0, 0, 234, 0, 0], "semantic": {"name": "javax.swing.table", "arg_names": [], "import_names": ["AbstractTableModel"], "rhs_call_name": "", "annotation": ""}, "snippet": "from javax.swing.table import AbstractTableModel"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:ImportFrom_L4_C0", "label": "from java.awt.event import ActionListener", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0171, 0.0043, 0, 0.66, 0.25, 719, 0, 1, 0, 0, 719, 0, 0], "semantic": {"name": "java.awt.event", "arg_names": [], "import_names": ["ActionListener"], "rhs_call_name": "", "annotation": ""}, "snippet": "from java.awt.event import ActionListener"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:ImportFrom_L5_C0", "label": "from java.awt import FlowLayout, BorderLayout, Dimension\u2026", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0214, 0.0043, 0, 0.66, 0.3333, 621, 0, 5, 0, 0, 621, 0, 0], "semantic": {"name": "java.awt", "arg_names": [], "import_names": ["FlowLayout", "BorderLayout", "Dimension", "Font", "Color"], "rhs_call_name": "", "annotation": ""}, "snippet": "from java.awt import FlowLayout, BorderLayout, Dimension, Font, Color"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L8_C0", "label": "VacalcFrame", "type": "class", "loc": [8, 41], "level": 0, "parent": null, "vector": [3, 0, 0.1047, 0.1453, 0, 0.66, 0.4167, 206, 0, 6, 0, 0, 186, 0, 19], "semantic": {"name": "VacalcFrame", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class VacalcFrame(object):\n\n def __init__(self, employees):\n self._frame = JFrame('Vacation Calculator',\n defaultCloseOperation=JFrame.EXIT_ON_CLOSE)\n self._frame.setContentPane(self._create_ui(employees))\n self._frame.pack()\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L10_C4", "label": "__init__", "type": "function", "loc": [10, 14], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L8_C0", "vector": [2, 1, 0.0513, 0.0214, 1, 0.31, 0.0, 555, 0, 2, 0, 0, 0, 0, 4], "semantic": {"name": "__init__", "arg_names": ["self", "employees"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, employees):\n self._frame = JFrame('Vacation Calculator',\n defaultCloseOperation=JFrame.EXIT_ON_CLOSE)\n self._frame.setContentPane(self._create_ui(employees))\n self._frame.pack()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Assign_L11_C8", "label": "self._frame = JFrame()", "type": "assigned_variable", "loc": [11, 12], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L10_C4", "vector": [14, 2, 0.0491, 0.0085, 2, 0.7, 0.0, 895, 3, 2, 0, 0, 207, 10, 1], "semantic": {"name": "self._frame", "arg_names": [], "import_names": [], "rhs_call_name": "JFrame", "annotation": ""}, "snippet": " self._frame = JFrame('Vacation Calculator',\n defaultCloseOperation=JFrame.EXIT_ON_CLOSE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L13_C8", "label": "setContentPane()", "type": "expression", "loc": [13, 13], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L10_C4", "vector": [8, 2, 0.0556, 0.0043, 2, 0.7, 0.5, 146, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "setContentPane", "arg_names": [], "import_names": [], "rhs_call_name": "setContentPane", "annotation": ""}, "snippet": " self._frame.setContentPane(self._create_ui(employees))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L14_C8", "label": "pack()", "type": "expression", "loc": [14, 14], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L10_C4", "vector": [8, 2, 0.0598, 0.0043, 2, 0.7, 1.0, 742, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pack", "arg_names": [], "import_names": [], "rhs_call_name": "pack", "annotation": ""}, "snippet": " self._frame.pack()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L16_C4", "label": "_create_ui", "type": "function", "loc": [16, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L8_C0", "vector": [2, 1, 0.0833, 0.0342, 1, 0.31, 0.2, 675, 0, 2, 1, 0, 0, 0, 7], "semantic": {"name": "_create_ui", "arg_names": ["self", "employees"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _create_ui(self, employees):\n panel = JPanel(layout=FlowLayout())\n self._overview = EmployeeOverview(employees, self)\n self._details = EmployeeDetails(employees)\n self._welcome = Welcome()\n panel.add(self._overview)\n panel.add(self._welcome)\n return panel"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Assign_L17_C8", "label": "panel = JPanel()", "type": "assigned_variable", "loc": [17, 17], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L16_C4", "vector": [14, 2, 0.0726, 0.0043, 2, 0.3, 0.0, 18, 3, 1, 0, 0, 978, 10, 2], "semantic": {"name": "panel", "arg_names": [], "import_names": [], "rhs_call_name": "JPanel", "annotation": ""}, "snippet": " panel = JPanel(layout=FlowLayout())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Assign_L18_C8", "label": "self._overview = EmployeeOverview()", "type": "assigned_variable", "loc": [18, 18], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L16_C4", "vector": [14, 2, 0.0769, 0.0043, 2, 0.3, 0.1667, 794, 3, 2, 0, 0, 509, 10, 1], "semantic": {"name": "self._overview", "arg_names": [], "import_names": [], "rhs_call_name": "EmployeeOverview", "annotation": ""}, "snippet": " self._overview = EmployeeOverview(employees, self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Assign_L19_C8", "label": "self._details = EmployeeDetails()", "type": "assigned_variable", "loc": [19, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L16_C4", "vector": [14, 2, 0.0812, 0.0043, 2, 0.3, 0.3333, 448, 3, 1, 0, 0, 842, 10, 1], "semantic": {"name": "self._details", "arg_names": [], "import_names": [], "rhs_call_name": "EmployeeDetails", "annotation": ""}, "snippet": " self._details = EmployeeDetails(employees)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Assign_L20_C8", "label": "self._welcome = Welcome()", "type": "assigned_variable", "loc": [20, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L16_C4", "vector": [14, 2, 0.0855, 0.0043, 2, 0.3, 0.5, 671, 3, 0, 0, 0, 344, 10, 1], "semantic": {"name": "self._welcome", "arg_names": [], "import_names": [], "rhs_call_name": "Welcome", "annotation": ""}, "snippet": " self._welcome = Welcome()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L21_C8", "label": "add()", "type": "expression", "loc": [21, 21], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L16_C4", "vector": [8, 2, 0.0897, 0.0043, 2, 0.3, 0.6667, 241, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " panel.add(self._overview)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L22_C8", "label": "add()", "type": "expression", "loc": [22, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L16_C4", "vector": [8, 2, 0.094, 0.0043, 2, 0.3, 0.8333, 241, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " panel.add(self._welcome)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Return_L23_C8", "label": "return", "type": "return", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L16_C4", "vector": [13, 2, 0.0983, 0.0043, 2, 0.3, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return panel"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L25_C4", "label": "show", "type": "function", "loc": [25, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L8_C0", "vector": [2, 1, 0.109, 0.0085, 1, 0.31, 0.4, 497, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "show", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def show(self):\n self._frame.setVisible(True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L26_C8", "label": "setVisible()", "type": "expression", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L25_C4", "vector": [8, 2, 0.1111, 0.0043, 2, 0.85, 0.0, 951, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setVisible", "arg_names": [], "import_names": [], "rhs_call_name": "setVisible", "annotation": ""}, "snippet": " self._frame.setVisible(True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L28_C4", "label": "employee_selected", "type": "function", "loc": [28, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L8_C0", "vector": [2, 1, 0.1239, 0.0128, 1, 0.31, 0.6, 675, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "employee_selected", "arg_names": ["self", "employee"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def employee_selected(self, employee):\n self._ensure_details_shown()\n self._details.show_employee(employee)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L29_C8", "label": "_ensure_details_shown()", "type": "expression", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L28_C4", "vector": [8, 2, 0.1239, 0.0043, 2, 0.6, 0.0, 129, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_ensure_details_shown", "arg_names": [], "import_names": [], "rhs_call_name": "_ensure_details_shown", "annotation": ""}, "snippet": " self._ensure_details_shown()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L30_C8", "label": "show_employee()", "type": "expression", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L28_C4", "vector": [8, 2, 0.1282, 0.0043, 2, 0.6, 1.0, 205, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "show_employee", "arg_names": [], "import_names": [], "rhs_call_name": "show_employee", "annotation": ""}, "snippet": " self._details.show_employee(employee)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L32_C4", "label": "edit_new_employee", "type": "function", "loc": [32, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L8_C0", "vector": [2, 1, 0.141, 0.0128, 1, 0.31, 0.8, 698, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "edit_new_employee", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def edit_new_employee(self):\n self._ensure_details_shown()\n self._details.edit_new_employee()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L33_C8", "label": "_ensure_details_shown()", "type": "expression", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L32_C4", "vector": [8, 2, 0.141, 0.0043, 2, 0.71, 0.0, 129, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_ensure_details_shown", "arg_names": [], "import_names": [], "rhs_call_name": "_ensure_details_shown", "annotation": ""}, "snippet": " self._ensure_details_shown()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L34_C8", "label": "edit_new_employee()", "type": "expression", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L32_C4", "vector": [8, 2, 0.1453, 0.0043, 2, 0.71, 1.0, 698, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "edit_new_employee", "arg_names": [], "import_names": [], "rhs_call_name": "edit_new_employee", "annotation": ""}, "snippet": " self._details.edit_new_employee()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L36_C4", "label": "_ensure_details_shown", "type": "function", "loc": [36, 41], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L8_C0", "vector": [2, 1, 0.1645, 0.0256, 1, 0.31, 1.0, 129, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "_ensure_details_shown", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _ensure_details_shown(self):\n if self._welcome:\n self._frame.contentPane.remove(self._welcome)\n self._frame.contentPane.add(self._details)\n self._frame.pack()\n self._welcome = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:If_L37_C8", "label": "if", "type": "if", "loc": [37, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L36_C4", "vector": [4, 2, 0.1667, 0.0214, 2, 0.67, 0.0, 0, 7, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if self._welcome:\n self._frame.contentPane.remove(self._welcome)\n self._frame.contentPane.add(self._details)\n self._frame.pack()\n self._welcome = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L38_C12", "label": "remove()", "type": "expression", "loc": [38, 38], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:If_L37_C8", "vector": [8, 3, 0.1624, 0.0043, 3, 0.01, 0.0, 185, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "remove", "arg_names": [], "import_names": [], "rhs_call_name": "remove", "annotation": ""}, "snippet": " self._frame.contentPane.remove(self._welcome)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L39_C12", "label": "add()", "type": "expression", "loc": [39, 39], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:If_L37_C8", "vector": [8, 3, 0.1667, 0.0043, 3, 0.01, 0.3333, 241, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " self._frame.contentPane.add(self._details)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L40_C12", "label": "pack()", "type": "expression", "loc": [40, 40], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:If_L37_C8", "vector": [8, 3, 0.1709, 0.0043, 3, 0.01, 0.6667, 742, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pack", "arg_names": [], "import_names": [], "rhs_call_name": "pack", "annotation": ""}, "snippet": " self._frame.pack()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Assign_L41_C12", "label": "self._welcome =", "type": "assigned_variable", "loc": [41, 41], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:If_L37_C8", "vector": [14, 3, 0.1752, 0.0043, 3, 0.01, 1.0, 671, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "self._welcome", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._welcome = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L44_C0", "label": "EmployeeOverview", "type": "class", "loc": [44, 70], "level": 0, "parent": null, "vector": [3, 0, 0.2436, 0.1154, 0, 0.66, 0.5, 509, 0, 5, 0, 0, 978, 0, 16], "semantic": {"name": "EmployeeOverview", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class EmployeeOverview(JPanel):\n\n def __init__(self, employees, overview_listener):\n JPanel.__init__(self, layout=BorderLayout())\n self._listener = overview_listener\n self._employee_list = self._create_employee_list(employees)\n new_emp_btn = self._create_new_employee_button()\n self.add(self._employee_list.widget, BorderLayout.PAGE_START)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L46_C4", "label": "__init__", "type": "function", "loc": [46, 52], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L44_C0", "vector": [2, 1, 0.2094, 0.0299, 1, 0.67, 0.0, 555, 0, 3, 0, 0, 0, 0, 6], "semantic": {"name": "__init__", "arg_names": ["self", "employees", "overview_listener"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, employees, overview_listener):\n JPanel.__init__(self, layout=BorderLayout())\n self._listener = overview_listener\n self._employee_list = self._create_employee_list(employees)\n new_emp_btn = self._create_new_employee_button()\n self.add(self._employee_list.widget, BorderLayout.PAGE_START)\n self.add(new_emp_btn, BorderLayout.PAGE_END)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L47_C8", "label": "__init__()", "type": "expression", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L46_C4", "vector": [8, 2, 0.2009, 0.0043, 2, 0.71, 0.0, 555, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " JPanel.__init__(self, layout=BorderLayout())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Assign_L48_C8", "label": "self._listener =", "type": "assigned_variable", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L46_C4", "vector": [14, 2, 0.2051, 0.0043, 2, 0.71, 0.2, 257, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._listener", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._listener = overview_listener"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Assign_L49_C8", "label": "self._employee_list = _create_employee_list()", "type": "assigned_variable", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L46_C4", "vector": [14, 2, 0.2094, 0.0043, 2, 0.71, 0.4, 849, 3, 1, 0, 0, 981, 10, 1], "semantic": {"name": "self._employee_list", "arg_names": [], "import_names": [], "rhs_call_name": "_create_employee_list", "annotation": ""}, "snippet": " self._employee_list = self._create_employee_list(employees)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Assign_L50_C8", "label": "new_emp_btn = _create_new_employee_button()", "type": "assigned_variable", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L46_C4", "vector": [14, 2, 0.2137, 0.0043, 2, 0.71, 0.6, 587, 3, 0, 0, 0, 947, 10, 1], "semantic": {"name": "new_emp_btn", "arg_names": [], "import_names": [], "rhs_call_name": "_create_new_employee_button", "annotation": ""}, "snippet": " new_emp_btn = self._create_new_employee_button()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L51_C8", "label": "add()", "type": "expression", "loc": [51, 51], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L46_C4", "vector": [8, 2, 0.2179, 0.0043, 2, 0.71, 0.8, 241, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " self.add(self._employee_list.widget, BorderLayout.PAGE_START)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L52_C8", "label": "add()", "type": "expression", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L46_C4", "vector": [8, 2, 0.2222, 0.0043, 2, 0.71, 1.0, 241, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " self.add(new_emp_btn, BorderLayout.PAGE_END)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L54_C4", "label": "_create_employee_list", "type": "function", "loc": [54, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L44_C0", "vector": [2, 1, 0.2393, 0.0214, 1, 0.67, 0.25, 981, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "_create_employee_list", "arg_names": ["self", "employees"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _create_employee_list(self, employees):\n list = EmployeeList(employees)\n list.add_selection_listener(ListenerFactory(ListSelectionListener,\n self._list_item_selected))\n return list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Assign_L55_C8", "label": "list = EmployeeList()", "type": "assigned_variable", "loc": [55, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L54_C4", "vector": [14, 2, 0.235, 0.0043, 2, 0.71, 0.0, 430, 3, 1, 0, 0, 647, 10, 1], "semantic": {"name": "list", "arg_names": [], "import_names": [], "rhs_call_name": "EmployeeList", "annotation": ""}, "snippet": " list = EmployeeList(employees)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L56_C8", "label": "add_selection_listener()", "type": "expression", "loc": [56, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L54_C4", "vector": [8, 2, 0.2415, 0.0085, 2, 0.71, 0.5, 634, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "add_selection_listener", "arg_names": [], "import_names": [], "rhs_call_name": "add_selection_listener", "annotation": ""}, "snippet": " list.add_selection_listener(ListenerFactory(ListSelectionListener,\n self._list_item_selected))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Return_L58_C8", "label": "return", "type": "return", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L54_C4", "vector": [13, 2, 0.2479, 0.0043, 2, 0.71, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L60_C4", "label": "_create_new_employee_button", "type": "function", "loc": [60, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L44_C0", "vector": [2, 1, 0.2628, 0.0171, 1, 0.67, 0.5, 947, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "_create_new_employee_button", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _create_new_employee_button(self):\n btn = JButton('New Employee', name='new_employee_button')\n btn.addActionListener(ListenerFactory(ActionListener, self._new_employee))\n return btn"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Assign_L61_C8", "label": "btn = JButton()", "type": "assigned_variable", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L60_C4", "vector": [14, 2, 0.2607, 0.0043, 2, 0.52, 0.0, 826, 3, 2, 0, 0, 362, 10, 1], "semantic": {"name": "btn", "arg_names": [], "import_names": [], "rhs_call_name": "JButton", "annotation": ""}, "snippet": " btn = JButton('New Employee', name='new_employee_button')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L62_C8", "label": "addActionListener()", "type": "expression", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L60_C4", "vector": [8, 2, 0.265, 0.0043, 2, 0.52, 0.5, 861, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "addActionListener", "arg_names": [], "import_names": [], "rhs_call_name": "addActionListener", "annotation": ""}, "snippet": " btn.addActionListener(ListenerFactory(ActionListener, self._new_employee))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Return_L63_C8", "label": "return", "type": "return", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L60_C4", "vector": [13, 2, 0.2692, 0.0043, 2, 0.52, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return btn"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L65_C4", "label": "_list_item_selected", "type": "function", "loc": [65, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L44_C0", "vector": [2, 1, 0.2799, 0.0085, 1, 0.67, 0.75, 518, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "_list_item_selected", "arg_names": ["self", "event"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _list_item_selected(self, event):\n self._listener.employee_selected(self._employee_list.selected_employee())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L66_C8", "label": "employee_selected()", "type": "expression", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L65_C4", "vector": [8, 2, 0.2821, 0.0043, 2, 0.44, 0.0, 675, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "employee_selected", "arg_names": [], "import_names": [], "rhs_call_name": "employee_selected", "annotation": ""}, "snippet": " self._listener.employee_selected(self._employee_list.selected_employee())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L68_C4", "label": "_new_employee", "type": "function", "loc": [68, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L44_C0", "vector": [2, 1, 0.2949, 0.0128, 1, 0.67, 1.0, 639, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "_new_employee", "arg_names": ["self", "event"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _new_employee(self, event):\n self._employee_list.clear_selection()\n self._listener.edit_new_employee()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L69_C8", "label": "clear_selection()", "type": "expression", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L68_C4", "vector": [8, 2, 0.2949, 0.0043, 2, 0.13, 0.0, 873, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "clear_selection", "arg_names": [], "import_names": [], "rhs_call_name": "clear_selection", "annotation": ""}, "snippet": " self._employee_list.clear_selection()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L70_C8", "label": "edit_new_employee()", "type": "expression", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L68_C4", "vector": [8, 2, 0.2991, 0.0043, 2, 0.13, 1.0, 698, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "edit_new_employee", "arg_names": [], "import_names": [], "rhs_call_name": "edit_new_employee", "annotation": ""}, "snippet": " self._listener.edit_new_employee()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L73_C0", "label": "EmployeeList", "type": "class", "loc": [73, 105], "level": 0, "parent": null, "vector": [3, 0, 0.3803, 0.141, 0, 0.66, 0.5833, 647, 0, 9, 0, 0, 186, 0, 12], "semantic": {"name": "EmployeeList", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class EmployeeList(object):\n\n def __init__(self, employees):\n self._employees = employees\n self._employees.add_change_listener(self)\n self._list = JList(preferredSize=(200, 200), name='employee_list')\n self._populate_list()\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L75_C4", "label": "__init__", "type": "function", "loc": [75, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L73_C0", "vector": [2, 1, 0.3291, 0.0214, 1, 0.7, 0.0, 555, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "__init__", "arg_names": ["self", "employees"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, employees):\n self._employees = employees\n self._employees.add_change_listener(self)\n self._list = JList(preferredSize=(200, 200), name='employee_list')\n self._populate_list()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Assign_L76_C8", "label": "self._employees =", "type": "assigned_variable", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L75_C4", "vector": [14, 2, 0.3248, 0.0043, 2, 0.33, 0.0, 73, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._employees", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._employees = employees"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L77_C8", "label": "add_change_listener()", "type": "expression", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L75_C4", "vector": [8, 2, 0.3291, 0.0043, 2, 0.33, 0.3333, 357, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add_change_listener", "arg_names": [], "import_names": [], "rhs_call_name": "add_change_listener", "annotation": ""}, "snippet": " self._employees.add_change_listener(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Assign_L78_C8", "label": "self._list = JList()", "type": "assigned_variable", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L75_C4", "vector": [14, 2, 0.3333, 0.0043, 2, 0.33, 0.6667, 66, 3, 2, 0, 0, 166, 10, 1], "semantic": {"name": "self._list", "arg_names": [], "import_names": [], "rhs_call_name": "JList", "annotation": ""}, "snippet": " self._list = JList(preferredSize=(200, 200), name='employee_list')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L79_C8", "label": "_populate_list()", "type": "expression", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L75_C4", "vector": [8, 2, 0.3376, 0.0043, 2, 0.33, 1.0, 107, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_populate_list", "arg_names": [], "import_names": [], "rhs_call_name": "_populate_list", "annotation": ""}, "snippet": " self._populate_list()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L81_C4", "label": "_populate_list", "type": "function", "loc": [81, 82], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L73_C0", "vector": [2, 1, 0.3483, 0.0085, 1, 0.7, 0.125, 107, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "_populate_list", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _populate_list(self):\n self._list.setListData(self._employee_names())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L82_C8", "label": "setListData()", "type": "expression", "loc": [82, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L81_C4", "vector": [8, 2, 0.3504, 0.0043, 2, 0.17, 0.0, 527, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "setListData", "arg_names": [], "import_names": [], "rhs_call_name": "setListData", "annotation": ""}, "snippet": " self._list.setListData(self._employee_names())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L84_C4", "label": "_employee_names", "type": "function", "loc": [84, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L73_C0", "vector": [2, 1, 0.3611, 0.0085, 1, 0.7, 0.25, 661, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "_employee_names", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _employee_names(self):\n return [e.name for e in self._employees.all()]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Return_L85_C8", "label": "return", "type": "return", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L84_C4", "vector": [13, 2, 0.3632, 0.0043, 2, 0.3, 0.0, 0, 5, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return [e.name for e in self._employees.all()]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L87_C4", "label": "add_selection_listener", "type": "function", "loc": [87, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L73_C0", "vector": [2, 1, 0.3739, 0.0085, 1, 0.7, 0.375, 634, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "add_selection_listener", "arg_names": ["self", "listener"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add_selection_listener(self, listener):\n self._list.addListSelectionListener(listener)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L88_C8", "label": "addListSelectionListener()", "type": "expression", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L87_C4", "vector": [8, 2, 0.3761, 0.0043, 2, 0.0, 0.0, 375, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "addListSelectionListener", "arg_names": [], "import_names": [], "rhs_call_name": "addListSelectionListener", "annotation": ""}, "snippet": " self._list.addListSelectionListener(listener)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L90_C4", "label": "selected_employee", "type": "function", "loc": [90, 91], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L73_C0", "vector": [2, 1, 0.3868, 0.0085, 1, 0.7, 0.5, 718, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "selected_employee", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def selected_employee(self):\n return self._employees.all()[self._list.getSelectedIndex()]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Return_L91_C8", "label": "return", "type": "return", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L90_C4", "vector": [13, 2, 0.3889, 0.0043, 2, 0.02, 0.0, 0, 6, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._employees.all()[self._list.getSelectedIndex()]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L93_C4", "label": "employee_added", "type": "function", "loc": [93, 95], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L73_C0", "vector": [2, 1, 0.4017, 0.0128, 1, 0.7, 0.625, 591, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "employee_added", "arg_names": ["self", "employee"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def employee_added(self, employee):\n self._populate_list()\n self._list.setSelectedValue(employee.name, True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L94_C8", "label": "_populate_list()", "type": "expression", "loc": [94, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L93_C4", "vector": [8, 2, 0.4017, 0.0043, 2, 0.63, 0.0, 107, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_populate_list", "arg_names": [], "import_names": [], "rhs_call_name": "_populate_list", "annotation": ""}, "snippet": " self._populate_list()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L95_C8", "label": "setSelectedValue()", "type": "expression", "loc": [95, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L93_C4", "vector": [8, 2, 0.406, 0.0043, 2, 0.63, 1.0, 411, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "setSelectedValue", "arg_names": [], "import_names": [], "rhs_call_name": "setSelectedValue", "annotation": ""}, "snippet": " self._list.setSelectedValue(employee.name, True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L97_C4", "label": "adding_employee_failed", "type": "function", "loc": [97, 98], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L73_C0", "vector": [2, 1, 0.4167, 0.0085, 1, 0.7, 0.75, 897, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "adding_employee_failed", "arg_names": ["self", "error"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def adding_employee_failed(self, error):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L100_C4", "label": "clear_selection", "type": "function", "loc": [100, 101], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L73_C0", "vector": [2, 1, 0.4295, 0.0085, 1, 0.7, 0.875, 873, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "clear_selection", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def clear_selection(self):\n self._list.clearSelection()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L101_C8", "label": "clearSelection()", "type": "expression", "loc": [101, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L100_C4", "vector": [8, 2, 0.4316, 0.0043, 2, 0.8, 0.0, 555, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "clearSelection", "arg_names": [], "import_names": [], "rhs_call_name": "clearSelection", "annotation": ""}, "snippet": " self._list.clearSelection()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L104_C4", "label": "widget", "type": "function", "loc": [104, 105], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L73_C0", "vector": [2, 1, 0.4466, 0.0085, 1, 0.7, 1.0, 972, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "widget", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def widget(self):\n return self._list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Return_L105_C8", "label": "return", "type": "return", "loc": [105, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L104_C4", "vector": [13, 2, 0.4487, 0.0043, 2, 0.26, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L108_C0", "label": "EmployeeDetails", "type": "class", "loc": [108, 191], "level": 0, "parent": null, "vector": [3, 0, 0.6389, 0.359, 0, 0.66, 0.6667, 842, 0, 12, 0, 0, 978, 0, 49], "semantic": {"name": "EmployeeDetails", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class EmployeeDetails(JPanel):\n\n def __init__(self, employees):\n JPanel.__init__(self, preferredSize=(400, 200))\n layout = BoxLayout(self, BoxLayout.Y_AXIS)\n self.setLayout(layout)\n self._employees = employees\n employees.add_change_listener(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L110_C4", "label": "__init__", "type": "function", "loc": [110, 121], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L108_C0", "vector": [2, 1, 0.4936, 0.0513, 1, 0.08, 0.0, 555, 0, 2, 0, 0, 0, 0, 9], "semantic": {"name": "__init__", "arg_names": ["self", "employees"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, employees):\n JPanel.__init__(self, preferredSize=(400, 200))\n layout = BoxLayout(self, BoxLayout.Y_AXIS)\n self.setLayout(layout)\n self._employees = employees\n employees.add_change_listener(self)\n self._create_status_label()\n self._create_name_editor()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L111_C8", "label": "__init__()", "type": "expression", "loc": [111, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L110_C4", "vector": [8, 2, 0.4744, 0.0043, 2, 0.68, 0.0, 555, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " JPanel.__init__(self, preferredSize=(400, 200))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Assign_L112_C8", "label": "layout = BoxLayout()", "type": "assigned_variable", "loc": [112, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L110_C4", "vector": [14, 2, 0.4786, 0.0043, 2, 0.68, 0.1, 634, 3, 2, 0, 0, 708, 10, 1], "semantic": {"name": "layout", "arg_names": [], "import_names": [], "rhs_call_name": "BoxLayout", "annotation": ""}, "snippet": " layout = BoxLayout(self, BoxLayout.Y_AXIS)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L113_C8", "label": "setLayout()", "type": "expression", "loc": [113, 113], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L110_C4", "vector": [8, 2, 0.4829, 0.0043, 2, 0.68, 0.2, 375, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setLayout", "arg_names": [], "import_names": [], "rhs_call_name": "setLayout", "annotation": ""}, "snippet": " self.setLayout(layout)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Assign_L114_C8", "label": "self._employees =", "type": "assigned_variable", "loc": [114, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L110_C4", "vector": [14, 2, 0.4872, 0.0043, 2, 0.68, 0.3, 73, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._employees", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._employees = employees"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L115_C8", "label": "add_change_listener()", "type": "expression", "loc": [115, 115], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L110_C4", "vector": [8, 2, 0.4915, 0.0043, 2, 0.68, 0.4, 357, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add_change_listener", "arg_names": [], "import_names": [], "rhs_call_name": "add_change_listener", "annotation": ""}, "snippet": " employees.add_change_listener(self)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L116_C8", "label": "_create_status_label()", "type": "expression", "loc": [116, 116], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L110_C4", "vector": [8, 2, 0.4957, 0.0043, 2, 0.68, 0.5, 850, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_create_status_label", "arg_names": [], "import_names": [], "rhs_call_name": "_create_status_label", "annotation": ""}, "snippet": " self._create_status_label()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L117_C8", "label": "_create_name_editor()", "type": "expression", "loc": [117, 117], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L110_C4", "vector": [8, 2, 0.5, 0.0043, 2, 0.68, 0.6, 660, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_create_name_editor", "arg_names": [], "import_names": [], "rhs_call_name": "_create_name_editor", "annotation": ""}, "snippet": " self._create_name_editor()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L118_C8", "label": "_create_start_date_editor()", "type": "expression", "loc": [118, 118], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L110_C4", "vector": [8, 2, 0.5043, 0.0043, 2, 0.68, 0.7, 137, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_create_start_date_editor", "arg_names": [], "import_names": [], "rhs_call_name": "_create_start_date_editor", "annotation": ""}, "snippet": " self._create_start_date_editor()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L119_C8", "label": "_create_save_button()", "type": "expression", "loc": [119, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L110_C4", "vector": [8, 2, 0.5085, 0.0043, 2, 0.68, 0.8, 410, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_create_save_button", "arg_names": [], "import_names": [], "rhs_call_name": "_create_save_button", "annotation": ""}, "snippet": " self._create_save_button()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L120_C8", "label": "_create_vacation_display()", "type": "expression", "loc": [120, 120], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L110_C4", "vector": [8, 2, 0.5128, 0.0043, 2, 0.68, 0.9, 722, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_create_vacation_display", "arg_names": [], "import_names": [], "rhs_call_name": "_create_vacation_display", "annotation": ""}, "snippet": " self._create_vacation_display()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Assign_L121_C8", "label": "self._adding_employee =", "type": "assigned_variable", "loc": [121, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L110_C4", "vector": [14, 2, 0.5171, 0.0043, 2, 0.68, 1.0, 405, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self._adding_employee", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._adding_employee = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L123_C4", "label": "_create_status_label", "type": "function", "loc": [123, 127], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L108_C0", "vector": [2, 1, 0.5342, 0.0214, 1, 0.08, 0.0909, 850, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "_create_status_label", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _create_status_label(self):\n self._status_label = JLabel(name='status_label',\n font=Font(Font.SANS_SERIF, Font.PLAIN, 11))\n self.add(self._status_label)\n self._add_with_padding(self._status_label, 5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Assign_L124_C8", "label": "self._status_label = JLabel()", "type": "assigned_variable", "loc": [124, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L123_C4", "vector": [14, 2, 0.5321, 0.0085, 2, 0.03, 0.0, 135, 3, 2, 0, 0, 928, 10, 2], "semantic": {"name": "self._status_label", "arg_names": [], "import_names": [], "rhs_call_name": "JLabel", "annotation": ""}, "snippet": " self._status_label = JLabel(name='status_label',\n font=Font(Font.SANS_SERIF, Font.PLAIN, 11))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L126_C8", "label": "add()", "type": "expression", "loc": [126, 126], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L123_C4", "vector": [8, 2, 0.5385, 0.0043, 2, 0.03, 0.5, 241, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " self.add(self._status_label)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L127_C8", "label": "_add_with_padding()", "type": "expression", "loc": [127, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L123_C4", "vector": [8, 2, 0.5427, 0.0043, 2, 0.03, 1.0, 773, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_add_with_padding", "arg_names": [], "import_names": [], "rhs_call_name": "_add_with_padding", "annotation": ""}, "snippet": " self._add_with_padding(self._status_label, 5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L129_C4", "label": "_create_name_editor", "type": "function", "loc": [129, 132], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L108_C0", "vector": [2, 1, 0.5577, 0.0171, 1, 0.08, 0.1818, 660, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "_create_name_editor", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _create_name_editor(self):\n self.add(JLabel(text='Employee Name:'))\n self._name_editor = FixedHeightTextField('name_input')\n self._add_with_padding(self._name_editor, 5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L130_C8", "label": "add()", "type": "expression", "loc": [130, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L129_C4", "vector": [8, 2, 0.5556, 0.0043, 2, 0.84, 0.0, 241, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " self.add(JLabel(text='Employee Name:'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Assign_L131_C8", "label": "self._name_editor = FixedHeightTextField()", "type": "assigned_variable", "loc": [131, 131], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L129_C4", "vector": [14, 2, 0.5598, 0.0043, 2, 0.84, 0.5, 378, 3, 1, 0, 0, 710, 10, 1], "semantic": {"name": "self._name_editor", "arg_names": [], "import_names": [], "rhs_call_name": "FixedHeightTextField", "annotation": ""}, "snippet": " self._name_editor = FixedHeightTextField('name_input')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L132_C8", "label": "_add_with_padding()", "type": "expression", "loc": [132, 132], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L129_C4", "vector": [8, 2, 0.5641, 0.0043, 2, 0.84, 1.0, 773, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_add_with_padding", "arg_names": [], "import_names": [], "rhs_call_name": "_add_with_padding", "annotation": ""}, "snippet": " self._add_with_padding(self._name_editor, 5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L134_C4", "label": "_create_start_date_editor", "type": "function", "loc": [134, 137], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L108_C0", "vector": [2, 1, 0.5791, 0.0171, 1, 0.08, 0.2727, 137, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "_create_start_date_editor", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _create_start_date_editor(self):\n self.add(JLabel(text='Start Date (yyyy-mm-dd):'))\n self._start_date_editor = FixedHeightTextField('start_input')\n self._add_with_padding(self._start_date_editor, 5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L135_C8", "label": "add()", "type": "expression", "loc": [135, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L134_C4", "vector": [8, 2, 0.5769, 0.0043, 2, 0.73, 0.0, 241, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " self.add(JLabel(text='Start Date (yyyy-mm-dd):'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Assign_L136_C8", "label": "self._start_date_editor = FixedHeightTextField()", "type": "assigned_variable", "loc": [136, 136], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L134_C4", "vector": [14, 2, 0.5812, 0.0043, 2, 0.73, 0.5, 485, 3, 1, 0, 0, 710, 10, 1], "semantic": {"name": "self._start_date_editor", "arg_names": [], "import_names": [], "rhs_call_name": "FixedHeightTextField", "annotation": ""}, "snippet": " self._start_date_editor = FixedHeightTextField('start_input')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L137_C8", "label": "_add_with_padding()", "type": "expression", "loc": [137, 137], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L134_C4", "vector": [8, 2, 0.5855, 0.0043, 2, 0.73, 1.0, 773, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_add_with_padding", "arg_names": [], "import_names": [], "rhs_call_name": "_add_with_padding", "annotation": ""}, "snippet": " self._add_with_padding(self._start_date_editor, 5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L139_C4", "label": "_create_save_button", "type": "function", "loc": [139, 143], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L108_C0", "vector": [2, 1, 0.6026, 0.0214, 1, 0.08, 0.3636, 410, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "_create_save_button", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _create_save_button(self):\n self._save_button = JButton('Save', name='save_button', visible=False)\n self._save_button.addActionListener(ListenerFactory(ActionListener,\n self._save_button_pushed))\n self._add_with_padding(self._save_button, 5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Assign_L140_C8", "label": "self._save_button = JButton()", "type": "assigned_variable", "loc": [140, 140], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L139_C4", "vector": [14, 2, 0.5983, 0.0043, 2, 0.45, 0.0, 621, 3, 3, 0, 0, 362, 10, 1], "semantic": {"name": "self._save_button", "arg_names": [], "import_names": [], "rhs_call_name": "JButton", "annotation": ""}, "snippet": " self._save_button = JButton('Save', name='save_button', visible=False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L141_C8", "label": "addActionListener()", "type": "expression", "loc": [141, 142], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L139_C4", "vector": [8, 2, 0.6047, 0.0085, 2, 0.45, 0.5, 861, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "addActionListener", "arg_names": [], "import_names": [], "rhs_call_name": "addActionListener", "annotation": ""}, "snippet": " self._save_button.addActionListener(ListenerFactory(ActionListener,\n self._save_button_pushed))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L143_C8", "label": "_add_with_padding()", "type": "expression", "loc": [143, 143], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L139_C4", "vector": [8, 2, 0.6111, 0.0043, 2, 0.45, 1.0, 773, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_add_with_padding", "arg_names": [], "import_names": [], "rhs_call_name": "_add_with_padding", "annotation": ""}, "snippet": " self._add_with_padding(self._save_button, 5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L145_C4", "label": "_create_vacation_display", "type": "function", "loc": [145, 150], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L108_C0", "vector": [2, 1, 0.6303, 0.0256, 1, 0.08, 0.4545, 722, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "_create_vacation_display", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _create_vacation_display(self):\n# self._display = JTable()\n# self._header = self._display.getTableHeader()\n# self.add(self._header)\n# self.add(self._display)\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L152_C4", "label": "_add_with_padding", "type": "function", "loc": [152, 154], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L108_C0", "vector": [2, 1, 0.6538, 0.0128, 1, 0.08, 0.5455, 773, 0, 3, 0, 0, 0, 0, 4], "semantic": {"name": "_add_with_padding", "arg_names": ["self", "component", "padding"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _add_with_padding(self, component, padding):\n self.add(component)\n self.add(Box.createRigidArea(Dimension(0, padding)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L153_C8", "label": "add()", "type": "expression", "loc": [153, 153], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L152_C4", "vector": [8, 2, 0.6538, 0.0043, 2, 0.45, 0.0, 241, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " self.add(component)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L154_C8", "label": "add()", "type": "expression", "loc": [154, 154], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L152_C4", "vector": [8, 2, 0.6581, 0.0043, 2, 0.45, 1.0, 241, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " self.add(Box.createRigidArea(Dimension(0, padding)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L156_C4", "label": "show_employee", "type": "function", "loc": [156, 165], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L108_C0", "vector": [2, 1, 0.6859, 0.0427, 1, 0.08, 0.6364, 205, 0, 2, 0, 0, 0, 0, 7], "semantic": {"name": "show_employee", "arg_names": ["self", "employee"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def show_employee(self, employee):\n self._name_editor.setText(employee.name)\n self._start_date_editor.setText(str(employee.startdate))\n self._name_editor.setEditable(False)\n self._start_date_editor.setEditable(False)\n self._save_button.setVisible(False)\n if self._adding_employee:\n self._adding_employee = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L157_C8", "label": "setText()", "type": "expression", "loc": [157, 157], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L156_C4", "vector": [8, 2, 0.6709, 0.0043, 2, 0.38, 0.0, 40, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setText", "arg_names": [], "import_names": [], "rhs_call_name": "setText", "annotation": ""}, "snippet": " self._name_editor.setText(employee.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L158_C8", "label": "setText()", "type": "expression", "loc": [158, 158], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L156_C4", "vector": [8, 2, 0.6752, 0.0043, 2, 0.38, 0.2, 40, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "setText", "arg_names": [], "import_names": [], "rhs_call_name": "setText", "annotation": ""}, "snippet": " self._start_date_editor.setText(str(employee.startdate))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L159_C8", "label": "setEditable()", "type": "expression", "loc": [159, 159], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L156_C4", "vector": [8, 2, 0.6795, 0.0043, 2, 0.38, 0.4, 440, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setEditable", "arg_names": [], "import_names": [], "rhs_call_name": "setEditable", "annotation": ""}, "snippet": " self._name_editor.setEditable(False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L160_C8", "label": "setEditable()", "type": "expression", "loc": [160, 160], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L156_C4", "vector": [8, 2, 0.6838, 0.0043, 2, 0.38, 0.6, 440, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setEditable", "arg_names": [], "import_names": [], "rhs_call_name": "setEditable", "annotation": ""}, "snippet": " self._start_date_editor.setEditable(False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L161_C8", "label": "setVisible()", "type": "expression", "loc": [161, 161], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L156_C4", "vector": [8, 2, 0.688, 0.0043, 2, 0.38, 0.8, 951, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setVisible", "arg_names": [], "import_names": [], "rhs_call_name": "setVisible", "annotation": ""}, "snippet": " self._save_button.setVisible(False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:If_L162_C8", "label": "if", "type": "if", "loc": [162, 165], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L156_C4", "vector": [4, 2, 0.6987, 0.0171, 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._adding_employee:\n self._adding_employee = False\n else:\n self._status_label.setText('')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Assign_L163_C12", "label": "self._adding_employee =", "type": "assigned_variable", "loc": [163, 163], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:If_L162_C8", "vector": [14, 3, 0.6966, 0.0043, 3, 0.67, 0.0, 405, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self._adding_employee", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._adding_employee = False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L165_C12", "label": "setText()", "type": "expression", "loc": [165, 165], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:If_L162_C8", "vector": [8, 3, 0.7051, 0.0043, 3, 0.67, 1.0, 40, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setText", "arg_names": [], "import_names": [], "rhs_call_name": "setText", "annotation": ""}, "snippet": " self._status_label.setText('')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L170_C4", "label": "edit_new_employee", "type": "function", "loc": [170, 178], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L108_C0", "vector": [2, 1, 0.7436, 0.0385, 1, 0.08, 0.7273, 698, 0, 1, 0, 0, 0, 0, 5], "semantic": {"name": "edit_new_employee", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def edit_new_employee(self):\n self._name_editor.setText('')\n self._start_date_editor.setText('')\n self._name_editor.setEditable(True)\n self._start_date_editor.setEditable(True)\n self._save_button.setVisible(True)\n# self._display.setVisible(False)\n# self._header.setVisible(False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L171_C8", "label": "setText()", "type": "expression", "loc": [171, 171], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L170_C4", "vector": [8, 2, 0.7308, 0.0043, 2, 0.04, 0.0, 40, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setText", "arg_names": [], "import_names": [], "rhs_call_name": "setText", "annotation": ""}, "snippet": " self._name_editor.setText('')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L172_C8", "label": "setText()", "type": "expression", "loc": [172, 172], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L170_C4", "vector": [8, 2, 0.735, 0.0043, 2, 0.04, 0.2, 40, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setText", "arg_names": [], "import_names": [], "rhs_call_name": "setText", "annotation": ""}, "snippet": " self._start_date_editor.setText('')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L173_C8", "label": "setEditable()", "type": "expression", "loc": [173, 173], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L170_C4", "vector": [8, 2, 0.7393, 0.0043, 2, 0.04, 0.4, 440, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setEditable", "arg_names": [], "import_names": [], "rhs_call_name": "setEditable", "annotation": ""}, "snippet": " self._name_editor.setEditable(True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L174_C8", "label": "setEditable()", "type": "expression", "loc": [174, 174], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L170_C4", "vector": [8, 2, 0.7436, 0.0043, 2, 0.04, 0.6, 440, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setEditable", "arg_names": [], "import_names": [], "rhs_call_name": "setEditable", "annotation": ""}, "snippet": " self._start_date_editor.setEditable(True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L175_C8", "label": "setVisible()", "type": "expression", "loc": [175, 175], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L170_C4", "vector": [8, 2, 0.7479, 0.0043, 2, 0.04, 0.8, 951, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setVisible", "arg_names": [], "import_names": [], "rhs_call_name": "setVisible", "annotation": ""}, "snippet": " self._save_button.setVisible(True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Assign_L178_C8", "label": "self._adding_employee =", "type": "assigned_variable", "loc": [178, 178], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L170_C4", "vector": [14, 2, 0.7607, 0.0043, 2, 0.04, 1.0, 405, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "self._adding_employee", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._adding_employee = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L180_C4", "label": "_save_button_pushed", "type": "function", "loc": [180, 182], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L108_C0", "vector": [2, 1, 0.7735, 0.0128, 1, 0.08, 0.8182, 469, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "_save_button_pushed", "arg_names": ["self", "event"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def _save_button_pushed(self, event):\n self._employees.add(self._name_editor.getText(),\n self._start_date_editor.getText())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L181_C8", "label": "add()", "type": "expression", "loc": [181, 182], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L180_C4", "vector": [8, 2, 0.7756, 0.0085, 2, 0.12, 0.0, 241, 3, 2, 0, 0, 0, 0, 3], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " self._employees.add(self._name_editor.getText(),\n self._start_date_editor.getText())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L184_C4", "label": "employee_added", "type": "function", "loc": [184, 187], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L108_C0", "vector": [2, 1, 0.7927, 0.0171, 1, 0.08, 0.9091, 591, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "employee_added", "arg_names": ["self", "employee"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def employee_added(self, employee):\n self._status_label.setForeground(Color.BLACK)\n self._status_label.setText(\"Employee '%s' was added successfully.\" % employee.name)\n self._save_button.setVisible(False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L185_C8", "label": "setForeground()", "type": "expression", "loc": [185, 185], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L184_C4", "vector": [8, 2, 0.7906, 0.0043, 2, 0.89, 0.0, 907, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setForeground", "arg_names": [], "import_names": [], "rhs_call_name": "setForeground", "annotation": ""}, "snippet": " self._status_label.setForeground(Color.BLACK)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L186_C8", "label": "setText()", "type": "expression", "loc": [186, 186], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L184_C4", "vector": [8, 2, 0.7949, 0.0043, 2, 0.89, 0.5, 40, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setText", "arg_names": [], "import_names": [], "rhs_call_name": "setText", "annotation": ""}, "snippet": " self._status_label.setText(\"Employee '%s' was added successfully.\" % employee.name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L187_C8", "label": "setVisible()", "type": "expression", "loc": [187, 187], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L184_C4", "vector": [8, 2, 0.7991, 0.0043, 2, 0.89, 1.0, 951, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setVisible", "arg_names": [], "import_names": [], "rhs_call_name": "setVisible", "annotation": ""}, "snippet": " self._save_button.setVisible(False)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L189_C4", "label": "adding_employee_failed", "type": "function", "loc": [189, 191], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L108_C0", "vector": [2, 1, 0.812, 0.0128, 1, 0.08, 1.0, 897, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "adding_employee_failed", "arg_names": ["self", "reason"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def adding_employee_failed(self, reason):\n self._status_label.setForeground(Color.RED)\n self._status_label.setText(reason)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L190_C8", "label": "setForeground()", "type": "expression", "loc": [190, 190], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L189_C4", "vector": [8, 2, 0.812, 0.0043, 2, 0.72, 0.0, 907, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setForeground", "arg_names": [], "import_names": [], "rhs_call_name": "setForeground", "annotation": ""}, "snippet": " self._status_label.setForeground(Color.RED)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L191_C8", "label": "setText()", "type": "expression", "loc": [191, 191], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L189_C4", "vector": [8, 2, 0.8162, 0.0043, 2, 0.72, 1.0, 40, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "setText", "arg_names": [], "import_names": [], "rhs_call_name": "setText", "annotation": ""}, "snippet": " self._status_label.setText(reason)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L194_C0", "label": "FixedHeightTextField", "type": "class", "loc": [194, 200], "level": 0, "parent": null, "vector": [3, 0, 0.8419, 0.0299, 0, 0.66, 0.75, 710, 0, 1, 0, 0, 624, 0, 3], "semantic": {"name": "FixedHeightTextField", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class FixedHeightTextField(JTextField):\n\n def __init__(self, name):\n JTextField.__init__(self, name=name)\n prefsize = self.preferredSize\n maxsize = self.maximumSize\n self.setMaximumSize(Dimension(maxsize.width, prefsize.height))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L196_C4", "label": "__init__", "type": "function", "loc": [196, 200], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L194_C0", "vector": [2, 1, 0.8462, 0.0214, 1, 0.21, 0.0, 555, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "__init__", "arg_names": ["self", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, name):\n JTextField.__init__(self, name=name)\n prefsize = self.preferredSize\n maxsize = self.maximumSize\n self.setMaximumSize(Dimension(maxsize.width, prefsize.height))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L197_C8", "label": "__init__()", "type": "expression", "loc": [197, 197], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L196_C4", "vector": [8, 2, 0.8419, 0.0043, 2, 0.0, 0.0, 555, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " JTextField.__init__(self, name=name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Assign_L198_C8", "label": "prefsize =", "type": "assigned_variable", "loc": [198, 198], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L196_C4", "vector": [14, 2, 0.8462, 0.0043, 2, 0.0, 0.3333, 329, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "prefsize", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " prefsize = self.preferredSize"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Assign_L199_C8", "label": "maxsize =", "type": "assigned_variable", "loc": [199, 199], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L196_C4", "vector": [14, 2, 0.8504, 0.0043, 2, 0.0, 0.6667, 100, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "maxsize", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " maxsize = self.maximumSize"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L200_C8", "label": "setMaximumSize()", "type": "expression", "loc": [200, 200], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L196_C4", "vector": [8, 2, 0.8547, 0.0043, 2, 0.0, 1.0, 816, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "setMaximumSize", "arg_names": [], "import_names": [], "rhs_call_name": "setMaximumSize", "annotation": ""}, "snippet": " self.setMaximumSize(Dimension(maxsize.width, prefsize.height))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L203_C0", "label": "Welcome", "type": "class", "loc": [203, 207], "level": 0, "parent": null, "vector": [3, 0, 0.8761, 0.0214, 0, 0.66, 0.8333, 344, 0, 1, 0, 0, 978, 0, 3], "semantic": {"name": "Welcome", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Welcome(JPanel):\n\n def __init__(self):\n JPanel.__init__(self, preferredSize=(400,200))\n self.add(JLabel('VaCalc v0.1'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L205_C4", "label": "__init__", "type": "function", "loc": [205, 207], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L203_C0", "vector": [2, 1, 0.8803, 0.0128, 1, 0.37, 0.0, 555, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self):\n JPanel.__init__(self, preferredSize=(400,200))\n self.add(JLabel('VaCalc v0.1'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L206_C8", "label": "__init__()", "type": "expression", "loc": [206, 206], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L205_C4", "vector": [8, 2, 0.8803, 0.0043, 2, 0.2, 0.0, 555, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": [], "import_names": [], "rhs_call_name": "__init__", "annotation": ""}, "snippet": " JPanel.__init__(self, preferredSize=(400,200))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L207_C8", "label": "add()", "type": "expression", "loc": [207, 207], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L205_C4", "vector": [8, 2, 0.8846, 0.0043, 2, 0.2, 1.0, 241, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "add", "arg_names": [], "import_names": [], "rhs_call_name": "add", "annotation": ""}, "snippet": " self.add(JLabel('VaCalc v0.1'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L210_C0", "label": "VacationTableModel", "type": "class", "loc": [210, 228], "level": 0, "parent": null, "vector": [3, 0, 0.9359, 0.0812, 0, 0.66, 0.9167, 357, 0, 5, 0, 0, 357, 0, 1], "semantic": {"name": "VacationTableModel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class VacationTableModel(AbstractTableModel):\n _columns = ['Year', 'Vacation']\n\n def __init__(self, employee):\n self._employee = employee\n\n def getColumnName(self, index):\n return self._columns[index]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Assign_L211_C4", "label": "_columns =", "type": "assigned_variable", "loc": [211, 211], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L210_C0", "vector": [14, 1, 0.9017, 0.0043, 1, 0.67, 0.0, 895, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "_columns", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " _columns = ['Year', 'Vacation']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L213_C4", "label": "__init__", "type": "function", "loc": [213, 214], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L210_C0", "vector": [2, 1, 0.9124, 0.0085, 1, 0.67, 0.2, 555, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "employee"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, employee):\n self._employee = employee"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Assign_L214_C8", "label": "self._employee =", "type": "assigned_variable", "loc": [214, 214], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L213_C4", "vector": [14, 2, 0.9145, 0.0043, 2, 0.79, 0.0, 372, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self._employee", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self._employee = employee"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L216_C4", "label": "getColumnName", "type": "function", "loc": [216, 217], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L210_C0", "vector": [2, 1, 0.9252, 0.0085, 1, 0.67, 0.4, 789, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "getColumnName", "arg_names": ["self", "index"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def getColumnName(self, index):\n return self._columns[index]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Return_L217_C8", "label": "return", "type": "return", "loc": [217, 217], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L216_C4", "vector": [13, 2, 0.9274, 0.0043, 2, 0.12, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return self._columns[index]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L219_C4", "label": "getColumnCount", "type": "function", "loc": [219, 220], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L210_C0", "vector": [2, 1, 0.938, 0.0085, 1, 0.67, 0.6, 489, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "getColumnCount", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def getColumnCount(self):\n return 2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Return_L220_C8", "label": "return", "type": "return", "loc": [220, 220], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L219_C4", "vector": [13, 2, 0.9402, 0.0043, 2, 0.43, 0.0, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L222_C4", "label": "getRowCount", "type": "function", "loc": [222, 223], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L210_C0", "vector": [2, 1, 0.9509, 0.0085, 1, 0.67, 0.8, 420, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "getRowCount", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def getRowCount(self):\n return 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Return_L223_C8", "label": "return", "type": "return", "loc": [223, 223], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L222_C4", "vector": [13, 2, 0.953, 0.0043, 2, 0.2, 0.0, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L225_C4", "label": "getValueAt", "type": "function", "loc": [225, 228], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L210_C0", "vector": [2, 1, 0.9679, 0.0171, 1, 0.67, 1.0, 47, 0, 3, 1, 0, 0, 0, 1], "semantic": {"name": "getValueAt", "arg_names": ["self", "row", "col"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def getValueAt(self, row, col):\n if col == 0:\n return '2010'\n return '%s days' % self._employee.count_vacation(2010)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:If_L226_C8", "label": "if", "type": "if", "loc": [226, 227], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L225_C4", "vector": [4, 2, 0.9679, 0.0085, 2, 0.5, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if col == 0:\n return '2010'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Return_L227_C12", "label": "return", "type": "return", "loc": [227, 227], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:If_L226_C8", "vector": [13, 3, 0.9701, 0.0043, 3, 0.36, 0.0, 0, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '2010'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Return_L228_C8", "label": "return", "type": "return", "loc": [228, 228], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L225_C4", "vector": [13, 2, 0.9744, 0.0043, 2, 0.5, 1.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return '%s days' % self._employee.count_vacation(2010)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L231_C0", "label": "ListenerFactory", "type": "function", "loc": [231, 234], "level": 0, "parent": null, "vector": [2, 0, 0.9936, 0.0171, 0, 0.66, 1.0, 87, 0, 2, 1, 0, 0, 0, 7], "semantic": {"name": "ListenerFactory", "arg_names": ["interface", "func"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def ListenerFactory(interface, func):\n from java.lang import Object\n method = list(set(dir(interface)) - set(dir(Object)))[0]\n return type('Listener', (interface,), {method: func})()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:ImportFrom_L232_C4", "label": "from java.lang import Object", "type": "import", "loc": [232, 232], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L231_C0", "vector": [1, 1, 0.9915, 0.0043, 1, 0.07, 0.0, 100, 0, 1, 0, 0, 100, 0, 0], "semantic": {"name": "java.lang", "arg_names": [], "import_names": ["Object"], "rhs_call_name": "", "annotation": ""}, "snippet": " from java.lang import Object"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Assign_L233_C4", "label": "method =", "type": "assigned_variable", "loc": [233, 233], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L231_C0", "vector": [14, 1, 0.9957, 0.0043, 1, 0.07, 0.5, 445, 6, 0, 0, 0, 0, 0, 5], "semantic": {"name": "method", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " method = list(set(dir(interface)) - set(dir(Object)))[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99963:Return_L234_C4", "label": "return", "type": "return", "loc": [234, 234], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L231_C0", "vector": [13, 1, 1.0, 0.0043, 1, 0.07, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return type('Listener', (interface,), {method: func})()"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L10_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Assign_L11_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L13_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L10_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L14_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Assign_L17_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Assign_L18_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Assign_L19_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Assign_L20_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L21_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L22_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L16_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Return_L23_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L25_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L28_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L29_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L28_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L30_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:If_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:If_L37_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L38_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:If_L37_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L39_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:If_L37_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L40_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:If_L37_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Assign_L41_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L47_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Assign_L48_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Assign_L49_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Assign_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L51_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L52_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Assign_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L56_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Return_L58_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L60_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Assign_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L60_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Return_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L65_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L65_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L66_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L69_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L68_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L73_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Assign_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Assign_L78_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L75_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L79_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L73_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L73_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L84_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L84_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Return_L85_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L73_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L87_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L87_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L88_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L73_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Return_L91_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L73_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L93_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L93_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L93_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L95_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L73_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L97_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L73_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L100_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L100_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L101_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L73_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L104_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Return_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L108_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L110_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L110_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L111_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L110_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Assign_L112_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L110_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L113_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L110_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Assign_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L110_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L115_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L110_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L116_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L110_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L117_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L110_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L118_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L110_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L119_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L110_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L120_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L110_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Assign_L121_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L108_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L123_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L123_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Assign_L124_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L123_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L126_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L123_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L127_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L108_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L129_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L130_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Assign_L131_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L129_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L132_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L108_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L134_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L134_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L135_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L134_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Assign_L136_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L134_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L137_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L108_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L139_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L139_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Assign_L140_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L139_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L141_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L139_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L143_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L108_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L145_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L108_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L152_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L152_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L153_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L152_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L154_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L108_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L156_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L156_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L157_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L156_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L158_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L156_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L159_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L156_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L160_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L156_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L161_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L156_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:If_L162_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:If_L162_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Assign_L163_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:If_L162_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L165_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L108_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L170_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L170_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L171_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L170_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L172_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L170_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L173_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L170_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L174_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L170_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L175_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L170_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Assign_L178_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L108_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L180_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L180_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L181_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L108_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L184_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L184_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L185_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L184_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L186_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L184_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L187_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L108_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L189_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L189_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L190_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L189_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L191_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L194_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L196_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L197_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Assign_L198_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Assign_L199_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L196_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L200_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L203_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L205_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L205_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L206_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L205_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Expr_L207_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L210_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Assign_L211_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L210_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L213_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L213_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Assign_L214_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L210_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L216_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L216_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Return_L217_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L210_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L219_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L219_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Return_L220_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L210_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L222_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L222_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Return_L223_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:ClassDef_L210_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L225_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:If_L226_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:If_L226_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Return_L227_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L225_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Return_L228_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L231_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:ImportFrom_L232_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L231_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Assign_L233_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99963:FunctionDef_L231_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99963:Return_L234_C4"}] |
from vacalcapp import VacalcApplication
| ajibawa-2023/Python-Code-Large/train/row_99964 | 1 | 1 | 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_99964:ImportFrom_L1_C0", "label": "from vacalcapp import VacalcApplication", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 1.0, 1.0, 0, 0.66, 0.0, 545, 0, 1, 0, 0, 545, 0, 0], "semantic": {"name": "vacalcapp", "arg_names": [], "import_names": ["VacalcApplication"], "rhs_call_name": "", "annotation": ""}, "snippet": "from vacalcapp import VacalcApplication"}] | [] |
#!/usr/bin/env python
"""Packaging script for Robot Framework
Usage: package.py command version_number [release_tag]
Argument 'command' can have one of the following values:
- sdist : create source distribution
- wininst : create Windows installer
- all : create both packages
- version : update only version information in 'src/robot/version.py'
- jar : create stand-alone jar file containing RF and Jython
'version_number' must be a version number in format '2.x(.y)', 'trunk' or
'keep'. With 'keep', version information is not updated.
'release_tag' must be either 'alpha', 'beta', 'rc' or 'final', where all but
the last one can have a number after the name like 'alpha1' or 'rc2'. When
'version_number' is 'trunk', 'release_tag' is automatically assigned to the
current date.
When creating the jar distribution, jython.jar must be placed in 'ext-lib'
directory, under the project root.
This script uses 'setup.py' internally. Distribution packages are created
under 'dist' directory, which is deleted initially. Depending on your system,
you may need to run this script with administrative rights (e.g. with 'sudo').
Examples:
package.py sdist 2.0 final
package.py wininst keep
package.py all 2.1.13 alpha
package.py sdist trunk
package.py version trunk
"""
import sys
import os
from os.path import abspath, dirname, exists, join
import shutil
import re
import time
import subprocess
import zipfile
from glob import glob
ROOT_PATH = abspath(dirname(__file__))
DIST_PATH = join(ROOT_PATH, 'dist')
BUILD_PATH = join(ROOT_PATH, 'build')
ROBOT_PATH = join(ROOT_PATH, 'src', 'robot')
JAVA_SRC = join(ROOT_PATH, 'src', 'java', 'org', 'robotframework')
JYTHON_JAR = glob(join(ROOT_PATH, 'ext-lib', 'jython-standalone-*.jar'))[0]
SETUP_PATH = join(ROOT_PATH, 'setup.py')
VERSION_PATH = join(ROBOT_PATH, 'version.py')
VERSIONS = [re.compile('^2\.\d+(\.\d+)?$'), 'trunk', 'keep']
RELEASES = [re.compile('^alpha\d*$'), re.compile('^beta\d*$'),
re.compile('^rc\d*$'), 'final']
VERSION_CONTENT = """# Automatically generated by 'package.py' script.
import sys
VERSION = '%(version_number)s'
RELEASE = '%(release_tag)s'
TIMESTAMP = '%(timestamp)s'
def get_version(sep=' '):
if RELEASE == 'final':
return VERSION
return VERSION + sep + RELEASE
def get_full_version(who=''):
sys_version = sys.version.split()[0]
version = '%%s %%s (%%s %%s on %%s)' \\
%% (who, get_version(), _get_interpreter(), sys_version, sys.platform)
return version.strip()
def _get_interpreter():
if sys.platform.startswith('java'):
return 'Jython'
if sys.platform == 'cli':
return 'IronPython'
return 'Python'
"""
def sdist(*version_info):
version(*version_info)
_clean()
_create_sdist()
_announce()
def wininst(*version_info):
version(*version_info)
_clean()
if _verify_platform(*version_info):
_create_wininst()
_announce()
def all(*version_info):
version(*version_info)
_clean()
_create_sdist()
if _verify_platform(*version_info):
_create_wininst()
_announce()
def version(version_number, release_tag=None):
_verify_version(version_number, VERSIONS)
if version_number == 'keep':
_keep_version()
elif version_number =='trunk':
_update_version(version_number, '%d%02d%02d' % time.localtime()[:3])
else:
_update_version(version_number, _verify_version(release_tag, RELEASES))
sys.path.insert(0, ROBOT_PATH)
from version import get_version
return get_version(sep='-')
def _verify_version(given, valid):
for item in valid:
if given == item or (hasattr(item, 'search') and item.search(given)):
return given
raise ValueError
def _update_version(version_number, release_tag):
timestamp = '%d%02d%02d-%02d%02d%02d' % time.localtime()[:6]
vfile = open(VERSION_PATH, 'wb')
vfile.write(VERSION_CONTENT % locals())
vfile.close()
print 'Updated version to %s %s' % (version_number, release_tag)
def _keep_version():
sys.path.insert(0, ROBOT_PATH)
from version import get_version
print 'Keeping version %s' % get_version()
def _clean():
print 'Cleaning up...'
for path in [DIST_PATH, BUILD_PATH]:
if exists(path):
shutil.rmtree(path)
def _verify_platform(version_number, release_tag=None):
if release_tag == 'final' and os.sep != '\\':
print 'Final Windows installers can only be created in Windows.'
print 'Windows installer was not created.'
return False
return True
def _create_sdist():
_create('sdist', 'source distribution')
def _create_wininst():
_create('bdist_wininst', 'Windows installer')
if os.sep != '\\':
print 'Warning: Windows installers created on other platforms may not'
print 'be exactly identical to ones created in Windows.'
def _create(command, name):
print 'Creating %s...' % name
rc = os.system('%s %s %s' % (sys.executable, SETUP_PATH, command))
if rc != 0:
print 'Creating %s failed.' % name
sys.exit(rc)
print '%s created successfully.' % name.capitalize()
def _announce():
print 'Created:'
for path in os.listdir(DIST_PATH):
print abspath(join(DIST_PATH, path))
def jar(*version_info):
ver = version(*version_info)
tmpdir = _create_tmpdir()
_compile_java_classes(tmpdir)
_unzip_jython_jar(tmpdir)
_copy_robot_files(tmpdir)
_compile_all_py_files(tmpdir)
_overwrite_manifest(tmpdir, ver)
jar_path = _create_jar_file(tmpdir, ver)
shutil.rmtree(tmpdir)
print 'Created %s based on %s' % (jar_path, JYTHON_JAR)
def _compile_java_classes(tmpdir):
source_files = [join(JAVA_SRC, f)
for f in os.listdir(JAVA_SRC) if f.endswith('.java')]
print 'Compiling %d source files' % len(source_files)
subprocess.call(['javac', '-d', tmpdir, '-target', '1.5', '-cp', JYTHON_JAR]
+ source_files)
def _create_tmpdir():
tmpdir = join(ROOT_PATH, 'tmp-jar-dir')
if exists(tmpdir):
shutil.rmtree(tmpdir)
os.mkdir(tmpdir)
return tmpdir
def _unzip_jython_jar(tmpdir):
zipfile.ZipFile(JYTHON_JAR).extractall(tmpdir)
def _copy_robot_files(tmpdir):
# pyc files must be excluded so that compileall works properly.
todir = join(tmpdir, 'Lib', 'robot')
shutil.copytree(ROBOT_PATH, todir, ignore=shutil.ignore_patterns('*.pyc*'))
def _compile_all_py_files(tmpdir):
subprocess.call(['java', '-jar', JYTHON_JAR, '-m', 'compileall', tmpdir])
# Jython will not work without its py-files, but robot will
for root, _, files in os.walk(join(tmpdir,'Lib','robot')):
for f in files:
if f.endswith('.py'):
os.remove(join(root, f))
def _overwrite_manifest(tmpdir, version):
with open(join(tmpdir, 'META-INF', 'MANIFEST.MF'), 'w') as mf:
mf.write('''Manifest-Version: 1.0
Main-Class: org.robotframework.RobotFramework
Specification-Version: 2
Implementation-Version: %s
''' % version)
def _create_jar_file(source, version):
path = join(DIST_PATH, 'robotframework-%s.jar' % version)
if not exists(DIST_PATH):
os.mkdir(DIST_PATH)
_fill_jar(source, path)
return path
def _fill_jar(sourcedir, jarpath):
subprocess.call(['jar', 'cvfM', jarpath, '.'], cwd=sourcedir)
if __name__ == '__main__':
try:
globals()[sys.argv[1]](*sys.argv[2:])
except (KeyError, IndexError, TypeError, ValueError):
print __doc__
| ajibawa-2023/Python-Code-Large/train/row_99966 | 138 | 238 | 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_99966:Expr_L3_C0", "label": "expression", "type": "expression", "loc": [3, 35], "level": 0, "parent": null, "vector": [8, 0, 0.0798, 0.1387, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"Packaging script for Robot Framework\n\nUsage: package.py command version_number [release_tag]\n\nArgument 'command' can have one of the following values:\n - sdist : create source distribution\n - wininst : create Windows installer\n - all : create both packages"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Import_L37_C0", "label": "sys import sys", "type": "import", "loc": [37, 37], "level": 0, "parent": null, "vector": [1, 0, 0.1555, 0.0042, 0, 0.66, 0.0233, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Import_L38_C0", "label": "os import os", "type": "import", "loc": [38, 38], "level": 0, "parent": null, "vector": [1, 0, 0.1597, 0.0042, 0, 0.66, 0.0465, 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_99966:ImportFrom_L39_C0", "label": "from os.path import abspath, dirname, exists\u2026", "type": "import", "loc": [39, 39], "level": 0, "parent": null, "vector": [1, 0, 0.1639, 0.0042, 0, 0.66, 0.0698, 79, 0, 4, 0, 0, 79, 0, 0], "semantic": {"name": "os.path", "arg_names": [], "import_names": ["abspath", "dirname", "exists", "join"], "rhs_call_name": "", "annotation": ""}, "snippet": "from os.path import abspath, dirname, exists, join"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Import_L40_C0", "label": "shutil import shutil", "type": "import", "loc": [40, 40], "level": 0, "parent": null, "vector": [1, 0, 0.1681, 0.0042, 0, 0.66, 0.093, 614, 0, 1, 0, 0, 614, 0, 0], "semantic": {"name": "shutil", "arg_names": [], "import_names": ["shutil"], "rhs_call_name": "", "annotation": ""}, "snippet": "import shutil"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Import_L41_C0", "label": "re import re", "type": "import", "loc": [41, 41], "level": 0, "parent": null, "vector": [1, 0, 0.1723, 0.0042, 0, 0.66, 0.1163, 540, 0, 1, 0, 0, 540, 0, 0], "semantic": {"name": "re", "arg_names": [], "import_names": ["re"], "rhs_call_name": "", "annotation": ""}, "snippet": "import re"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Import_L42_C0", "label": "time import time", "type": "import", "loc": [42, 42], "level": 0, "parent": null, "vector": [1, 0, 0.1765, 0.0042, 0, 0.66, 0.1395, 654, 0, 1, 0, 0, 654, 0, 0], "semantic": {"name": "time", "arg_names": [], "import_names": ["time"], "rhs_call_name": "", "annotation": ""}, "snippet": "import time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Import_L43_C0", "label": "subprocess import subprocess", "type": "import", "loc": [43, 43], "level": 0, "parent": null, "vector": [1, 0, 0.1807, 0.0042, 0, 0.66, 0.1628, 394, 0, 1, 0, 0, 394, 0, 0], "semantic": {"name": "subprocess", "arg_names": [], "import_names": ["subprocess"], "rhs_call_name": "", "annotation": ""}, "snippet": "import subprocess"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Import_L44_C0", "label": "zipfile import zipfile", "type": "import", "loc": [44, 44], "level": 0, "parent": null, "vector": [1, 0, 0.1849, 0.0042, 0, 0.66, 0.186, 93, 0, 1, 0, 0, 93, 0, 0], "semantic": {"name": "zipfile", "arg_names": [], "import_names": ["zipfile"], "rhs_call_name": "", "annotation": ""}, "snippet": "import zipfile"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:ImportFrom_L45_C0", "label": "from glob import glob", "type": "import", "loc": [45, 45], "level": 0, "parent": null, "vector": [1, 0, 0.1891, 0.0042, 0, 0.66, 0.2093, 958, 0, 1, 0, 0, 958, 0, 0], "semantic": {"name": "glob", "arg_names": [], "import_names": ["glob"], "rhs_call_name": "", "annotation": ""}, "snippet": "from glob import glob"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Assign_L48_C0", "label": "ROOT_PATH = abspath()", "type": "assigned_variable", "loc": [48, 48], "level": 0, "parent": null, "vector": [14, 0, 0.2017, 0.0042, 0, 0.66, 0.2326, 209, 3, 1, 0, 0, 142, 10, 2], "semantic": {"name": "ROOT_PATH", "arg_names": [], "import_names": [], "rhs_call_name": "abspath", "annotation": ""}, "snippet": "ROOT_PATH = abspath(dirname(__file__))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Assign_L49_C0", "label": "DIST_PATH = join()", "type": "assigned_variable", "loc": [49, 49], "level": 0, "parent": null, "vector": [14, 0, 0.2059, 0.0042, 0, 0.66, 0.2558, 403, 3, 2, 0, 0, 933, 10, 1], "semantic": {"name": "DIST_PATH", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": "DIST_PATH = join(ROOT_PATH, 'dist')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Assign_L50_C0", "label": "BUILD_PATH = join()", "type": "assigned_variable", "loc": [50, 50], "level": 0, "parent": null, "vector": [14, 0, 0.2101, 0.0042, 0, 0.66, 0.2791, 986, 3, 2, 0, 0, 933, 10, 1], "semantic": {"name": "BUILD_PATH", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": "BUILD_PATH = join(ROOT_PATH, 'build')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Assign_L51_C0", "label": "ROBOT_PATH = join()", "type": "assigned_variable", "loc": [51, 51], "level": 0, "parent": null, "vector": [14, 0, 0.2143, 0.0042, 0, 0.66, 0.3023, 924, 3, 3, 0, 0, 933, 10, 1], "semantic": {"name": "ROBOT_PATH", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": "ROBOT_PATH = join(ROOT_PATH, 'src', 'robot')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Assign_L52_C0", "label": "JAVA_SRC = join()", "type": "assigned_variable", "loc": [52, 52], "level": 0, "parent": null, "vector": [14, 0, 0.2185, 0.0042, 0, 0.66, 0.3256, 820, 3, 5, 0, 0, 933, 10, 1], "semantic": {"name": "JAVA_SRC", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": "JAVA_SRC = join(ROOT_PATH, 'src', 'java', 'org', 'robotframework')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Assign_L53_C0", "label": "JYTHON_JAR =", "type": "assigned_variable", "loc": [53, 53], "level": 0, "parent": null, "vector": [14, 0, 0.2227, 0.0042, 0, 0.66, 0.3488, 646, 6, 0, 0, 0, 0, 0, 2], "semantic": {"name": "JYTHON_JAR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "JYTHON_JAR = glob(join(ROOT_PATH, 'ext-lib', 'jython-standalone-*.jar'))[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Assign_L54_C0", "label": "SETUP_PATH = join()", "type": "assigned_variable", "loc": [54, 54], "level": 0, "parent": null, "vector": [14, 0, 0.2269, 0.0042, 0, 0.66, 0.3721, 564, 3, 2, 0, 0, 933, 10, 1], "semantic": {"name": "SETUP_PATH", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": "SETUP_PATH = join(ROOT_PATH, 'setup.py')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Assign_L55_C0", "label": "VERSION_PATH = join()", "type": "assigned_variable", "loc": [55, 55], "level": 0, "parent": null, "vector": [14, 0, 0.2311, 0.0042, 0, 0.66, 0.3953, 619, 3, 2, 0, 0, 933, 10, 1], "semantic": {"name": "VERSION_PATH", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": "VERSION_PATH = join(ROBOT_PATH, 'version.py')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Assign_L56_C0", "label": "VERSIONS =", "type": "assigned_variable", "loc": [56, 56], "level": 0, "parent": null, "vector": [14, 0, 0.2353, 0.0042, 0, 0.66, 0.4186, 669, 0, 0, 0, 0, 0, 5, 1], "semantic": {"name": "VERSIONS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "VERSIONS = [re.compile('^2\\.\\d+(\\.\\d+)?$'), 'trunk', 'keep']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Assign_L57_C0", "label": "RELEASES =", "type": "assigned_variable", "loc": [57, 58], "level": 0, "parent": null, "vector": [14, 0, 0.2416, 0.0084, 0, 0.66, 0.4419, 497, 0, 0, 0, 0, 0, 5, 3], "semantic": {"name": "RELEASES", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "RELEASES = [re.compile('^alpha\\d*$'), re.compile('^beta\\d*$'),\n re.compile('^rc\\d*$'), 'final']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Assign_L59_C0", "label": "VERSION_CONTENT =", "type": "assigned_variable", "loc": [59, 84], "level": 0, "parent": null, "vector": [14, 0, 0.3004, 0.1092, 0, 0.66, 0.4651, 136, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "VERSION_CONTENT", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "VERSION_CONTENT = \"\"\"# Automatically generated by 'package.py' script.\n\nimport sys\n\nVERSION = '%(version_number)s'\nRELEASE = '%(release_tag)s'\nTIMESTAMP = '%(timestamp)s'\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L86_C0", "label": "sdist", "type": "function", "loc": [86, 90], "level": 0, "parent": null, "vector": [2, 0, 0.3697, 0.021, 0, 0.66, 0.4884, 942, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "sdist", "arg_names": ["version_info"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def sdist(*version_info):\n version(*version_info)\n _clean()\n _create_sdist()\n _announce()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L87_C4", "label": "version()", "type": "expression", "loc": [87, 87], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L86_C0", "vector": [8, 1, 0.3655, 0.0042, 1, 0.62, 0.0, 623, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "version", "arg_names": [], "import_names": [], "rhs_call_name": "version", "annotation": ""}, "snippet": " version(*version_info)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L88_C4", "label": "_clean()", "type": "expression", "loc": [88, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L86_C0", "vector": [8, 1, 0.3697, 0.0042, 1, 0.62, 0.3333, 867, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_clean", "arg_names": [], "import_names": [], "rhs_call_name": "_clean", "annotation": ""}, "snippet": " _clean()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L89_C4", "label": "_create_sdist()", "type": "expression", "loc": [89, 89], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L86_C0", "vector": [8, 1, 0.3739, 0.0042, 1, 0.62, 0.6667, 241, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_create_sdist", "arg_names": [], "import_names": [], "rhs_call_name": "_create_sdist", "annotation": ""}, "snippet": " _create_sdist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L90_C4", "label": "_announce()", "type": "expression", "loc": [90, 90], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L86_C0", "vector": [8, 1, 0.3782, 0.0042, 1, 0.62, 1.0, 490, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_announce", "arg_names": [], "import_names": [], "rhs_call_name": "_announce", "annotation": ""}, "snippet": " _announce()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L92_C0", "label": "wininst", "type": "function", "loc": [92, 97], "level": 0, "parent": null, "vector": [2, 0, 0.3971, 0.0252, 0, 0.66, 0.5116, 772, 0, 1, 0, 0, 0, 0, 5], "semantic": {"name": "wininst", "arg_names": ["version_info"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def wininst(*version_info):\n version(*version_info)\n _clean()\n if _verify_platform(*version_info):\n _create_wininst()\n _announce()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L93_C4", "label": "version()", "type": "expression", "loc": [93, 93], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L92_C0", "vector": [8, 1, 0.3908, 0.0042, 1, 0.34, 0.0, 623, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "version", "arg_names": [], "import_names": [], "rhs_call_name": "version", "annotation": ""}, "snippet": " version(*version_info)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L94_C4", "label": "_clean()", "type": "expression", "loc": [94, 94], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L92_C0", "vector": [8, 1, 0.395, 0.0042, 1, 0.34, 0.5, 867, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_clean", "arg_names": [], "import_names": [], "rhs_call_name": "_clean", "annotation": ""}, "snippet": " _clean()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:If_L95_C4", "label": "if", "type": "if", "loc": [95, 97], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L92_C0", "vector": [4, 1, 0.4034, 0.0126, 1, 0.34, 1.0, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if _verify_platform(*version_info):\n _create_wininst()\n _announce()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L96_C8", "label": "_create_wininst()", "type": "expression", "loc": [96, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:If_L95_C4", "vector": [8, 2, 0.4034, 0.0042, 2, 0.15, 0.0, 286, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_create_wininst", "arg_names": [], "import_names": [], "rhs_call_name": "_create_wininst", "annotation": ""}, "snippet": " _create_wininst()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L97_C8", "label": "_announce()", "type": "expression", "loc": [97, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:If_L95_C4", "vector": [8, 2, 0.4076, 0.0042, 2, 0.15, 1.0, 490, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_announce", "arg_names": [], "import_names": [], "rhs_call_name": "_announce", "annotation": ""}, "snippet": " _announce()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L99_C0", "label": "all", "type": "function", "loc": [99, 105], "level": 0, "parent": null, "vector": [2, 0, 0.4286, 0.0294, 0, 0.66, 0.5349, 895, 0, 1, 0, 0, 0, 0, 6], "semantic": {"name": "all", "arg_names": ["version_info"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def all(*version_info):\n version(*version_info)\n _clean()\n _create_sdist()\n if _verify_platform(*version_info):\n _create_wininst()\n _announce()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L100_C4", "label": "version()", "type": "expression", "loc": [100, 100], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L99_C0", "vector": [8, 1, 0.4202, 0.0042, 1, 0.33, 0.0, 623, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "version", "arg_names": [], "import_names": [], "rhs_call_name": "version", "annotation": ""}, "snippet": " version(*version_info)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L101_C4", "label": "_clean()", "type": "expression", "loc": [101, 101], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L99_C0", "vector": [8, 1, 0.4244, 0.0042, 1, 0.33, 0.25, 867, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_clean", "arg_names": [], "import_names": [], "rhs_call_name": "_clean", "annotation": ""}, "snippet": " _clean()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L102_C4", "label": "_create_sdist()", "type": "expression", "loc": [102, 102], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L99_C0", "vector": [8, 1, 0.4286, 0.0042, 1, 0.33, 0.5, 241, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_create_sdist", "arg_names": [], "import_names": [], "rhs_call_name": "_create_sdist", "annotation": ""}, "snippet": " _create_sdist()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:If_L103_C4", "label": "if", "type": "if", "loc": [103, 104], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L99_C0", "vector": [4, 1, 0.4349, 0.0084, 1, 0.33, 0.75, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if _verify_platform(*version_info):\n _create_wininst()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L104_C8", "label": "_create_wininst()", "type": "expression", "loc": [104, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:If_L103_C4", "vector": [8, 2, 0.437, 0.0042, 2, 0.0, 0.0, 286, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_create_wininst", "arg_names": [], "import_names": [], "rhs_call_name": "_create_wininst", "annotation": ""}, "snippet": " _create_wininst()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L105_C4", "label": "_announce()", "type": "expression", "loc": [105, 105], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L99_C0", "vector": [8, 1, 0.4412, 0.0042, 1, 0.33, 1.0, 490, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_announce", "arg_names": [], "import_names": [], "rhs_call_name": "_announce", "annotation": ""}, "snippet": " _announce()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L107_C0", "label": "version", "type": "function", "loc": [107, 117], "level": 0, "parent": null, "vector": [2, 0, 0.4706, 0.0462, 0, 0.66, 0.5581, 623, 0, 2, 1, 0, 0, 0, 8], "semantic": {"name": "version", "arg_names": ["version_number", "release_tag"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def version(version_number, release_tag=None):\n _verify_version(version_number, VERSIONS)\n if version_number == 'keep':\n _keep_version()\n elif version_number =='trunk':\n _update_version(version_number, '%d%02d%02d' % time.localtime()[:3])\n else:\n _update_version(version_number, _verify_version(release_tag, RELEASES))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L108_C4", "label": "_verify_version()", "type": "expression", "loc": [108, 108], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L107_C0", "vector": [8, 1, 0.4538, 0.0042, 1, 0.44, 0.0, 968, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_verify_version", "arg_names": [], "import_names": [], "rhs_call_name": "_verify_version", "annotation": ""}, "snippet": " _verify_version(version_number, VERSIONS)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:If_L109_C4", "label": "if", "type": "if", "loc": [109, 114], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L107_C0", "vector": [4, 1, 0.4685, 0.0252, 1, 0.44, 0.25, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if version_number == 'keep':\n _keep_version()\n elif version_number =='trunk':\n _update_version(version_number, '%d%02d%02d' % time.localtime()[:3])\n else:\n _update_version(version_number, _verify_version(release_tag, RELEASES))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L110_C8", "label": "_keep_version()", "type": "expression", "loc": [110, 110], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:If_L109_C4", "vector": [8, 2, 0.4622, 0.0042, 2, 0.8, 0.0, 312, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_keep_version", "arg_names": [], "import_names": [], "rhs_call_name": "_keep_version", "annotation": ""}, "snippet": " _keep_version()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:If_L111_C4", "label": "if", "type": "if", "loc": [111, 114], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:If_L109_C4", "vector": [4, 2, 0.4727, 0.0168, 2, 0.8, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif version_number =='trunk':\n _update_version(version_number, '%d%02d%02d' % time.localtime()[:3])\n else:\n _update_version(version_number, _verify_version(release_tag, RELEASES))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L112_C8", "label": "_update_version()", "type": "expression", "loc": [112, 112], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:If_L111_C4", "vector": [8, 3, 0.4706, 0.0042, 3, 0.53, 0.0, 431, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "_update_version", "arg_names": [], "import_names": [], "rhs_call_name": "_update_version", "annotation": ""}, "snippet": " _update_version(version_number, '%d%02d%02d' % time.localtime()[:3])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L114_C8", "label": "_update_version()", "type": "expression", "loc": [114, 114], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:If_L111_C4", "vector": [8, 3, 0.479, 0.0042, 3, 0.53, 1.0, 431, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "_update_version", "arg_names": [], "import_names": [], "rhs_call_name": "_update_version", "annotation": ""}, "snippet": " _update_version(version_number, _verify_version(release_tag, RELEASES))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L115_C4", "label": "insert()", "type": "expression", "loc": [115, 115], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L107_C0", "vector": [8, 1, 0.4832, 0.0042, 1, 0.44, 0.5, 368, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "insert", "arg_names": [], "import_names": [], "rhs_call_name": "insert", "annotation": ""}, "snippet": " sys.path.insert(0, ROBOT_PATH)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:ImportFrom_L116_C4", "label": "from version import get_version", "type": "import", "loc": [116, 116], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L107_C0", "vector": [1, 1, 0.4874, 0.0042, 1, 0.44, 0.75, 623, 0, 1, 0, 0, 623, 0, 0], "semantic": {"name": "version", "arg_names": [], "import_names": ["get_version"], "rhs_call_name": "", "annotation": ""}, "snippet": " from version import get_version"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Return_L117_C4", "label": "return", "type": "return", "loc": [117, 117], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L107_C0", "vector": [13, 1, 0.4916, 0.0042, 1, 0.44, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return get_version(sep='-')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L119_C0", "label": "_verify_version", "type": "function", "loc": [119, 123], "level": 0, "parent": null, "vector": [2, 0, 0.5084, 0.021, 0, 0.66, 0.5814, 968, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "_verify_version", "arg_names": ["given", "valid"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _verify_version(given, valid):\n for item in valid:\n if given == item or (hasattr(item, 'search') and item.search(given)):\n return given\n raise ValueError"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:For_L120_C4", "label": "for item", "type": "for", "loc": [120, 122], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L119_C0", "vector": [6, 1, 0.5084, 0.0126, 1, 0.47, 0.0, 434, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "item", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for item in valid:\n if given == item or (hasattr(item, 'search') and item.search(given)):\n return given"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:If_L121_C8", "label": "if", "type": "if", "loc": [121, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:For_L120_C4", "vector": [4, 2, 0.5105, 0.0084, 2, 0.96, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if given == item or (hasattr(item, 'search') and item.search(given)):\n return given"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Return_L122_C12", "label": "return", "type": "return", "loc": [122, 122], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:If_L121_C8", "vector": [13, 3, 0.5126, 0.0042, 3, 0.81, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return given"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L125_C0", "label": "_update_version", "type": "function", "loc": [125, 130], "level": 0, "parent": null, "vector": [2, 0, 0.5357, 0.0252, 0, 0.66, 0.6047, 431, 0, 2, 0, 0, 0, 0, 6], "semantic": {"name": "_update_version", "arg_names": ["version_number", "release_tag"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _update_version(version_number, release_tag):\n timestamp = '%d%02d%02d-%02d%02d%02d' % time.localtime()[:6]\n vfile = open(VERSION_PATH, 'wb')\n vfile.write(VERSION_CONTENT % locals())\n vfile.close()\n print('Updated version to %s %s' % (version_number, release_tag))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Assign_L126_C4", "label": "timestamp =", "type": "assigned_variable", "loc": [126, 126], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L125_C0", "vector": [14, 1, 0.5294, 0.0042, 1, 0.94, 0.0, 834, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "timestamp", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " timestamp = '%d%02d%02d-%02d%02d%02d' % time.localtime()[:6]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Assign_L127_C4", "label": "vfile = open()", "type": "assigned_variable", "loc": [127, 127], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L125_C0", "vector": [14, 1, 0.5336, 0.0042, 1, 0.94, 0.25, 192, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "vfile", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": " vfile = open(VERSION_PATH, 'wb')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L128_C4", "label": "write()", "type": "expression", "loc": [128, 128], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L125_C0", "vector": [8, 1, 0.5378, 0.0042, 1, 0.94, 0.5, 837, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " vfile.write(VERSION_CONTENT % locals())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L129_C4", "label": "close()", "type": "expression", "loc": [129, 129], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L125_C0", "vector": [8, 1, 0.542, 0.0042, 1, 0.94, 0.75, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " vfile.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L130_C4", "label": "print()", "type": "expression", "loc": [130, 130], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L125_C0", "vector": [8, 1, 0.5462, 0.0042, 1, 0.94, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Updated version to %s %s' % (version_number, release_tag))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L132_C0", "label": "_keep_version", "type": "function", "loc": [132, 135], "level": 0, "parent": null, "vector": [2, 0, 0.5609, 0.0168, 0, 0.66, 0.6279, 312, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "_keep_version", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _keep_version():\n sys.path.insert(0, ROBOT_PATH)\n from version import get_version\n print('Keeping version %s' % get_version())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L133_C4", "label": "insert()", "type": "expression", "loc": [133, 133], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L132_C0", "vector": [8, 1, 0.5588, 0.0042, 1, 0.69, 0.0, 368, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "insert", "arg_names": [], "import_names": [], "rhs_call_name": "insert", "annotation": ""}, "snippet": " sys.path.insert(0, ROBOT_PATH)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:ImportFrom_L134_C4", "label": "from version import get_version", "type": "import", "loc": [134, 134], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L132_C0", "vector": [1, 1, 0.563, 0.0042, 1, 0.69, 0.5, 623, 0, 1, 0, 0, 623, 0, 0], "semantic": {"name": "version", "arg_names": [], "import_names": ["get_version"], "rhs_call_name": "", "annotation": ""}, "snippet": " from version import get_version"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L135_C4", "label": "print()", "type": "expression", "loc": [135, 135], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L132_C0", "vector": [8, 1, 0.5672, 0.0042, 1, 0.69, 1.0, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Keeping version %s' % get_version())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L137_C0", "label": "_clean", "type": "function", "loc": [137, 141], "level": 0, "parent": null, "vector": [2, 0, 0.584, 0.021, 0, 0.66, 0.6512, 867, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "_clean", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _clean():\n print('Cleaning up...')\n for path in [DIST_PATH, BUILD_PATH]:\n if exists(path):\n shutil.rmtree(path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L138_C4", "label": "print()", "type": "expression", "loc": [138, 138], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L137_C0", "vector": [8, 1, 0.5798, 0.0042, 1, 0.91, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Cleaning up...')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:For_L139_C4", "label": "for path", "type": "for", "loc": [139, 141], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L137_C0", "vector": [6, 1, 0.5882, 0.0126, 1, 0.91, 1.0, 358, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "path", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for path in [DIST_PATH, BUILD_PATH]:\n if exists(path):\n shutil.rmtree(path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:If_L140_C8", "label": "if", "type": "if", "loc": [140, 141], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:For_L139_C4", "vector": [4, 2, 0.5903, 0.0084, 2, 0.14, 0.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if exists(path):\n shutil.rmtree(path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L141_C12", "label": "rmtree()", "type": "expression", "loc": [141, 141], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:If_L140_C8", "vector": [8, 3, 0.5924, 0.0042, 3, 0.78, 0.0, 317, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "rmtree", "arg_names": [], "import_names": [], "rhs_call_name": "rmtree", "annotation": ""}, "snippet": " shutil.rmtree(path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L143_C0", "label": "_verify_platform", "type": "function", "loc": [143, 148], "level": 0, "parent": null, "vector": [2, 0, 0.6113, 0.0252, 0, 0.66, 0.6744, 961, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "_verify_platform", "arg_names": ["version_number", "release_tag"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _verify_platform(version_number, release_tag=None):\n if release_tag == 'final' and os.sep != '\\\\':\n print('Final Windows installers can only be created in Windows.')\n print('Windows installer was not created.')\n return False\n return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:If_L144_C4", "label": "if", "type": "if", "loc": [144, 147], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L143_C0", "vector": [4, 1, 0.6113, 0.0168, 1, 0.54, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if release_tag == 'final' and os.sep != '\\\\':\n print('Final Windows installers can only be created in Windows.')\n print('Windows installer was not created.')\n return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L145_C8", "label": "print()", "type": "expression", "loc": [145, 145], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:If_L144_C4", "vector": [8, 2, 0.6092, 0.0042, 2, 0.46, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Final Windows installers can only be created in Windows.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L146_C8", "label": "print()", "type": "expression", "loc": [146, 146], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:If_L144_C4", "vector": [8, 2, 0.6134, 0.0042, 2, 0.46, 0.5, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Windows installer was not created.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Return_L147_C8", "label": "return", "type": "return", "loc": [147, 147], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:If_L144_C4", "vector": [13, 2, 0.6176, 0.0042, 2, 0.46, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return False"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Return_L148_C4", "label": "return", "type": "return", "loc": [148, 148], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L143_C0", "vector": [13, 1, 0.6218, 0.0042, 1, 0.54, 1.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L150_C0", "label": "_create_sdist", "type": "function", "loc": [150, 151], "level": 0, "parent": null, "vector": [2, 0, 0.6324, 0.0084, 0, 0.66, 0.6977, 241, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "_create_sdist", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _create_sdist():\n _create('sdist', 'source distribution')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L151_C4", "label": "_create()", "type": "expression", "loc": [151, 151], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L150_C0", "vector": [8, 1, 0.6345, 0.0042, 1, 0.17, 0.0, 533, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_create", "arg_names": [], "import_names": [], "rhs_call_name": "_create", "annotation": ""}, "snippet": " _create('sdist', 'source distribution')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L153_C0", "label": "_create_wininst", "type": "function", "loc": [153, 157], "level": 0, "parent": null, "vector": [2, 0, 0.6513, 0.021, 0, 0.66, 0.7209, 286, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "_create_wininst", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _create_wininst():\n _create('bdist_wininst', 'Windows installer')\n if os.sep != '\\\\':\n print('Warning: Windows installers created on other platforms may not')\n print('be exactly identical to ones created in Windows.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L154_C4", "label": "_create()", "type": "expression", "loc": [154, 154], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L153_C0", "vector": [8, 1, 0.6471, 0.0042, 1, 0.59, 0.0, 533, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_create", "arg_names": [], "import_names": [], "rhs_call_name": "_create", "annotation": ""}, "snippet": " _create('bdist_wininst', 'Windows installer')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:If_L155_C4", "label": "if", "type": "if", "loc": [155, 157], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L153_C0", "vector": [4, 1, 0.6555, 0.0126, 1, 0.59, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if os.sep != '\\\\':\n print('Warning: Windows installers created on other platforms may not')\n print('be exactly identical to ones created in Windows.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L156_C8", "label": "print()", "type": "expression", "loc": [156, 156], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:If_L155_C4", "vector": [8, 2, 0.6555, 0.0042, 2, 0.37, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Warning: Windows installers created on other platforms may not')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L157_C8", "label": "print()", "type": "expression", "loc": [157, 157], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:If_L155_C4", "vector": [8, 2, 0.6597, 0.0042, 2, 0.37, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('be exactly identical to ones created in Windows.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L159_C0", "label": "_create", "type": "function", "loc": [159, 165], "level": 0, "parent": null, "vector": [2, 0, 0.6807, 0.0294, 0, 0.66, 0.7442, 533, 0, 2, 0, 0, 0, 0, 6], "semantic": {"name": "_create", "arg_names": ["command", "name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _create(command, name):\n print('Creating %s...' % name)\n rc = os.system('%s %s %s' % (sys.executable, SETUP_PATH, command))\n if rc != 0:\n print('Creating %s failed.' % name)\n sys.exit(rc)\n print('%s created successfully.' % name.capitalize())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L160_C4", "label": "print()", "type": "expression", "loc": [160, 160], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L159_C0", "vector": [8, 1, 0.6723, 0.0042, 1, 0.96, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Creating %s...' % name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Assign_L161_C4", "label": "rc = system()", "type": "assigned_variable", "loc": [161, 161], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L159_C0", "vector": [14, 1, 0.6765, 0.0042, 1, 0.96, 0.3333, 401, 3, 1, 0, 0, 856, 10, 1], "semantic": {"name": "rc", "arg_names": [], "import_names": [], "rhs_call_name": "system", "annotation": ""}, "snippet": " rc = os.system('%s %s %s' % (sys.executable, SETUP_PATH, command))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:If_L162_C4", "label": "if", "type": "if", "loc": [162, 164], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L159_C0", "vector": [4, 1, 0.6849, 0.0126, 1, 0.96, 0.6667, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if rc != 0:\n print('Creating %s failed.' % name)\n sys.exit(rc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L163_C8", "label": "print()", "type": "expression", "loc": [163, 163], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:If_L162_C4", "vector": [8, 2, 0.6849, 0.0042, 2, 0.35, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Creating %s failed.' % name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L164_C8", "label": "exit()", "type": "expression", "loc": [164, 164], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:If_L162_C4", "vector": [8, 2, 0.6891, 0.0042, 2, 0.35, 1.0, 436, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "exit", "arg_names": [], "import_names": [], "rhs_call_name": "exit", "annotation": ""}, "snippet": " sys.exit(rc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L165_C4", "label": "print()", "type": "expression", "loc": [165, 165], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L159_C0", "vector": [8, 1, 0.6933, 0.0042, 1, 0.96, 1.0, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('%s created successfully.' % name.capitalize())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L167_C0", "label": "_announce", "type": "function", "loc": [167, 170], "level": 0, "parent": null, "vector": [2, 0, 0.708, 0.0168, 0, 0.66, 0.7674, 490, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "_announce", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _announce():\n print('Created:')\n for path in os.listdir(DIST_PATH):\n print(abspath(join(DIST_PATH, path)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L168_C4", "label": "print()", "type": "expression", "loc": [168, 168], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L167_C0", "vector": [8, 1, 0.7059, 0.0042, 1, 0.17, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Created:')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:For_L169_C4", "label": "for path", "type": "for", "loc": [169, 170], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L167_C0", "vector": [6, 1, 0.7122, 0.0084, 1, 0.17, 1.0, 358, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "path", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for path in os.listdir(DIST_PATH):\n print(abspath(join(DIST_PATH, path)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L170_C8", "label": "print()", "type": "expression", "loc": [170, 170], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:For_L169_C4", "vector": [8, 2, 0.7143, 0.0042, 2, 0.98, 0.0, 535, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(abspath(join(DIST_PATH, path)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L172_C0", "label": "jar", "type": "function", "loc": [172, 182], "level": 0, "parent": null, "vector": [2, 0, 0.7437, 0.0462, 0, 0.66, 0.7907, 63, 0, 1, 0, 0, 0, 0, 10], "semantic": {"name": "jar", "arg_names": ["version_info"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def jar(*version_info):\n ver = version(*version_info)\n tmpdir = _create_tmpdir()\n _compile_java_classes(tmpdir)\n _unzip_jython_jar(tmpdir)\n _copy_robot_files(tmpdir)\n _compile_all_py_files(tmpdir)\n _overwrite_manifest(tmpdir, ver)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Assign_L173_C4", "label": "ver = version()", "type": "assigned_variable", "loc": [173, 173], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L172_C0", "vector": [14, 1, 0.7269, 0.0042, 1, 0.97, 0.0, 648, 3, 1, 0, 0, 623, 10, 1], "semantic": {"name": "ver", "arg_names": [], "import_names": [], "rhs_call_name": "version", "annotation": ""}, "snippet": " ver = version(*version_info)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Assign_L174_C4", "label": "tmpdir = _create_tmpdir()", "type": "assigned_variable", "loc": [174, 174], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L172_C0", "vector": [14, 1, 0.7311, 0.0042, 1, 0.97, 0.1111, 466, 3, 0, 0, 0, 5, 10, 1], "semantic": {"name": "tmpdir", "arg_names": [], "import_names": [], "rhs_call_name": "_create_tmpdir", "annotation": ""}, "snippet": " tmpdir = _create_tmpdir()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L175_C4", "label": "_compile_java_classes()", "type": "expression", "loc": [175, 175], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L172_C0", "vector": [8, 1, 0.7353, 0.0042, 1, 0.97, 0.2222, 822, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_compile_java_classes", "arg_names": [], "import_names": [], "rhs_call_name": "_compile_java_classes", "annotation": ""}, "snippet": " _compile_java_classes(tmpdir)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L176_C4", "label": "_unzip_jython_jar()", "type": "expression", "loc": [176, 176], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L172_C0", "vector": [8, 1, 0.7395, 0.0042, 1, 0.97, 0.3333, 221, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_unzip_jython_jar", "arg_names": [], "import_names": [], "rhs_call_name": "_unzip_jython_jar", "annotation": ""}, "snippet": " _unzip_jython_jar(tmpdir)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L177_C4", "label": "_copy_robot_files()", "type": "expression", "loc": [177, 177], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L172_C0", "vector": [8, 1, 0.7437, 0.0042, 1, 0.97, 0.4444, 132, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_copy_robot_files", "arg_names": [], "import_names": [], "rhs_call_name": "_copy_robot_files", "annotation": ""}, "snippet": " _copy_robot_files(tmpdir)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L178_C4", "label": "_compile_all_py_files()", "type": "expression", "loc": [178, 178], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L172_C0", "vector": [8, 1, 0.7479, 0.0042, 1, 0.97, 0.5556, 183, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_compile_all_py_files", "arg_names": [], "import_names": [], "rhs_call_name": "_compile_all_py_files", "annotation": ""}, "snippet": " _compile_all_py_files(tmpdir)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L179_C4", "label": "_overwrite_manifest()", "type": "expression", "loc": [179, 179], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L172_C0", "vector": [8, 1, 0.7521, 0.0042, 1, 0.97, 0.6667, 226, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_overwrite_manifest", "arg_names": [], "import_names": [], "rhs_call_name": "_overwrite_manifest", "annotation": ""}, "snippet": " _overwrite_manifest(tmpdir, ver)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Assign_L180_C4", "label": "jar_path = _create_jar_file()", "type": "assigned_variable", "loc": [180, 180], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L172_C0", "vector": [14, 1, 0.7563, 0.0042, 1, 0.97, 0.7778, 484, 3, 2, 0, 0, 289, 10, 1], "semantic": {"name": "jar_path", "arg_names": [], "import_names": [], "rhs_call_name": "_create_jar_file", "annotation": ""}, "snippet": " jar_path = _create_jar_file(tmpdir, ver)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L181_C4", "label": "rmtree()", "type": "expression", "loc": [181, 181], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L172_C0", "vector": [8, 1, 0.7605, 0.0042, 1, 0.97, 0.8889, 317, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "rmtree", "arg_names": [], "import_names": [], "rhs_call_name": "rmtree", "annotation": ""}, "snippet": " shutil.rmtree(tmpdir)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L182_C4", "label": "print()", "type": "expression", "loc": [182, 182], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L172_C0", "vector": [8, 1, 0.7647, 0.0042, 1, 0.97, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Created %s based on %s' % (jar_path, JYTHON_JAR))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L184_C0", "label": "_compile_java_classes", "type": "function", "loc": [184, 189], "level": 0, "parent": null, "vector": [2, 0, 0.7836, 0.0252, 0, 0.66, 0.814, 822, 0, 1, 0, 0, 0, 0, 6], "semantic": {"name": "_compile_java_classes", "arg_names": ["tmpdir"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _compile_java_classes(tmpdir):\n source_files = [join(JAVA_SRC, f)\n for f in os.listdir(JAVA_SRC) if f.endswith('.java')]\n print('Compiling %d source files' % len(source_files))\n subprocess.call(['javac', '-d', tmpdir, '-target', '1.5', '-cp', JYTHON_JAR]\n + source_files)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Assign_L185_C4", "label": "source_files =", "type": "assigned_variable", "loc": [185, 186], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L184_C0", "vector": [14, 1, 0.7794, 0.0084, 1, 0.81, 0.0, 984, 5, 0, 0, 0, 0, 0, 3], "semantic": {"name": "source_files", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " source_files = [join(JAVA_SRC, f)\n for f in os.listdir(JAVA_SRC) if f.endswith('.java')]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L187_C4", "label": "print()", "type": "expression", "loc": [187, 187], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L184_C0", "vector": [8, 1, 0.7857, 0.0042, 1, 0.81, 0.5, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Compiling %d source files' % len(source_files))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L188_C4", "label": "call()", "type": "expression", "loc": [188, 189], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L184_C0", "vector": [8, 1, 0.792, 0.0084, 1, 0.81, 1.0, 832, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "call", "arg_names": [], "import_names": [], "rhs_call_name": "call", "annotation": ""}, "snippet": " subprocess.call(['javac', '-d', tmpdir, '-target', '1.5', '-cp', JYTHON_JAR]\n + source_files)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L191_C0", "label": "_create_tmpdir", "type": "function", "loc": [191, 196], "level": 0, "parent": null, "vector": [2, 0, 0.813, 0.0252, 0, 0.66, 0.8372, 5, 0, 0, 1, 0, 0, 0, 4], "semantic": {"name": "_create_tmpdir", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _create_tmpdir():\n tmpdir = join(ROOT_PATH, 'tmp-jar-dir')\n if exists(tmpdir):\n shutil.rmtree(tmpdir)\n os.mkdir(tmpdir)\n return tmpdir"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Assign_L192_C4", "label": "tmpdir = join()", "type": "assigned_variable", "loc": [192, 192], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L191_C0", "vector": [14, 1, 0.8067, 0.0042, 1, 0.62, 0.0, 466, 3, 2, 0, 0, 933, 10, 1], "semantic": {"name": "tmpdir", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " tmpdir = join(ROOT_PATH, 'tmp-jar-dir')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:If_L193_C4", "label": "if", "type": "if", "loc": [193, 194], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L191_C0", "vector": [4, 1, 0.813, 0.0084, 1, 0.62, 0.3333, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if exists(tmpdir):\n shutil.rmtree(tmpdir)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L194_C8", "label": "rmtree()", "type": "expression", "loc": [194, 194], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:If_L193_C4", "vector": [8, 2, 0.8151, 0.0042, 2, 0.3, 0.0, 317, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "rmtree", "arg_names": [], "import_names": [], "rhs_call_name": "rmtree", "annotation": ""}, "snippet": " shutil.rmtree(tmpdir)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L195_C4", "label": "mkdir()", "type": "expression", "loc": [195, 195], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L191_C0", "vector": [8, 1, 0.8193, 0.0042, 1, 0.62, 0.6667, 853, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "mkdir", "arg_names": [], "import_names": [], "rhs_call_name": "mkdir", "annotation": ""}, "snippet": " os.mkdir(tmpdir)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Return_L196_C4", "label": "return", "type": "return", "loc": [196, 196], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L191_C0", "vector": [13, 1, 0.8235, 0.0042, 1, 0.62, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return tmpdir"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L198_C0", "label": "_unzip_jython_jar", "type": "function", "loc": [198, 199], "level": 0, "parent": null, "vector": [2, 0, 0.834, 0.0084, 0, 0.66, 0.8605, 221, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "_unzip_jython_jar", "arg_names": ["tmpdir"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _unzip_jython_jar(tmpdir):\n zipfile.ZipFile(JYTHON_JAR).extractall(tmpdir)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L199_C4", "label": "extractall()", "type": "expression", "loc": [199, 199], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L198_C0", "vector": [8, 1, 0.8361, 0.0042, 1, 0.3, 0.0, 92, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "extractall", "arg_names": [], "import_names": [], "rhs_call_name": "extractall", "annotation": ""}, "snippet": " zipfile.ZipFile(JYTHON_JAR).extractall(tmpdir)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L201_C0", "label": "_copy_robot_files", "type": "function", "loc": [201, 204], "level": 0, "parent": null, "vector": [2, 0, 0.8508, 0.0168, 0, 0.66, 0.8837, 132, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "_copy_robot_files", "arg_names": ["tmpdir"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _copy_robot_files(tmpdir):\n # pyc files must be excluded so that compileall works properly.\n todir = join(tmpdir, 'Lib', 'robot')\n shutil.copytree(ROBOT_PATH, todir, ignore=shutil.ignore_patterns('*.pyc*'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Assign_L203_C4", "label": "todir = join()", "type": "assigned_variable", "loc": [203, 203], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L201_C0", "vector": [14, 1, 0.8529, 0.0042, 1, 0.75, 0.0, 823, 3, 3, 0, 0, 933, 10, 1], "semantic": {"name": "todir", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " todir = join(tmpdir, 'Lib', 'robot')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L204_C4", "label": "copytree()", "type": "expression", "loc": [204, 204], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L201_C0", "vector": [8, 1, 0.8571, 0.0042, 1, 0.75, 1.0, 739, 3, 3, 0, 0, 0, 0, 2], "semantic": {"name": "copytree", "arg_names": [], "import_names": [], "rhs_call_name": "copytree", "annotation": ""}, "snippet": " shutil.copytree(ROBOT_PATH, todir, ignore=shutil.ignore_patterns('*.pyc*'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L206_C0", "label": "_compile_all_py_files", "type": "function", "loc": [206, 212], "level": 0, "parent": null, "vector": [2, 0, 0.8782, 0.0294, 0, 0.66, 0.907, 183, 0, 1, 0, 0, 0, 0, 6], "semantic": {"name": "_compile_all_py_files", "arg_names": ["tmpdir"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _compile_all_py_files(tmpdir):\n subprocess.call(['java', '-jar', JYTHON_JAR, '-m', 'compileall', tmpdir])\n # Jython will not work without its py-files, but robot will\n for root, _, files in os.walk(join(tmpdir,'Lib','robot')):\n for f in files:\n if f.endswith('.py'):\n os.remove(join(root, f))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L207_C4", "label": "call()", "type": "expression", "loc": [207, 207], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L206_C0", "vector": [8, 1, 0.8697, 0.0042, 1, 0.12, 0.0, 832, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "call", "arg_names": [], "import_names": [], "rhs_call_name": "call", "annotation": ""}, "snippet": " subprocess.call(['java', '-jar', JYTHON_JAR, '-m', 'compileall', tmpdir])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:For_L209_C4", "label": "for root, _, files", "type": "for", "loc": [209, 212], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L206_C0", "vector": [6, 1, 0.8845, 0.0168, 1, 0.12, 1.0, 653, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "root, _, files", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for root, _, files in os.walk(join(tmpdir,'Lib','robot')):\n for f in files:\n if f.endswith('.py'):\n os.remove(join(root, f))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:For_L210_C8", "label": "for f", "type": "for", "loc": [210, 212], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:For_L209_C4", "vector": [6, 2, 0.8866, 0.0126, 2, 0.93, 0.0, 899, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for f in files:\n if f.endswith('.py'):\n os.remove(join(root, f))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:If_L211_C12", "label": "if", "type": "if", "loc": [211, 212], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:For_L210_C8", "vector": [4, 3, 0.8887, 0.0084, 3, 0.53, 0.0, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if f.endswith('.py'):\n os.remove(join(root, f))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L212_C16", "label": "remove()", "type": "expression", "loc": [212, 212], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:If_L211_C12", "vector": [8, 4, 0.8908, 0.0042, 4, 0.92, 0.0, 185, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "remove", "arg_names": [], "import_names": [], "rhs_call_name": "remove", "annotation": ""}, "snippet": " os.remove(join(root, f))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L214_C0", "label": "_overwrite_manifest", "type": "function", "loc": [214, 220], "level": 0, "parent": null, "vector": [2, 0, 0.9118, 0.0294, 0, 0.66, 0.9302, 226, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "_overwrite_manifest", "arg_names": ["tmpdir", "version"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _overwrite_manifest(tmpdir, version):\n with open(join(tmpdir, 'META-INF', 'MANIFEST.MF'), 'w') as mf:\n mf.write('''Manifest-Version: 1.0\nMain-Class: org.robotframework.RobotFramework\nSpecification-Version: 2\nImplementation-Version: %s\n''' % version)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L216_C8", "label": "write()", "type": "expression", "loc": [216, 220], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L214_C0", "vector": [8, 1, 0.916, 0.021, 1, 0.89, 0.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " mf.write('''Manifest-Version: 1.0\nMain-Class: org.robotframework.RobotFramework\nSpecification-Version: 2\nImplementation-Version: %s\n''' % version)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L222_C0", "label": "_create_jar_file", "type": "function", "loc": [222, 227], "level": 0, "parent": null, "vector": [2, 0, 0.9433, 0.0252, 0, 0.66, 0.9535, 289, 0, 2, 1, 0, 0, 0, 4], "semantic": {"name": "_create_jar_file", "arg_names": ["source", "version"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _create_jar_file(source, version):\n path = join(DIST_PATH, 'robotframework-%s.jar' % version)\n if not exists(DIST_PATH):\n os.mkdir(DIST_PATH)\n _fill_jar(source, path)\n return path"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Assign_L223_C4", "label": "path = join()", "type": "assigned_variable", "loc": [223, 223], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L222_C0", "vector": [14, 1, 0.937, 0.0042, 1, 0.29, 0.0, 358, 3, 2, 0, 0, 933, 10, 1], "semantic": {"name": "path", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " path = join(DIST_PATH, 'robotframework-%s.jar' % version)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:If_L224_C4", "label": "if", "type": "if", "loc": [224, 225], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L222_C0", "vector": [4, 1, 0.9433, 0.0084, 1, 0.29, 0.3333, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not exists(DIST_PATH):\n os.mkdir(DIST_PATH)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L225_C8", "label": "mkdir()", "type": "expression", "loc": [225, 225], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:If_L224_C4", "vector": [8, 2, 0.9454, 0.0042, 2, 0.36, 0.0, 853, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "mkdir", "arg_names": [], "import_names": [], "rhs_call_name": "mkdir", "annotation": ""}, "snippet": " os.mkdir(DIST_PATH)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L226_C4", "label": "_fill_jar()", "type": "expression", "loc": [226, 226], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L222_C0", "vector": [8, 1, 0.9496, 0.0042, 1, 0.29, 0.6667, 619, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_fill_jar", "arg_names": [], "import_names": [], "rhs_call_name": "_fill_jar", "annotation": ""}, "snippet": " _fill_jar(source, path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Return_L227_C4", "label": "return", "type": "return", "loc": [227, 227], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L222_C0", "vector": [13, 1, 0.9538, 0.0042, 1, 0.29, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return path"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L229_C0", "label": "_fill_jar", "type": "function", "loc": [229, 230], "level": 0, "parent": null, "vector": [2, 0, 0.9643, 0.0084, 0, 0.66, 0.9767, 619, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "_fill_jar", "arg_names": ["sourcedir", "jarpath"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def _fill_jar(sourcedir, jarpath):\n subprocess.call(['jar', 'cvfM', jarpath, '.'], cwd=sourcedir)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L230_C4", "label": "call()", "type": "expression", "loc": [230, 230], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L229_C0", "vector": [8, 1, 0.9664, 0.0042, 1, 0.38, 0.0, 832, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "call", "arg_names": [], "import_names": [], "rhs_call_name": "call", "annotation": ""}, "snippet": " subprocess.call(['jar', 'cvfM', jarpath, '.'], cwd=sourcedir)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:If_L233_C0", "label": "if", "type": "if", "loc": [233, 237], "level": 0, "parent": null, "vector": [4, 0, 0.9874, 0.021, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n try:\n globals()[sys.argv[1]](*sys.argv[2:])\n except (KeyError, IndexError, TypeError, ValueError):\n print(__doc__)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Try_L234_C4", "label": "try", "type": "try", "loc": [234, 237], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:If_L233_C0", "vector": [7, 1, 0.9895, 0.0168, 1, 0.14, 0.0, 0, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n globals()[sys.argv[1]](*sys.argv[2:])\n except (KeyError, IndexError, TypeError, ValueError):\n print(__doc__)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L235_C8", "label": "expression", "type": "expression", "loc": [235, 235], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:Try_L234_C4", "vector": [8, 2, 0.9874, 0.0042, 2, 0.52, 0.0, 0, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " globals()[sys.argv[1]](*sys.argv[2:])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L237_C8", "label": "print()", "type": "expression", "loc": [237, 237], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99966:Try_L234_C4", "vector": [8, 2, 0.9958, 0.0042, 2, 0.52, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(__doc__)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L87_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L88_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L89_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L86_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L92_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L93_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L92_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L94_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L92_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:If_L95_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:If_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:If_L95_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L97_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L99_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L100_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L99_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L101_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L99_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L99_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:If_L103_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:If_L103_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L104_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L99_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L105_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L107_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L108_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L107_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:If_L109_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:If_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L110_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:If_L109_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:If_L111_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:If_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L112_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:If_L111_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L114_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L107_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L115_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L107_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:ImportFrom_L116_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L107_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Return_L117_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L119_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:For_L120_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:For_L120_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:If_L121_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:If_L121_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Return_L122_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L125_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Assign_L126_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L125_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Assign_L127_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L125_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L128_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L125_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L129_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L125_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L130_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L132_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L133_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L132_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:ImportFrom_L134_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L132_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L135_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L137_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L138_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L137_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:For_L139_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:For_L139_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:If_L140_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:If_L140_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L141_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L143_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:If_L144_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:If_L144_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L145_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:If_L144_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L146_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:If_L144_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Return_L147_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L143_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Return_L148_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L150_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L151_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L153_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L154_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L153_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:If_L155_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:If_L155_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L156_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:If_L155_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L157_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L159_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L160_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L159_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Assign_L161_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L159_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:If_L162_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:If_L162_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L163_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:If_L162_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L164_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L159_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L165_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L167_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L168_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L167_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:For_L169_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:For_L169_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L170_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Assign_L173_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Assign_L174_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L175_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L176_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L177_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L178_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L179_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Assign_L180_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L181_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L172_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L182_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L184_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Assign_L185_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L184_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L187_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L184_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L188_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L191_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Assign_L192_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L191_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:If_L193_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:If_L193_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L194_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L191_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L195_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L191_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Return_L196_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L198_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L199_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Assign_L203_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L201_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L204_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L206_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L207_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L206_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:For_L209_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:For_L209_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:For_L210_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:For_L210_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:If_L211_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:If_L211_C12", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L212_C16"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L214_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L216_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L222_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Assign_L223_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L222_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:If_L224_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:If_L224_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L225_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L222_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L226_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L222_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Return_L227_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:FunctionDef_L229_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L230_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:If_L233_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Try_L234_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:Try_L234_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L235_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99966:Try_L234_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99966:Expr_L237_C8"}] |
'''
一阶字典读
'''
def getElement_twolevel(dic, key1, key2):
if dic.has_key(key1):
if dic[key1][0] == 0:
return 0.0
if dic[key1].has_key(key2):
return 1.0 * dic[key1][key2] / dic[key1][0]
return 0.0
'''
一阶字典写
'''
def getElement_onelevel(dic, key):
if dic[0] == 0:
return 0.0
if dic.has_key(key):
return 1.0 * dic[key] / dic[0]
return 0.0
'''
二阶字典写
'''
def addElement_twolevel(dic, key1, key2, value):
if not dic.has_key(key1):
dic[key1] = {}
dic[key1][key2] = value
dic[key1][0] = value
else:
if not dic[key1].has_key(key2):
dic[key1][key2] = value
dic[key1][0] += value
else:
dic[key1][key2] = dic[key1][key2] + value
dic[key1][0] += value
| ajibawa-2023/Python-Code-Large/train/row_99968 | 24 | 34 | 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_99968:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 3], "level": 0, "parent": null, "vector": [8, 0, 0.0588, 0.0882, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "'''\n\u4e00\u9636\u5b57\u5178\u8bfb\n'''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99968:FunctionDef_L4_C0", "label": "getElement_twolevel", "type": "function", "loc": [4, 10], "level": 0, "parent": null, "vector": [2, 0, 0.2059, 0.2059, 0, 0.66, 0.2, 516, 0, 3, 1, 0, 0, 0, 2], "semantic": {"name": "getElement_twolevel", "arg_names": ["dic", "key1", "key2"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def getElement_twolevel(dic, key1, key2):\n\tif dic.has_key(key1):\n\t\tif dic[key1][0] == 0:\n\t\t\treturn 0.0\n\t\tif dic[key1].has_key(key2):\n\t\t\treturn 1.0 * dic[key1][key2] / dic[key1][0]\n\treturn 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99968:If_L5_C1", "label": "if", "type": "if", "loc": [5, 9], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99968:FunctionDef_L4_C0", "vector": [4, 1, 0.2059, 0.1471, 1, 0.97, 0.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tif dic.has_key(key1):\n\t\tif dic[key1][0] == 0:\n\t\t\treturn 0.0\n\t\tif dic[key1].has_key(key2):\n\t\t\treturn 1.0 * dic[key1][key2] / dic[key1][0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99968:If_L6_C2", "label": "if", "type": "if", "loc": [6, 7], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99968:If_L5_C1", "vector": [4, 2, 0.1912, 0.0588, 2, 0.17, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif dic[key1][0] == 0:\n\t\t\treturn 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99968:Return_L7_C3", "label": "return", "type": "return", "loc": [7, 7], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99968:If_L6_C2", "vector": [13, 3, 0.2059, 0.0294, 3, 0.46, 0.0, 0, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99968:If_L8_C2", "label": "if", "type": "if", "loc": [8, 9], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99968:If_L5_C1", "vector": [4, 2, 0.25, 0.0588, 2, 0.17, 1.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif dic[key1].has_key(key2):\n\t\t\treturn 1.0 * dic[key1][key2] / dic[key1][0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99968:Return_L9_C3", "label": "return", "type": "return", "loc": [9, 9], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99968:If_L8_C2", "vector": [13, 3, 0.2647, 0.0294, 3, 0.58, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn 1.0 * dic[key1][key2] / dic[key1][0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99968:Return_L10_C1", "label": "return", "type": "return", "loc": [10, 10], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99968:FunctionDef_L4_C0", "vector": [13, 1, 0.2941, 0.0294, 1, 0.97, 1.0, 0, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\treturn 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99968:Expr_L11_C0", "label": "expression", "type": "expression", "loc": [11, 13], "level": 0, "parent": null, "vector": [8, 0, 0.3529, 0.0882, 0, 0.66, 0.4, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "'''\n\u4e00\u9636\u5b57\u5178\u5199\n'''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99968:FunctionDef_L14_C0", "label": "getElement_onelevel", "type": "function", "loc": [14, 19], "level": 0, "parent": null, "vector": [2, 0, 0.4853, 0.1765, 0, 0.66, 0.6, 369, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "getElement_onelevel", "arg_names": ["dic", "key"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def getElement_onelevel(dic, key):\n\tif dic[0] == 0:\n\t\treturn 0.0\n\tif dic.has_key(key):\n\t\treturn 1.0 * dic[key] / dic[0]\n\treturn 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99968:If_L15_C1", "label": "if", "type": "if", "loc": [15, 16], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99968:FunctionDef_L14_C0", "vector": [4, 1, 0.4559, 0.0588, 1, 0.16, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tif dic[0] == 0:\n\t\treturn 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99968:Return_L16_C2", "label": "return", "type": "return", "loc": [16, 16], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99968:If_L15_C1", "vector": [13, 2, 0.4706, 0.0294, 2, 0.45, 0.0, 0, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99968:If_L17_C1", "label": "if", "type": "if", "loc": [17, 18], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99968:FunctionDef_L14_C0", "vector": [4, 1, 0.5147, 0.0588, 1, 0.16, 0.5, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tif dic.has_key(key):\n\t\treturn 1.0 * dic[key] / dic[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99968:Return_L18_C2", "label": "return", "type": "return", "loc": [18, 18], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99968:If_L17_C1", "vector": [13, 2, 0.5294, 0.0294, 2, 0.55, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn 1.0 * dic[key] / dic[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99968:Return_L19_C1", "label": "return", "type": "return", "loc": [19, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99968:FunctionDef_L14_C0", "vector": [13, 1, 0.5588, 0.0294, 1, 0.16, 1.0, 0, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\treturn 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99968:Expr_L20_C0", "label": "expression", "type": "expression", "loc": [20, 22], "level": 0, "parent": null, "vector": [8, 0, 0.6176, 0.0882, 0, 0.66, 0.8, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "'''\n\u4e8c\u9636\u5b57\u5178\u5199\n'''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99968:FunctionDef_L23_C0", "label": "addElement_twolevel", "type": "function", "loc": [23, 34], "level": 0, "parent": null, "vector": [2, 0, 0.8382, 0.3529, 0, 0.66, 1.0, 619, 0, 4, 0, 0, 0, 0, 2], "semantic": {"name": "addElement_twolevel", "arg_names": ["dic", "key1", "key2", "value"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def addElement_twolevel(dic, key1, key2, value):\n\tif not dic.has_key(key1):\n\t\tdic[key1] = {}\n\t\tdic[key1][key2] = value\n\t\tdic[key1][0] = value\n\telse:\n\t\tif not dic[key1].has_key(key2):\n\t\t\tdic[key1][key2] = value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99968:If_L24_C1", "label": "if", "type": "if", "loc": [24, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99968:FunctionDef_L23_C0", "vector": [4, 1, 0.8529, 0.3235, 1, 0.22, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tif not dic.has_key(key1):\n\t\tdic[key1] = {}\n\t\tdic[key1][key2] = value\n\t\tdic[key1][0] = value\n\telse:\n\t\tif not dic[key1].has_key(key2):\n\t\t\tdic[key1][key2] = value\n\t\t\tdic[key1][0] += value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99968:Assign_L25_C2", "label": "assign", "type": "assigned_variable", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99968:If_L24_C1", "vector": [14, 2, 0.7353, 0.0294, 2, 0.2, 0.0, 0, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tdic[key1] = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99968:Assign_L26_C2", "label": "assign", "type": "assigned_variable", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99968:If_L24_C1", "vector": [14, 2, 0.7647, 0.0294, 2, 0.2, 0.3333, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tdic[key1][key2] = value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99968:Assign_L27_C2", "label": "assign", "type": "assigned_variable", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99968:If_L24_C1", "vector": [14, 2, 0.7941, 0.0294, 2, 0.2, 0.6667, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tdic[key1][0] = value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99968:If_L29_C2", "label": "if", "type": "if", "loc": [29, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99968:If_L24_C1", "vector": [4, 2, 0.9265, 0.1765, 2, 0.2, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif not dic[key1].has_key(key2):\n\t\t\tdic[key1][key2] = value\n\t\t\tdic[key1][0] += value\n\t\telse:\n\t\t\tdic[key1][key2] = dic[key1][key2] + value\n\t\t\tdic[key1][0] += value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99968:Assign_L30_C3", "label": "assign", "type": "assigned_variable", "loc": [30, 30], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99968:If_L29_C2", "vector": [14, 3, 0.8824, 0.0294, 3, 0.34, 0.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tdic[key1][key2] = value"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99968:Assign_L33_C3", "label": "assign", "type": "assigned_variable", "loc": [33, 33], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99968:If_L29_C2", "vector": [14, 3, 0.9706, 0.0294, 3, 0.34, 1.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tdic[key1][key2] = dic[key1][key2] + value"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99968:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99968:If_L5_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99968:If_L5_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99968:If_L6_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99968:If_L6_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99968:Return_L7_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99968:If_L5_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99968:If_L8_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99968:If_L8_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99968:Return_L9_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99968:FunctionDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99968:Return_L10_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99968:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99968:If_L15_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99968:If_L15_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99968:Return_L16_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99968:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99968:If_L17_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99968:If_L17_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99968:Return_L18_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99968:FunctionDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99968:Return_L19_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99968:FunctionDef_L23_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99968:If_L24_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99968:If_L24_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99968:Assign_L25_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99968:If_L24_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99968:Assign_L26_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99968:If_L24_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99968:Assign_L27_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99968:If_L24_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99968:If_L29_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99968:If_L29_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99968:Assign_L30_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99968:If_L29_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99968:Assign_L33_C3"}] |
'''
prerequisite:
1) allocate the term-id and doc-id;
2) build a language model for each passage (fixed window)
3) get an initialed translation model
'''
from ML import ML
from QueryManager import QueryManager
from Query import Query
from Lexicon import Lexicon
from TranslationModel import TranslationModel
from time import time
from DictUtils import *
from multiprocessing import Process, Pipe
from config import EM_TM_path
def printModel(dic):
for key in dic.keys():
line = str(key) + ' '
for k2 in dic[key].keys():
line = line + str(k2) + ':' + str(dic[key][k2])
print line
#将一个字典写入文件,按照进程编号
def WriteDict(d, num):
wf = open(str(num), 'w')
for key in d.keys():
line = str(key) + ' '
for k2 in d[key].keys():
line = line + str(k2) + ':' + str(d[key][k2])+' '
wf.write(line+'\n')
wf.close()
#将一个字典从文件中读出,按照进程编号
def ReadDict(num):
d = {}
rf = open(str(num), 'r')
lines = rf.readlines()
rf.close()
for line in lines:
key = int(line.split()[0])
d[key] = {}
items = line.split()[1:]
for item in items:
k = int(item.split(':')[0])
v = float(item.split(':')[1])
d[key][k] = v
return d
class ATM: # aligned translation model
'''
EM algorithm for training:
qd_reader: a reader for query-doc pair;
init_tm:
'''
#每一个进程对应的训练子任务,[begin,end)对应这个进程处理的query范围,num是这个进程的编号,prev_global_translation是上一次迭代后的ATM
def train_mul(self, begin, end,num, prev_global_translation):
doc_translation_local = {}
for query_index in xrange(begin, end):
query = self.qm.getQuery(query_index)#获得一个query对象
q = []
for term in query.getQuery().split():#获得一个query的文本内容,即一个字符串
q.append(self.lexicon.getIdByTerm(term))#获得term这个词的编号
doc = ML(str(query.getAnsdoc()))#创建一篇文档的最大似然对象,若需要这篇文档的最大似然需要load一下,若只需要paasage models则不需要load
passage_models = doc.getPassageModels()#获得这篇文本的最大似然对象的passage model的列表
passage_scores = []
passage_translations = []
for lm in passage_models:
# t3 = clock()
passage_score, passage_translation = self.passage_score(q, lm, prev_global_translation)
passage_scores.append(passage_score)
passage_translations.append(passage_translation)
# t4 = clock()
# print 'Query pair cost %f s' % (t4-t3)
self.passage_norm(passage_scores)
doc_translation = self.doc_translation_norm(passage_translations, passage_scores)
self.update_translation(doc_translation_local, doc_translation)
WriteDict(doc_translation_local, num)#暂时写入文件,待所有子进程执行结束后,再在主进程中进行归并
'''
我觉得问题可能主要出在:
1.有关字典的操作中,我的词的编号是从1开始的,所以0号位置储存的和
2.只有passage_translation没有0号元素,其他的字典都如第1条所示
3.DictUtils中有三个函数,分别对应一阶字典的读写和二阶字典的写
这一部分的处理可以会有些混乱,因为每次都是从字典中通过keys方法获取需要计算的词的列表,所以每一步我都要判断,对于key=0时,不做处理。
'''
def train(self, init_tm, iterate_num, model_diff):
prev_global_translation = init_tm
self.qm = QueryManager()
self.qm.load()
self.collection = ML('collection')
self.collection.load()
query_count = 10000#self.qm.getSize() #test for 1000 queries
self.lexicon = Lexicon()
self.lexicon.load()
for i in xrange(iterate_num):
# import pdb
# pdb.set_trace()
t1 = time()
print 'Iterate %d model :' % (i+1)
# printModel(prev_global_translation)
global_translation = {}
pool = []
kernelnum = 16
for j in xrange(kernelnum):
pool.append(Process(target=self.train_mul, args=(query_count*j/kernelnum, query_count*(j+1)/kernelnum,j,prev_global_translation)))
for j in xrange(kernelnum):
pool[j].start()
for j in xrange(kernelnum):
pool[j].join()
for j in xrange(kernelnum):
doc_translation = ReadDict(j)
self.update_translation(global_translation, doc_translation)
self.translation_norm(global_translation)
error = self.compare(prev_global_translation, global_translation)
print 'Iterate %d error %f .' % (i+1, error)
if(error < model_diff):
break;
prev_global_translation = global_translation;
t2 = time()
print 'Iterate %d cost %f s' % (i+1, t2-t1)
self.model = global_translation
def writeModel(self):
f = open('EM_TM_path', 'w')#test path
for td in self.model.keys():
line = str(td) + ' '
for tq in self.model[td].keys():
if tq == 0:
continue
line = line + str(tq) + ':' + str(self.model[td][tq]) + ' '
line = line + '\n'
f.write(line)
f.close()
'''
读取模型文件
'''
def load(self):
f = open('EM_TM_path', 'r')
self.model = {}
lines = f.readlines()
f.close()
for line in lines:
items = line.split()
td = int(items[0])
for item in items[1:]:
tq = int(item.split(':')[0])
value = float(item.split(':')[1])
addElement_twolevel(self.model, td, tq ,value)
'''
获得词td->tq的概率
'''
def getProb(self, td, tq):
return getElement_twolevel(self.model, td, tq)
def passage_score(self, q, lm, ptm):
score = 1.0
translation = {}
for td in lm.keys():
if td == 0:
continue
translation[td] = {}
col_ML = ML('collection')
col_ML.load()
for tq in q:
k_score = 0.0
for td in lm.keys():
if td == 0:
continue
p1 = getElement_twolevel(ptm, td, tq)
p2 = getElement_onelevel(lm, td)
tmp_alpha = 1e-5
tmp_score = p1*((1-tmp_alpha)*p2+self.collection.getProb(td)*tmp_alpha)
if tmp_score== 0:
continue
translation[td][tq] = tmp_score
k_score = k_score + tmp_score
score = score * k_score
return (score, translation)
def passage_norm(self, passage_scores):
denominator = 0.0
for score in passage_scores:
denominator = denominator + score
if denominator == 0:
return
for i in xrange(len(passage_scores)):
passage_scores[i] = passage_scores[i] / denominator
def doc_translation_norm(self, passage_translations, passage_scores):
doc_translation = {}
for k in xrange(len(passage_scores)):
if passage_scores[k] == 0:
continue
for td in passage_translations[k].keys():
for tq in passage_translations[k][td].keys():
addElement_twolevel(doc_translation, tq, td, passage_scores[k] * passage_translations[k][td][tq])
for tq in doc_translation.keys():
for td in doc_translation[tq].keys():
if td == 0:
continue #Remember not do normalization to 0th element
doc_translation[tq][td] = doc_translation[tq][td] / doc_translation[tq][0]
doc_translation[tq][0] = 1.0
return doc_translation
def update_translation(self, global_translation, doc_translation):
for tq in doc_translation.keys():
for td in doc_translation[tq].keys():
if td == 0:
continue
addElement_twolevel(global_translation, td, tq, doc_translation[tq][td])
def translation_norm(self, global_translation):
for td in global_translation.keys():
for tq in global_translation[td].keys():
if tq == 0:
continue
global_translation[td][tq] = global_translation[td][tq] / global_translation[td][0]
global_translation[td][0] = 1.0
def compare(self, pt, gt):
diff = 0.0
td_list = set(pt.keys()) | set(gt.keys()) - set([0])
word_num = 0
for td in td_list:
tq_list = set()
if pt.has_key(td):
tq_list = tq_list | set(pt[td].keys())
if gt.has_key(td):
tq_list = tq_list | set(gt[td].keys())
tq_list = tq_list - set([0])
for tq in tq_list:
word_num = word_num + 1
diff = diff + abs(getElement_twolevel(pt, td, tq) - getElement_twolevel(gt, td, tq))
print 'word_num: %d' % (word_num)
return diff
if __name__ == '__main__':
atm = ATM()
tm_model = TranslationModel()
i_tm = tm_model.getTM_dict(True)
atm.train(i_tm, 10, 100)
atm.load()
atm.writeModel()
print atm.getProb(65542, 71749)
| ajibawa-2023/Python-Code-Large/train/row_99969 | 195 | 244 | 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_99969:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 7], "level": 0, "parent": null, "vector": [8, 0, 0.0184, 0.0246, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "'''\nprerequisite:\n1) allocate the term-id and doc-id;\n2) build a language model for each passage (fixed window)\n3) get an initialed translation model\n'''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:ImportFrom_L8_C0", "label": "from ML import ML", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0328, 0.0041, 0, 0.66, 0.0714, 455, 0, 1, 0, 0, 455, 0, 0], "semantic": {"name": "ML", "arg_names": [], "import_names": ["ML"], "rhs_call_name": "", "annotation": ""}, "snippet": "from ML import ML"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:ImportFrom_L9_C0", "label": "from QueryManager import QueryManager", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0369, 0.0041, 0, 0.66, 0.1429, 95, 0, 1, 0, 0, 95, 0, 0], "semantic": {"name": "QueryManager", "arg_names": [], "import_names": ["QueryManager"], "rhs_call_name": "", "annotation": ""}, "snippet": "from QueryManager import QueryManager"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:ImportFrom_L10_C0", "label": "from Query import Query", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.041, 0.0041, 0, 0.66, 0.2143, 279, 0, 1, 0, 0, 279, 0, 0], "semantic": {"name": "Query", "arg_names": [], "import_names": ["Query"], "rhs_call_name": "", "annotation": ""}, "snippet": "from Query import Query"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:ImportFrom_L11_C0", "label": "from Lexicon import Lexicon", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0451, 0.0041, 0, 0.66, 0.2857, 16, 0, 1, 0, 0, 16, 0, 0], "semantic": {"name": "Lexicon", "arg_names": [], "import_names": ["Lexicon"], "rhs_call_name": "", "annotation": ""}, "snippet": "from Lexicon import Lexicon"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:ImportFrom_L12_C0", "label": "from TranslationModel import TranslationModel", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.0492, 0.0041, 0, 0.66, 0.3571, 753, 0, 1, 0, 0, 753, 0, 0], "semantic": {"name": "TranslationModel", "arg_names": [], "import_names": ["TranslationModel"], "rhs_call_name": "", "annotation": ""}, "snippet": "from TranslationModel import TranslationModel"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:ImportFrom_L13_C0", "label": "from time import time", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.0533, 0.0041, 0, 0.66, 0.4286, 654, 0, 1, 0, 0, 654, 0, 0], "semantic": {"name": "time", "arg_names": [], "import_names": ["time"], "rhs_call_name": "", "annotation": ""}, "snippet": "from time import time"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:ImportFrom_L14_C0", "label": "from DictUtils import *", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.0574, 0.0041, 0, 0.66, 0.5, 355, 0, 1, 0, 0, 355, 0, 0], "semantic": {"name": "DictUtils", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from DictUtils import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:ImportFrom_L15_C0", "label": "from multiprocessing import Process, Pipe", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.0615, 0.0041, 0, 0.66, 0.5714, 901, 0, 2, 0, 0, 901, 0, 0], "semantic": {"name": "multiprocessing", "arg_names": [], "import_names": ["Process", "Pipe"], "rhs_call_name": "", "annotation": ""}, "snippet": "from multiprocessing import Process, Pipe"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:ImportFrom_L16_C0", "label": "from config import EM_TM_path", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.0656, 0.0041, 0, 0.66, 0.6429, 308, 0, 1, 0, 0, 308, 0, 0], "semantic": {"name": "config", "arg_names": [], "import_names": ["EM_TM_path"], "rhs_call_name": "", "annotation": ""}, "snippet": "from config import EM_TM_path"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L18_C0", "label": "printModel", "type": "function", "loc": [18, 23], "level": 0, "parent": null, "vector": [2, 0, 0.084, 0.0246, 0, 0.66, 0.7143, 133, 0, 1, 0, 0, 0, 0, 6], "semantic": {"name": "printModel", "arg_names": ["dic"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def printModel(dic):\n\tfor key in dic.keys():\n\t\tline = str(key) + ' '\n\t\tfor k2 in dic[key].keys():\n\t\t\tline = line + str(k2) + ':' + str(dic[key][k2])\n\t\tprint(line)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L19_C1", "label": "for key", "type": "for", "loc": [19, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L18_C0", "vector": [6, 1, 0.0861, 0.0205, 1, 0.26, 0.0, 230, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "key", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfor key in dic.keys():\n\t\tline = str(key) + ' '\n\t\tfor k2 in dic[key].keys():\n\t\t\tline = line + str(k2) + ':' + str(dic[key][k2])\n\t\tprint(line)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L20_C2", "label": "line =", "type": "assigned_variable", "loc": [20, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L19_C1", "vector": [14, 2, 0.082, 0.0041, 2, 0.6, 0.0, 373, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "line", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tline = str(key) + ' '"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L21_C2", "label": "for k2", "type": "for", "loc": [21, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L19_C1", "vector": [6, 2, 0.0881, 0.0082, 2, 0.6, 0.5, 482, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "k2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor k2 in dic[key].keys():\n\t\t\tline = line + str(k2) + ':' + str(dic[key][k2])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L22_C3", "label": "line =", "type": "assigned_variable", "loc": [22, 22], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L21_C2", "vector": [14, 3, 0.0902, 0.0041, 3, 0.8, 0.0, 373, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "line", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tline = line + str(k2) + ':' + str(dic[key][k2])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L23_C2", "label": "print()", "type": "expression", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L19_C1", "vector": [8, 2, 0.0943, 0.0041, 2, 0.6, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\t\tprint(line)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L25_C0", "label": "WriteDict", "type": "function", "loc": [25, 32], "level": 0, "parent": null, "vector": [2, 0, 0.1168, 0.0328, 0, 0.66, 0.7857, 278, 0, 2, 0, 0, 0, 0, 9], "semantic": {"name": "WriteDict", "arg_names": ["d", "num"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def WriteDict(d, num):\n\twf = open(str(num), 'w')\n\tfor key in d.keys():\n\t\tline = str(key) + ' '\n\t\tfor k2 in d[key].keys():\n\t\t\tline = line + str(k2) + ':' + str(d[key][k2])+' '\n\t\twf.write(line+'\\n')\n\twf.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L26_C1", "label": "wf = open()", "type": "assigned_variable", "loc": [26, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L25_C0", "vector": [14, 1, 0.1066, 0.0041, 1, 0.23, 0.0, 192, 3, 2, 0, 0, 693, 10, 2], "semantic": {"name": "wf", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": "\twf = open(str(num), 'w')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L27_C1", "label": "for key", "type": "for", "loc": [27, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L25_C0", "vector": [6, 1, 0.1189, 0.0205, 1, 0.23, 0.5, 230, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "key", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfor key in d.keys():\n\t\tline = str(key) + ' '\n\t\tfor k2 in d[key].keys():\n\t\t\tline = line + str(k2) + ':' + str(d[key][k2])+' '\n\t\twf.write(line+'\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L28_C2", "label": "line =", "type": "assigned_variable", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L27_C1", "vector": [14, 2, 0.1148, 0.0041, 2, 0.6, 0.0, 373, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "line", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tline = str(key) + ' '"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L29_C2", "label": "for k2", "type": "for", "loc": [29, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L27_C1", "vector": [6, 2, 0.1209, 0.0082, 2, 0.6, 0.5, 482, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "k2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor k2 in d[key].keys():\n\t\t\tline = line + str(k2) + ':' + str(d[key][k2])+' '"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L30_C3", "label": "line =", "type": "assigned_variable", "loc": [30, 30], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L29_C2", "vector": [14, 3, 0.123, 0.0041, 3, 0.76, 0.0, 373, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "line", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tline = line + str(k2) + ':' + str(d[key][k2])+' '"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L31_C2", "label": "write()", "type": "expression", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L27_C1", "vector": [8, 2, 0.127, 0.0041, 2, 0.6, 1.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": "\t\twf.write(line+'\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L32_C1", "label": "close()", "type": "expression", "loc": [32, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L25_C0", "vector": [8, 1, 0.1311, 0.0041, 1, 0.23, 1.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": "\twf.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L34_C0", "label": "ReadDict", "type": "function", "loc": [34, 48], "level": 0, "parent": null, "vector": [2, 0, 0.168, 0.0615, 0, 0.66, 0.8571, 294, 0, 1, 1, 0, 0, 0, 11], "semantic": {"name": "ReadDict", "arg_names": ["num"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def ReadDict(num):\n\td = {}\n\trf = open(str(num), 'r')\n\tlines = rf.readlines()\n\trf.close()\n\t\n\tfor line in lines:\n\t\tkey = int(line.split()[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L35_C1", "label": "d =", "type": "assigned_variable", "loc": [35, 35], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L34_C0", "vector": [14, 1, 0.1434, 0.0041, 1, 0.53, 0.0, 355, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\td = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L36_C1", "label": "rf = open()", "type": "assigned_variable", "loc": [36, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L34_C0", "vector": [14, 1, 0.1475, 0.0041, 1, 0.53, 0.2, 657, 3, 2, 0, 0, 693, 10, 2], "semantic": {"name": "rf", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": "\trf = open(str(num), 'r')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L37_C1", "label": "lines = readlines()", "type": "assigned_variable", "loc": [37, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L34_C0", "vector": [14, 1, 0.1516, 0.0041, 1, 0.53, 0.4, 73, 3, 0, 0, 0, 841, 10, 1], "semantic": {"name": "lines", "arg_names": [], "import_names": [], "rhs_call_name": "readlines", "annotation": ""}, "snippet": "\tlines = rf.readlines()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L38_C1", "label": "close()", "type": "expression", "loc": [38, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L34_C0", "vector": [8, 1, 0.1557, 0.0041, 1, 0.53, 0.6, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": "\trf.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L40_C1", "label": "for line", "type": "for", "loc": [40, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L34_C0", "vector": [6, 1, 0.1783, 0.0328, 1, 0.53, 0.8, 373, 2, 0, 0, 0, 0, 0, 7], "semantic": {"name": "line", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfor line in lines:\n\t\tkey = int(line.split()[0])\n\t\td[key] = {}\n\t\titems = line.split()[1:]\n\t\tfor item in items:\n\t\t\tk = int(item.split(':')[0])\n\t\t\tv = float(item.split(':')[1])\n\t\t\td[key][k] = v"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L41_C2", "label": "key = int()", "type": "assigned_variable", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L40_C1", "vector": [14, 2, 0.168, 0.0041, 2, 0.27, 0.0, 230, 3, 1, 0, 0, 901, 10, 2], "semantic": {"name": "key", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": "\t\tkey = int(line.split()[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L42_C2", "label": "assign", "type": "assigned_variable", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L40_C1", "vector": [14, 2, 0.1721, 0.0041, 2, 0.27, 0.3333, 0, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\td[key] = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L43_C2", "label": "items =", "type": "assigned_variable", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L40_C1", "vector": [14, 2, 0.1762, 0.0041, 2, 0.27, 0.6667, 339, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "items", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\titems = line.split()[1:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L44_C2", "label": "for item", "type": "for", "loc": [44, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L40_C1", "vector": [6, 2, 0.1865, 0.0164, 2, 0.27, 1.0, 434, 2, 0, 0, 0, 0, 0, 4], "semantic": {"name": "item", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor item in items:\n\t\t\tk = int(item.split(':')[0])\n\t\t\tv = float(item.split(':')[1])\n\t\t\td[key][k] = v"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L45_C3", "label": "k = int()", "type": "assigned_variable", "loc": [45, 45], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L44_C2", "vector": [14, 3, 0.1844, 0.0041, 3, 0.57, 0.0, 954, 3, 1, 0, 0, 901, 10, 2], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": "\t\t\tk = int(item.split(':')[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L46_C3", "label": "v = float()", "type": "assigned_variable", "loc": [46, 46], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L44_C2", "vector": [14, 3, 0.1885, 0.0041, 3, 0.57, 0.5, 553, 3, 1, 0, 0, 639, 10, 2], "semantic": {"name": "v", "arg_names": [], "import_names": [], "rhs_call_name": "float", "annotation": ""}, "snippet": "\t\t\tv = float(item.split(':')[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L47_C3", "label": "assign", "type": "assigned_variable", "loc": [47, 47], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L44_C2", "vector": [14, 3, 0.1926, 0.0041, 3, 0.57, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\td[key][k] = v"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Return_L48_C1", "label": "return", "type": "return", "loc": [48, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L34_C0", "vector": [13, 1, 0.1967, 0.0041, 1, 0.53, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\treturn d"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:ClassDef_L50_C0", "label": "ATM", "type": "class", "loc": [50, 235], "level": 0, "parent": null, "vector": [3, 0, 0.584, 0.7623, 0, 0.66, 0.9286, 532, 0, 11, 0, 0, 0, 0, 98], "semantic": {"name": "ATM", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ATM: # aligned translation model\n\t'''\n\tEM algorithm for training:\n\tqd_reader: a reader for query-doc pair;\n\tinit_tm:\n\t'''\n\t#\u6bcf\u4e00\u4e2a\u8fdb\u7a0b\u5bf9\u5e94\u7684\u8bad\u7ec3\u5b50\u4efb\u52a1\uff0c[begin,end)\u5bf9\u5e94\u8fd9\u4e2a\u8fdb\u7a0b\u5904\u7406\u7684query\u8303\u56f4\uff0cnum\u662f\u8fd9\u4e2a\u8fdb\u7a0b\u7684\u7f16\u53f7\uff0cprev_global_translation\u662f\u4e0a\u4e00\u6b21\u8fed\u4ee3\u540e\u7684ATM\n\tdef train_mul(self, begin, end,num, prev_global_translation):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L51_C1", "label": "expression", "type": "expression", "loc": [51, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:ClassDef_L50_C0", "vector": [8, 1, 0.2172, 0.0205, 1, 0.07, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t'''\n\tEM algorithm for training:\n\tqd_reader: a reader for query-doc pair;\n\tinit_tm:\n\t'''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L57_C1", "label": "train_mul", "type": "function", "loc": [57, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:ClassDef_L50_C0", "vector": [2, 1, 0.2766, 0.0902, 1, 0.07, 0.0714, 846, 0, 5, 0, 0, 0, 0, 17], "semantic": {"name": "train_mul", "arg_names": ["self", "begin", "end", "num", "prev_global_translation"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef train_mul(self, begin, end,num, prev_global_translation):\n\t\tdoc_translation_local = {}\n\t\tfor query_index in xrange(begin, end):\n\t\t\tquery = self.qm.getQuery(query_index)#\u83b7\u5f97\u4e00\u4e2aquery\u5bf9\u8c61\n\t\t\tq = []\n\t\t\tfor term in query.getQuery().split():#\u83b7\u5f97\u4e00\u4e2aquery\u7684\u6587\u672c\u5185\u5bb9\uff0c\u5373\u4e00\u4e2a\u5b57\u7b26\u4e32\n\t\t\t\tq.append(self.lexicon.getIdByTerm(term))#\u83b7\u5f97term\u8fd9\u4e2a\u8bcd\u7684\u7f16\u53f7\n\t\t\tdoc = ML(str(query.getAnsdoc()))#\u521b\u5efa\u4e00\u7bc7\u6587\u6863\u7684\u6700\u5927\u4f3c\u7136\u5bf9\u8c61\uff0c\u82e5\u9700\u8981\u8fd9\u7bc7\u6587\u6863\u7684\u6700\u5927\u4f3c\u7136\u9700\u8981load\u4e00\u4e0b\uff0c\u82e5\u53ea\u9700\u8981paasage models\u5219\u4e0d\u9700\u8981load"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L58_C2", "label": "doc_translation_local =", "type": "assigned_variable", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L57_C1", "vector": [14, 2, 0.2377, 0.0041, 2, 0.54, 0.0, 269, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "doc_translation_local", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tdoc_translation_local = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L59_C2", "label": "for query_index", "type": "for", "loc": [59, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L57_C1", "vector": [6, 2, 0.2787, 0.0779, 2, 0.54, 0.5, 790, 3, 0, 0, 0, 0, 0, 16], "semantic": {"name": "query_index", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor query_index in xrange(begin, end):\n\t\t\tquery = self.qm.getQuery(query_index)#\u83b7\u5f97\u4e00\u4e2aquery\u5bf9\u8c61\n\t\t\tq = []\n\t\t\tfor term in query.getQuery().split():#\u83b7\u5f97\u4e00\u4e2aquery\u7684\u6587\u672c\u5185\u5bb9\uff0c\u5373\u4e00\u4e2a\u5b57\u7b26\u4e32\n\t\t\t\tq.append(self.lexicon.getIdByTerm(term))#\u83b7\u5f97term\u8fd9\u4e2a\u8bcd\u7684\u7f16\u53f7\n\t\t\tdoc = ML(str(query.getAnsdoc()))#\u521b\u5efa\u4e00\u7bc7\u6587\u6863\u7684\u6700\u5927\u4f3c\u7136\u5bf9\u8c61\uff0c\u82e5\u9700\u8981\u8fd9\u7bc7\u6587\u6863\u7684\u6700\u5927\u4f3c\u7136\u9700\u8981load\u4e00\u4e0b\uff0c\u82e5\u53ea\u9700\u8981paasage models\u5219\u4e0d\u9700\u8981load\n\t\t\tpassage_models = doc.getPassageModels()#\u83b7\u5f97\u8fd9\u7bc7\u6587\u672c\u7684\u6700\u5927\u4f3c\u7136\u5bf9\u8c61\u7684passage model\u7684\u5217\u8868\n\t\t\tpassage_scores = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L60_C3", "label": "query = getQuery()", "type": "assigned_variable", "loc": [60, 60], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L59_C2", "vector": [14, 3, 0.2459, 0.0041, 3, 0.66, 0.0, 546, 3, 1, 0, 0, 369, 10, 1], "semantic": {"name": "query", "arg_names": [], "import_names": [], "rhs_call_name": "getQuery", "annotation": ""}, "snippet": "\t\t\tquery = self.qm.getQuery(query_index)#\u83b7\u5f97\u4e00\u4e2aquery\u5bf9\u8c61"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L61_C3", "label": "q =", "type": "assigned_variable", "loc": [61, 61], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L59_C2", "vector": [14, 3, 0.25, 0.0041, 3, 0.66, 0.1, 516, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "q", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tq = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L62_C3", "label": "for term", "type": "for", "loc": [62, 63], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L59_C2", "vector": [6, 3, 0.2561, 0.0082, 3, 0.66, 0.2, 645, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "term", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tfor term in query.getQuery().split():#\u83b7\u5f97\u4e00\u4e2aquery\u7684\u6587\u672c\u5185\u5bb9\uff0c\u5373\u4e00\u4e2a\u5b57\u7b26\u4e32\n\t\t\t\tq.append(self.lexicon.getIdByTerm(term))#\u83b7\u5f97term\u8fd9\u4e2a\u8bcd\u7684\u7f16\u53f7"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L63_C4", "label": "append()", "type": "expression", "loc": [63, 63], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L62_C3", "vector": [8, 4, 0.2582, 0.0041, 4, 0.42, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": "\t\t\t\tq.append(self.lexicon.getIdByTerm(term))#\u83b7\u5f97term\u8fd9\u4e2a\u8bcd\u7684\u7f16\u53f7"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L64_C3", "label": "doc = ML()", "type": "assigned_variable", "loc": [64, 64], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L59_C2", "vector": [14, 3, 0.2623, 0.0041, 3, 0.66, 0.3, 555, 3, 1, 0, 0, 455, 10, 3], "semantic": {"name": "doc", "arg_names": [], "import_names": [], "rhs_call_name": "ML", "annotation": ""}, "snippet": "\t\t\tdoc = ML(str(query.getAnsdoc()))#\u521b\u5efa\u4e00\u7bc7\u6587\u6863\u7684\u6700\u5927\u4f3c\u7136\u5bf9\u8c61\uff0c\u82e5\u9700\u8981\u8fd9\u7bc7\u6587\u6863\u7684\u6700\u5927\u4f3c\u7136\u9700\u8981load\u4e00\u4e0b\uff0c\u82e5\u53ea\u9700\u8981paasage models\u5219\u4e0d\u9700\u8981load"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L65_C3", "label": "passage_models = getPassageModels()", "type": "assigned_variable", "loc": [65, 65], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L59_C2", "vector": [14, 3, 0.2664, 0.0041, 3, 0.66, 0.4, 838, 3, 0, 0, 0, 974, 10, 1], "semantic": {"name": "passage_models", "arg_names": [], "import_names": [], "rhs_call_name": "getPassageModels", "annotation": ""}, "snippet": "\t\t\tpassage_models = doc.getPassageModels()#\u83b7\u5f97\u8fd9\u7bc7\u6587\u672c\u7684\u6700\u5927\u4f3c\u7136\u5bf9\u8c61\u7684passage model\u7684\u5217\u8868"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L66_C3", "label": "passage_scores =", "type": "assigned_variable", "loc": [66, 66], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L59_C2", "vector": [14, 3, 0.2705, 0.0041, 3, 0.66, 0.5, 900, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "passage_scores", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tpassage_scores = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L67_C3", "label": "passage_translations =", "type": "assigned_variable", "loc": [67, 67], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L59_C2", "vector": [14, 3, 0.2746, 0.0041, 3, 0.66, 0.6, 637, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "passage_translations", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tpassage_translations = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L68_C3", "label": "for lm", "type": "for", "loc": [68, 72], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L59_C2", "vector": [6, 3, 0.2869, 0.0205, 3, 0.66, 0.7, 376, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "lm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tfor lm in passage_models:\n#\t\t\t\tt3 = clock()\n\t\t\t\tpassage_score, passage_translation = self.passage_score(q, lm, prev_global_translation)\n\t\t\t\tpassage_scores.append(passage_score)\n\t\t\t\tpassage_translations.append(passage_translation)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L70_C4", "label": "passage_score, passage_translation = passage_score()", "type": "assigned_variable", "loc": [70, 70], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L68_C3", "vector": [14, 4, 0.2869, 0.0041, 4, 0.39, 0.0, 91, 3, 3, 0, 0, 805, 10, 1], "semantic": {"name": "passage_score, passage_translation", "arg_names": [], "import_names": [], "rhs_call_name": "passage_score", "annotation": ""}, "snippet": "\t\t\t\tpassage_score, passage_translation = self.passage_score(q, lm, prev_global_translation)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L71_C4", "label": "append()", "type": "expression", "loc": [71, 71], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L68_C3", "vector": [8, 4, 0.291, 0.0041, 4, 0.39, 0.5, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": "\t\t\t\tpassage_scores.append(passage_score)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L72_C4", "label": "append()", "type": "expression", "loc": [72, 72], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L68_C3", "vector": [8, 4, 0.2951, 0.0041, 4, 0.39, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": "\t\t\t\tpassage_translations.append(passage_translation)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L75_C3", "label": "passage_norm()", "type": "expression", "loc": [75, 75], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L59_C2", "vector": [8, 3, 0.3074, 0.0041, 3, 0.66, 0.8, 426, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "passage_norm", "arg_names": [], "import_names": [], "rhs_call_name": "passage_norm", "annotation": ""}, "snippet": "\t\t\tself.passage_norm(passage_scores)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L76_C3", "label": "doc_translation = doc_translation_norm()", "type": "assigned_variable", "loc": [76, 76], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L59_C2", "vector": [14, 3, 0.3115, 0.0041, 3, 0.66, 0.9, 860, 3, 2, 0, 0, 560, 10, 1], "semantic": {"name": "doc_translation", "arg_names": [], "import_names": [], "rhs_call_name": "doc_translation_norm", "annotation": ""}, "snippet": "\t\t\tdoc_translation = self.doc_translation_norm(passage_translations, passage_scores)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L77_C3", "label": "update_translation()", "type": "expression", "loc": [77, 77], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L59_C2", "vector": [8, 3, 0.3156, 0.0041, 3, 0.66, 1.0, 337, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "update_translation", "arg_names": [], "import_names": [], "rhs_call_name": "update_translation", "annotation": ""}, "snippet": "\t\t\tself.update_translation(doc_translation_local, doc_translation)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L78_C2", "label": "WriteDict()", "type": "expression", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L57_C1", "vector": [8, 2, 0.3197, 0.0041, 2, 0.54, 1.0, 278, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "WriteDict", "arg_names": [], "import_names": [], "rhs_call_name": "WriteDict", "annotation": ""}, "snippet": "\t\tWriteDict(doc_translation_local, num)#\u6682\u65f6\u5199\u5165\u6587\u4ef6\uff0c\u5f85\u6240\u6709\u5b50\u8fdb\u7a0b\u6267\u884c\u7ed3\u675f\u540e\uff0c\u518d\u5728\u4e3b\u8fdb\u7a0b\u4e2d\u8fdb\u884c\u5f52\u5e76"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L79_C1", "label": "expression", "type": "expression", "loc": [79, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:ClassDef_L50_C0", "vector": [8, 1, 0.3361, 0.0287, 1, 0.07, 0.1429, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t'''\n\t\u6211\u89c9\u5f97\u95ee\u9898\u53ef\u80fd\u4e3b\u8981\u51fa\u5728\uff1a\n\t1.\u6709\u5173\u5b57\u5178\u7684\u64cd\u4f5c\u4e2d\uff0c\u6211\u7684\u8bcd\u7684\u7f16\u53f7\u662f\u4ece1\u5f00\u59cb\u7684\uff0c\u6240\u4ee50\u53f7\u4f4d\u7f6e\u50a8\u5b58\u7684\u548c\n\t2.\u53ea\u6709passage_translation\u6ca1\u67090\u53f7\u5143\u7d20\uff0c\u5176\u4ed6\u7684\u5b57\u5178\u90fd\u5982\u7b2c1\u6761\u6240\u793a\n\t3.DictUtils\u4e2d\u6709\u4e09\u4e2a\u51fd\u6570\uff0c\u5206\u522b\u5bf9\u5e94\u4e00\u9636\u5b57\u5178\u7684\u8bfb\u5199\u548c\u4e8c\u9636\u5b57\u5178\u7684\u5199\n\t\u8fd9\u4e00\u90e8\u5206\u7684\u5904\u7406\u53ef\u4ee5\u4f1a\u6709\u4e9b\u6df7\u4e71\uff0c\u56e0\u4e3a\u6bcf\u6b21\u90fd\u662f\u4ece\u5b57\u5178\u4e2d\u901a\u8fc7keys\u65b9\u6cd5\u83b7\u53d6\u9700\u8981\u8ba1\u7b97\u7684\u8bcd\u7684\u5217\u8868\uff0c\u6240\u4ee5\u6bcf\u4e00\u6b65\u6211\u90fd\u8981\u5224\u65ad\uff0c\u5bf9\u4e8ekey=0\u65f6\uff0c\u4e0d\u505a\u5904\u7406\u3002\n\t'''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L86_C1", "label": "train", "type": "function", "loc": [86, 121], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:ClassDef_L50_C0", "vector": [2, 1, 0.4242, 0.1475, 1, 0.07, 0.2143, 371, 0, 4, 0, 0, 0, 0, 24], "semantic": {"name": "train", "arg_names": ["self", "init_tm", "iterate_num", "model_diff"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef train(self, init_tm, iterate_num, model_diff):\n\t\tprev_global_translation = init_tm\n\t\tself.qm = QueryManager()\n\t\tself.qm.load()\n\t\tself.collection = ML('collection')\n\t\tself.collection.load()\n\t\tquery_count = 10000#self.qm.getSize() #test for 1000 queries\n\t\tself.lexicon = Lexicon()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L87_C2", "label": "prev_global_translation =", "type": "assigned_variable", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L86_C1", "vector": [14, 2, 0.3566, 0.0041, 2, 0.25, 0.0, 892, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "prev_global_translation", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tprev_global_translation = init_tm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L88_C2", "label": "self.qm = QueryManager()", "type": "assigned_variable", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L86_C1", "vector": [14, 2, 0.3607, 0.0041, 2, 0.25, 0.1111, 256, 3, 0, 0, 0, 95, 10, 1], "semantic": {"name": "self.qm", "arg_names": [], "import_names": [], "rhs_call_name": "QueryManager", "annotation": ""}, "snippet": "\t\tself.qm = QueryManager()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L89_C2", "label": "load()", "type": "expression", "loc": [89, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L86_C1", "vector": [8, 2, 0.3648, 0.0041, 2, 0.25, 0.2222, 37, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "load", "arg_names": [], "import_names": [], "rhs_call_name": "load", "annotation": ""}, "snippet": "\t\tself.qm.load()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L90_C2", "label": "self.collection = ML()", "type": "assigned_variable", "loc": [90, 90], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L86_C1", "vector": [14, 2, 0.3689, 0.0041, 2, 0.25, 0.3333, 102, 3, 1, 0, 0, 455, 10, 1], "semantic": {"name": "self.collection", "arg_names": [], "import_names": [], "rhs_call_name": "ML", "annotation": ""}, "snippet": "\t\tself.collection = ML('collection')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L91_C2", "label": "load()", "type": "expression", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L86_C1", "vector": [8, 2, 0.373, 0.0041, 2, 0.25, 0.4444, 37, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "load", "arg_names": [], "import_names": [], "rhs_call_name": "load", "annotation": ""}, "snippet": "\t\tself.collection.load()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L92_C2", "label": "query_count =", "type": "assigned_variable", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L86_C1", "vector": [14, 2, 0.377, 0.0041, 2, 0.25, 0.5556, 435, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "query_count", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tquery_count = 10000#self.qm.getSize() #test for 1000 queries"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L93_C2", "label": "self.lexicon = Lexicon()", "type": "assigned_variable", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L86_C1", "vector": [14, 2, 0.3811, 0.0041, 2, 0.25, 0.6667, 61, 3, 0, 0, 0, 16, 10, 1], "semantic": {"name": "self.lexicon", "arg_names": [], "import_names": [], "rhs_call_name": "Lexicon", "annotation": ""}, "snippet": "\t\tself.lexicon = Lexicon()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L94_C2", "label": "load()", "type": "expression", "loc": [94, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L86_C1", "vector": [8, 2, 0.3852, 0.0041, 2, 0.25, 0.7778, 37, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "load", "arg_names": [], "import_names": [], "rhs_call_name": "load", "annotation": ""}, "snippet": "\t\tself.lexicon.load()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L95_C2", "label": "for i", "type": "for", "loc": [95, 120], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L86_C1", "vector": [6, 2, 0.4406, 0.1066, 2, 0.25, 0.8889, 826, 3, 0, 0, 0, 0, 0, 18], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor i in xrange(iterate_num):\n#\t\t\timport pdb\n#\t\t\tpdb.set_trace()\n\t\t\tt1 = time()\n\t\t\tprint('Iterate %d model :' % (i+1))\n#\t\t\tprintModel(prev_global_translation)\n\t\t\tglobal_translation = {}\n\t\t\tpool = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L98_C3", "label": "t1 = time()", "type": "assigned_variable", "loc": [98, 98], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L95_C2", "vector": [14, 3, 0.4016, 0.0041, 3, 0.12, 0.0, 329, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "t1", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": "\t\t\tt1 = time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L99_C3", "label": "print()", "type": "expression", "loc": [99, 99], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L95_C2", "vector": [8, 3, 0.4057, 0.0041, 3, 0.12, 0.0667, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\t\t\tprint('Iterate %d model :' % (i+1))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L101_C3", "label": "global_translation =", "type": "assigned_variable", "loc": [101, 101], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L95_C2", "vector": [14, 3, 0.4139, 0.0041, 3, 0.12, 0.1333, 645, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "global_translation", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tglobal_translation = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L102_C3", "label": "pool =", "type": "assigned_variable", "loc": [102, 102], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L95_C2", "vector": [14, 3, 0.418, 0.0041, 3, 0.12, 0.2, 540, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "pool", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tpool = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L103_C3", "label": "kernelnum =", "type": "assigned_variable", "loc": [103, 103], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L95_C2", "vector": [14, 3, 0.4221, 0.0041, 3, 0.12, 0.2667, 871, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "kernelnum", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tkernelnum = 16"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L104_C3", "label": "for j", "type": "for", "loc": [104, 105], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L95_C2", "vector": [6, 3, 0.4283, 0.0082, 3, 0.12, 0.3333, 100, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "j", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tfor j in xrange(kernelnum):\n\t\t\t\tpool.append(Process(target=self.train_mul, args=(query_count*j/kernelnum, query_count*(j+1)/kernelnum,j,prev_global_translation)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L105_C4", "label": "append()", "type": "expression", "loc": [105, 105], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L104_C3", "vector": [8, 4, 0.4303, 0.0041, 4, 0.02, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": "\t\t\t\tpool.append(Process(target=self.train_mul, args=(query_count*j/kernelnum, query_count*(j+1)/kernelnum,j,prev_global_translation)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L106_C3", "label": "for j", "type": "for", "loc": [106, 107], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L95_C2", "vector": [6, 3, 0.4365, 0.0082, 3, 0.12, 0.4, 100, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "j", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tfor j in xrange(kernelnum):\n\t\t\t\tpool[j].start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L107_C4", "label": "start()", "type": "expression", "loc": [107, 107], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L106_C3", "vector": [8, 4, 0.4385, 0.0041, 4, 0.88, 0.0, 511, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": "\t\t\t\tpool[j].start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L108_C3", "label": "for j", "type": "for", "loc": [108, 109], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L95_C2", "vector": [6, 3, 0.4447, 0.0082, 3, 0.12, 0.4667, 100, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "j", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tfor j in xrange(kernelnum):\n\t\t\t\tpool[j].join()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L109_C4", "label": "join()", "type": "expression", "loc": [109, 109], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L108_C3", "vector": [8, 4, 0.4467, 0.0041, 4, 0.79, 0.0, 933, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "join", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": "\t\t\t\tpool[j].join()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L110_C3", "label": "for j", "type": "for", "loc": [110, 112], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L95_C2", "vector": [6, 3, 0.4549, 0.0123, 3, 0.12, 0.5333, 100, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "j", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tfor j in xrange(kernelnum):\n\t\t\t\tdoc_translation = ReadDict(j)\n\t\t\t\tself.update_translation(global_translation, doc_translation)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L111_C4", "label": "doc_translation = ReadDict()", "type": "assigned_variable", "loc": [111, 111], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L110_C3", "vector": [14, 4, 0.4549, 0.0041, 4, 0.02, 0.0, 860, 3, 1, 0, 0, 294, 10, 1], "semantic": {"name": "doc_translation", "arg_names": [], "import_names": [], "rhs_call_name": "ReadDict", "annotation": ""}, "snippet": "\t\t\t\tdoc_translation = ReadDict(j)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L112_C4", "label": "update_translation()", "type": "expression", "loc": [112, 112], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L110_C3", "vector": [8, 4, 0.459, 0.0041, 4, 0.02, 1.0, 337, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "update_translation", "arg_names": [], "import_names": [], "rhs_call_name": "update_translation", "annotation": ""}, "snippet": "\t\t\t\tself.update_translation(global_translation, doc_translation)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L113_C3", "label": "translation_norm()", "type": "expression", "loc": [113, 113], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L95_C2", "vector": [8, 3, 0.4631, 0.0041, 3, 0.12, 0.6, 447, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "translation_norm", "arg_names": [], "import_names": [], "rhs_call_name": "translation_norm", "annotation": ""}, "snippet": "\t\t\tself.translation_norm(global_translation)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L114_C3", "label": "error = compare()", "type": "assigned_variable", "loc": [114, 114], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L95_C2", "vector": [14, 3, 0.4672, 0.0041, 3, 0.12, 0.6667, 771, 3, 2, 0, 0, 383, 10, 1], "semantic": {"name": "error", "arg_names": [], "import_names": [], "rhs_call_name": "compare", "annotation": ""}, "snippet": "\t\t\terror = self.compare(prev_global_translation, global_translation)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L115_C3", "label": "print()", "type": "expression", "loc": [115, 115], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L95_C2", "vector": [8, 3, 0.4713, 0.0041, 3, 0.12, 0.7333, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\t\t\tprint('Iterate %d error %f .' % (i+1, error))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:If_L116_C3", "label": "if", "type": "if", "loc": [116, 117], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L95_C2", "vector": [4, 3, 0.4775, 0.0082, 3, 0.12, 0.8, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif(error < model_diff):\n\t\t\t\tbreak;"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L118_C3", "label": "prev_global_translation =", "type": "assigned_variable", "loc": [118, 118], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L95_C2", "vector": [14, 3, 0.4836, 0.0041, 3, 0.12, 0.8667, 892, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "prev_global_translation", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tprev_global_translation = global_translation;"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L119_C3", "label": "t2 = time()", "type": "assigned_variable", "loc": [119, 119], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L95_C2", "vector": [14, 3, 0.4877, 0.0041, 3, 0.12, 0.9333, 469, 3, 0, 0, 0, 654, 10, 1], "semantic": {"name": "t2", "arg_names": [], "import_names": [], "rhs_call_name": "time", "annotation": ""}, "snippet": "\t\t\tt2 = time()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L120_C3", "label": "print()", "type": "expression", "loc": [120, 120], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L95_C2", "vector": [8, 3, 0.4918, 0.0041, 3, 0.12, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\t\t\tprint('Iterate %d cost %f s' % (i+1, t2-t1))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L121_C2", "label": "self.model =", "type": "assigned_variable", "loc": [121, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L86_C1", "vector": [14, 2, 0.4959, 0.0041, 2, 0.25, 1.0, 81, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.model", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.model = global_translation"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L123_C1", "label": "writeModel", "type": "function", "loc": [123, 133], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:ClassDef_L50_C0", "vector": [2, 1, 0.5246, 0.0451, 1, 0.07, 0.2857, 319, 0, 1, 0, 0, 0, 0, 8], "semantic": {"name": "writeModel", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef writeModel(self):\n\t\tf = open('EM_TM_path', 'w')#test path\n\t\tfor td in self.model.keys():\n\t\t\tline = str(td) + ' '\n\t\t\tfor tq in self.model[td].keys():\n\t\t\t\tif tq == 0:\n\t\t\t\t\tcontinue\n\t\t\t\tline = line + str(tq) + ':' + str(self.model[td][tq]) + ' '"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L124_C2", "label": "f = open()", "type": "assigned_variable", "loc": [124, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L123_C1", "vector": [14, 2, 0.5082, 0.0041, 2, 0.33, 0.0, 899, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": "\t\tf = open('EM_TM_path', 'w')#test path"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L125_C2", "label": "for td", "type": "for", "loc": [125, 132], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L123_C1", "vector": [6, 2, 0.5266, 0.0328, 2, 0.33, 0.5, 102, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "td", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor td in self.model.keys():\n\t\t\tline = str(td) + ' '\n\t\t\tfor tq in self.model[td].keys():\n\t\t\t\tif tq == 0:\n\t\t\t\t\tcontinue\n\t\t\t\tline = line + str(tq) + ':' + str(self.model[td][tq]) + ' '\n\t\t\tline = line + '\\n'\n\t\t\tf.write(line)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L126_C3", "label": "line =", "type": "assigned_variable", "loc": [126, 126], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L125_C2", "vector": [14, 3, 0.5164, 0.0041, 3, 0.16, 0.0, 373, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "line", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tline = str(td) + ' '"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L127_C3", "label": "for tq", "type": "for", "loc": [127, 130], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L125_C2", "vector": [6, 3, 0.5266, 0.0164, 3, 0.16, 0.3333, 470, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "tq", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tfor tq in self.model[td].keys():\n\t\t\t\tif tq == 0:\n\t\t\t\t\tcontinue\n\t\t\t\tline = line + str(tq) + ':' + str(self.model[td][tq]) + ' '"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:If_L128_C4", "label": "if", "type": "if", "loc": [128, 129], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L127_C3", "vector": [4, 4, 0.5266, 0.0082, 4, 0.64, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tif tq == 0:\n\t\t\t\t\tcontinue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L130_C4", "label": "line =", "type": "assigned_variable", "loc": [130, 130], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L127_C3", "vector": [14, 4, 0.5328, 0.0041, 4, 0.64, 1.0, 373, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "line", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tline = line + str(tq) + ':' + str(self.model[td][tq]) + ' '"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L131_C3", "label": "line =", "type": "assigned_variable", "loc": [131, 131], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L125_C2", "vector": [14, 3, 0.5369, 0.0041, 3, 0.16, 0.6667, 373, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "line", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tline = line + '\\n'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L132_C3", "label": "write()", "type": "expression", "loc": [132, 132], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L125_C2", "vector": [8, 3, 0.541, 0.0041, 3, 0.16, 1.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": "\t\t\tf.write(line)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L133_C2", "label": "close()", "type": "expression", "loc": [133, 133], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L123_C1", "vector": [8, 2, 0.5451, 0.0041, 2, 0.33, 1.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": "\t\tf.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L134_C1", "label": "expression", "type": "expression", "loc": [134, 136], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:ClassDef_L50_C0", "vector": [8, 1, 0.5533, 0.0123, 1, 0.07, 0.3571, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t'''\n\t\u8bfb\u53d6\u6a21\u578b\u6587\u4ef6\n\t'''\t\t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L137_C1", "label": "load", "type": "function", "loc": [137, 148], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:ClassDef_L50_C0", "vector": [2, 1, 0.584, 0.0492, 1, 0.07, 0.4286, 37, 0, 1, 0, 0, 0, 0, 10], "semantic": {"name": "load", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef load(self):\n\t\tf = open('EM_TM_path', 'r')\n\t\tself.model = {}\n\t\tlines = f.readlines()\n\t\tf.close()\n\t\tfor line in lines:\n\t\t\titems = line.split()\n\t\t\ttd = int(items[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L138_C2", "label": "f = open()", "type": "assigned_variable", "loc": [138, 138], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L137_C1", "vector": [14, 2, 0.5656, 0.0041, 2, 0.2, 0.0, 899, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": "\t\tf = open('EM_TM_path', 'r')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L139_C2", "label": "self.model =", "type": "assigned_variable", "loc": [139, 139], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L137_C1", "vector": [14, 2, 0.5697, 0.0041, 2, 0.2, 0.25, 81, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.model", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.model = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L140_C2", "label": "lines = readlines()", "type": "assigned_variable", "loc": [140, 140], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L137_C1", "vector": [14, 2, 0.5738, 0.0041, 2, 0.2, 0.5, 73, 3, 0, 0, 0, 841, 10, 1], "semantic": {"name": "lines", "arg_names": [], "import_names": [], "rhs_call_name": "readlines", "annotation": ""}, "snippet": "\t\tlines = f.readlines()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L141_C2", "label": "close()", "type": "expression", "loc": [141, 141], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L137_C1", "vector": [8, 2, 0.5779, 0.0041, 2, 0.2, 0.75, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": "\t\tf.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L142_C2", "label": "for line", "type": "for", "loc": [142, 148], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L137_C1", "vector": [6, 2, 0.5943, 0.0287, 2, 0.2, 1.0, 373, 2, 0, 0, 0, 0, 0, 7], "semantic": {"name": "line", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor line in lines:\n\t\t\titems = line.split()\n\t\t\ttd = int(items[0])\n\t\t\tfor item in items[1:]:\n\t\t\t\ttq = int(item.split(':')[0])\n\t\t\t\tvalue = float(item.split(':')[1])\n\t\t\t\taddElement_twolevel(self.model, td, tq ,value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L143_C3", "label": "items = split()", "type": "assigned_variable", "loc": [143, 143], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L142_C2", "vector": [14, 3, 0.5861, 0.0041, 3, 0.9, 0.0, 339, 3, 0, 0, 0, 908, 10, 1], "semantic": {"name": "items", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": "\t\t\titems = line.split()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L144_C3", "label": "td = int()", "type": "assigned_variable", "loc": [144, 144], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L142_C2", "vector": [14, 3, 0.5902, 0.0041, 3, 0.9, 0.5, 102, 3, 1, 0, 0, 901, 10, 1], "semantic": {"name": "td", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": "\t\t\ttd = int(items[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L145_C3", "label": "for item", "type": "for", "loc": [145, 148], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L142_C2", "vector": [6, 3, 0.6004, 0.0164, 3, 0.9, 1.0, 434, 6, 0, 0, 0, 0, 0, 5], "semantic": {"name": "item", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tfor item in items[1:]:\n\t\t\t\ttq = int(item.split(':')[0])\n\t\t\t\tvalue = float(item.split(':')[1])\n\t\t\t\taddElement_twolevel(self.model, td, tq ,value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L146_C4", "label": "tq = int()", "type": "assigned_variable", "loc": [146, 146], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L145_C3", "vector": [14, 4, 0.5984, 0.0041, 4, 0.09, 0.0, 470, 3, 1, 0, 0, 901, 10, 2], "semantic": {"name": "tq", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": "\t\t\t\ttq = int(item.split(':')[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L147_C4", "label": "value = float()", "type": "assigned_variable", "loc": [147, 147], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L145_C3", "vector": [14, 4, 0.6025, 0.0041, 4, 0.09, 0.5, 441, 3, 1, 0, 0, 639, 10, 2], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "float", "annotation": ""}, "snippet": "\t\t\t\tvalue = float(item.split(':')[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L148_C4", "label": "addElement_twolevel()", "type": "expression", "loc": [148, 148], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L145_C3", "vector": [8, 4, 0.6066, 0.0041, 4, 0.09, 1.0, 619, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "addElement_twolevel", "arg_names": [], "import_names": [], "rhs_call_name": "addElement_twolevel", "annotation": ""}, "snippet": "\t\t\t\taddElement_twolevel(self.model, td, tq ,value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L149_C1", "label": "expression", "type": "expression", "loc": [149, 151], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:ClassDef_L50_C0", "vector": [8, 1, 0.6148, 0.0123, 1, 0.07, 0.5, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t'''\n\t\u83b7\u5f97\u8bcdtd->tq\u7684\u6982\u7387\n\t'''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L152_C1", "label": "getProb", "type": "function", "loc": [152, 153], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:ClassDef_L50_C0", "vector": [2, 1, 0.625, 0.0082, 1, 0.07, 0.5714, 528, 0, 3, 1, 0, 0, 0, 1], "semantic": {"name": "getProb", "arg_names": ["self", "td", "tq"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef getProb(self, td, tq):\n\t\treturn getElement_twolevel(self.model, td, tq)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Return_L153_C2", "label": "return", "type": "return", "loc": [153, 153], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L152_C1", "vector": [13, 2, 0.627, 0.0041, 2, 0.43, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn getElement_twolevel(self.model, td, tq)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L155_C1", "label": "passage_score", "type": "function", "loc": [155, 178], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:ClassDef_L50_C0", "vector": [2, 1, 0.6824, 0.0984, 1, 0.07, 0.6429, 805, 0, 4, 1, 0, 0, 0, 7], "semantic": {"name": "passage_score", "arg_names": ["self", "q", "lm", "ptm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef passage_score(self, q, lm, ptm):\n\t\tscore = 1.0\n\t\ttranslation = {}\n\t\tfor td in lm.keys():\n\t\t\tif td == 0:\n\t\t\t\tcontinue\n\t\t\ttranslation[td] = {}\n\t\tcol_ML = ML('collection')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L156_C2", "label": "score =", "type": "assigned_variable", "loc": [156, 156], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L155_C1", "vector": [14, 2, 0.6393, 0.0041, 2, 0.11, 0.0, 34, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "score", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tscore = 1.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L157_C2", "label": "translation =", "type": "assigned_variable", "loc": [157, 157], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L155_C1", "vector": [14, 2, 0.6434, 0.0041, 2, 0.11, 0.1667, 50, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "translation", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\ttranslation = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L158_C2", "label": "for td", "type": "for", "loc": [158, 161], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L155_C1", "vector": [6, 2, 0.6537, 0.0164, 2, 0.11, 0.3333, 102, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "td", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor td in lm.keys():\n\t\t\tif td == 0:\n\t\t\t\tcontinue\n\t\t\ttranslation[td] = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:If_L159_C3", "label": "if", "type": "if", "loc": [159, 160], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L158_C2", "vector": [4, 3, 0.6537, 0.0082, 3, 0.2, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif td == 0:\n\t\t\t\tcontinue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L161_C3", "label": "assign", "type": "assigned_variable", "loc": [161, 161], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L158_C2", "vector": [14, 3, 0.6598, 0.0041, 3, 0.2, 1.0, 0, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\ttranslation[td] = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L162_C2", "label": "col_ML = ML()", "type": "assigned_variable", "loc": [162, 162], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L155_C1", "vector": [14, 2, 0.6639, 0.0041, 2, 0.11, 0.5, 490, 3, 1, 0, 0, 455, 10, 1], "semantic": {"name": "col_ML", "arg_names": [], "import_names": [], "rhs_call_name": "ML", "annotation": ""}, "snippet": "\t\tcol_ML = ML('collection')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L163_C2", "label": "load()", "type": "expression", "loc": [163, 163], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L155_C1", "vector": [8, 2, 0.668, 0.0041, 2, 0.11, 0.6667, 37, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "load", "arg_names": [], "import_names": [], "rhs_call_name": "load", "annotation": ""}, "snippet": "\t\tcol_ML.load()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L164_C2", "label": "for tq", "type": "for", "loc": [164, 177], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L155_C1", "vector": [6, 2, 0.6988, 0.0574, 2, 0.11, 0.8333, 470, 2, 0, 0, 0, 0, 0, 4], "semantic": {"name": "tq", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor tq in q:\n\t\t\tk_score = 0.0\n\t\t\tfor td in lm.keys():\n\t\t\t\tif td == 0:\n\t\t\t\t\tcontinue\n\t\t\t\tp1 = getElement_twolevel(ptm, td, tq)\n\t\t\t\tp2 = getElement_onelevel(lm, td)\n\t\t\t\ttmp_alpha = 1e-5"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L165_C3", "label": "k_score =", "type": "assigned_variable", "loc": [165, 165], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L164_C2", "vector": [14, 3, 0.6762, 0.0041, 3, 0.77, 0.0, 413, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "k_score", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tk_score = 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L166_C3", "label": "for td", "type": "for", "loc": [166, 176], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L164_C2", "vector": [6, 3, 0.7008, 0.0451, 3, 0.77, 0.5, 102, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "td", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tfor td in lm.keys():\n\t\t\t\tif td == 0:\n\t\t\t\t\tcontinue\n\t\t\t\tp1 = getElement_twolevel(ptm, td, tq)\n\t\t\t\tp2 = getElement_onelevel(lm, td)\n\t\t\t\ttmp_alpha = 1e-5\n\t\t\t\ttmp_score = p1*((1-tmp_alpha)*p2+self.collection.getProb(td)*tmp_alpha)\n\t\t\t\tif tmp_score== 0:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:If_L167_C4", "label": "if", "type": "if", "loc": [167, 168], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L166_C3", "vector": [4, 4, 0.6865, 0.0082, 4, 0.7, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tif td == 0:\n\t\t\t\t\tcontinue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L169_C4", "label": "p1 = getElement_twolevel()", "type": "assigned_variable", "loc": [169, 169], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L166_C3", "vector": [14, 4, 0.6926, 0.0041, 4, 0.7, 0.1429, 87, 3, 3, 0, 0, 516, 10, 1], "semantic": {"name": "p1", "arg_names": [], "import_names": [], "rhs_call_name": "getElement_twolevel", "annotation": ""}, "snippet": "\t\t\t\tp1 = getElement_twolevel(ptm, td, tq)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L170_C4", "label": "p2 = getElement_onelevel()", "type": "assigned_variable", "loc": [170, 170], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L166_C3", "vector": [14, 4, 0.6967, 0.0041, 4, 0.7, 0.2857, 843, 3, 2, 0, 0, 369, 10, 1], "semantic": {"name": "p2", "arg_names": [], "import_names": [], "rhs_call_name": "getElement_onelevel", "annotation": ""}, "snippet": "\t\t\t\tp2 = getElement_onelevel(lm, td)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L171_C4", "label": "tmp_alpha =", "type": "assigned_variable", "loc": [171, 171], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L166_C3", "vector": [14, 4, 0.7008, 0.0041, 4, 0.7, 0.4286, 686, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "tmp_alpha", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\ttmp_alpha = 1e-5"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L172_C4", "label": "tmp_score =", "type": "assigned_variable", "loc": [172, 172], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L166_C3", "vector": [14, 4, 0.7049, 0.0041, 4, 0.7, 0.5714, 783, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "tmp_score", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\ttmp_score = p1*((1-tmp_alpha)*p2+self.collection.getProb(td)*tmp_alpha)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:If_L173_C4", "label": "if", "type": "if", "loc": [173, 174], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L166_C3", "vector": [4, 4, 0.7111, 0.0082, 4, 0.7, 0.7143, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tif tmp_score== 0:\n\t\t\t\t\tcontinue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L175_C4", "label": "assign", "type": "assigned_variable", "loc": [175, 175], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L166_C3", "vector": [14, 4, 0.7172, 0.0041, 4, 0.7, 0.8571, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\ttranslation[td][tq] = tmp_score"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L176_C4", "label": "k_score =", "type": "assigned_variable", "loc": [176, 176], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L166_C3", "vector": [14, 4, 0.7213, 0.0041, 4, 0.7, 1.0, 413, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "k_score", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tk_score = k_score + tmp_score"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L177_C3", "label": "score =", "type": "assigned_variable", "loc": [177, 177], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L164_C2", "vector": [14, 3, 0.7254, 0.0041, 3, 0.77, 1.0, 34, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "score", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tscore = score * k_score"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Return_L178_C2", "label": "return", "type": "return", "loc": [178, 178], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L155_C1", "vector": [13, 2, 0.7295, 0.0041, 2, 0.11, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn (score, translation)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L180_C1", "label": "passage_norm", "type": "function", "loc": [180, 187], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:ClassDef_L50_C0", "vector": [2, 1, 0.752, 0.0328, 1, 0.07, 0.7143, 426, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "passage_norm", "arg_names": ["self", "passage_scores"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef passage_norm(self, passage_scores):\n\t\tdenominator = 0.0\n\t\tfor score in passage_scores:\n\t\t\tdenominator = denominator + score\n\t\tif denominator == 0:\n\t\t\treturn\n\t\tfor i in xrange(len(passage_scores)):\n\t\t\tpassage_scores[i] = passage_scores[i] / denominator"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L181_C2", "label": "denominator =", "type": "assigned_variable", "loc": [181, 181], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L180_C1", "vector": [14, 2, 0.7418, 0.0041, 2, 0.96, 0.0, 108, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "denominator", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tdenominator = 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L182_C2", "label": "for score", "type": "for", "loc": [182, 183], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L180_C1", "vector": [6, 2, 0.748, 0.0082, 2, 0.96, 0.3333, 34, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "score", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor score in passage_scores:\n\t\t\tdenominator = denominator + score"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L183_C3", "label": "denominator =", "type": "assigned_variable", "loc": [183, 183], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L182_C2", "vector": [14, 3, 0.75, 0.0041, 3, 0.65, 0.0, 108, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "denominator", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tdenominator = denominator + score"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:If_L184_C2", "label": "if", "type": "if", "loc": [184, 185], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L180_C1", "vector": [4, 2, 0.7561, 0.0082, 2, 0.96, 0.6667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif denominator == 0:\n\t\t\treturn"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Return_L185_C3", "label": "return", "type": "return", "loc": [185, 185], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:If_L184_C2", "vector": [13, 3, 0.7582, 0.0041, 3, 0.48, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L186_C2", "label": "for i", "type": "for", "loc": [186, 187], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L180_C1", "vector": [6, 2, 0.7643, 0.0082, 2, 0.96, 1.0, 826, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor i in xrange(len(passage_scores)):\n\t\t\tpassage_scores[i] = passage_scores[i] / denominator"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L187_C3", "label": "assign", "type": "assigned_variable", "loc": [187, 187], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L186_C2", "vector": [14, 3, 0.7664, 0.0041, 3, 0.12, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tpassage_scores[i] = passage_scores[i] / denominator"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L189_C1", "label": "doc_translation_norm", "type": "function", "loc": [189, 203], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:ClassDef_L50_C0", "vector": [2, 1, 0.8033, 0.0615, 1, 0.07, 0.7857, 560, 0, 3, 1, 0, 0, 0, 7], "semantic": {"name": "doc_translation_norm", "arg_names": ["self", "passage_translations", "passage_scores"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef doc_translation_norm(self, passage_translations, passage_scores):\n\t\tdoc_translation = {}\n\t\tfor k in xrange(len(passage_scores)):\n\t\t\tif passage_scores[k] == 0:\n\t\t\t\tcontinue\n\t\t\tfor td in passage_translations[k].keys():\n\t\t\t\tfor tq in passage_translations[k][td].keys():\n\t\t\t\t\taddElement_twolevel(doc_translation, tq, td, passage_scores[k] * passage_translations[k][td][tq])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L190_C2", "label": "doc_translation =", "type": "assigned_variable", "loc": [190, 190], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L189_C1", "vector": [14, 2, 0.7787, 0.0041, 2, 0.56, 0.0, 860, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "doc_translation", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tdoc_translation = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L191_C2", "label": "for k", "type": "for", "loc": [191, 196], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L189_C1", "vector": [6, 2, 0.793, 0.0246, 2, 0.56, 0.3333, 954, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor k in xrange(len(passage_scores)):\n\t\t\tif passage_scores[k] == 0:\n\t\t\t\tcontinue\n\t\t\tfor td in passage_translations[k].keys():\n\t\t\t\tfor tq in passage_translations[k][td].keys():\n\t\t\t\t\taddElement_twolevel(doc_translation, tq, td, passage_scores[k] * passage_translations[k][td][tq])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:If_L192_C3", "label": "if", "type": "if", "loc": [192, 193], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L191_C2", "vector": [4, 3, 0.7889, 0.0082, 3, 0.47, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif passage_scores[k] == 0:\n\t\t\t\tcontinue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L194_C3", "label": "for td", "type": "for", "loc": [194, 196], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L191_C2", "vector": [6, 3, 0.7992, 0.0123, 3, 0.47, 1.0, 102, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "td", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tfor td in passage_translations[k].keys():\n\t\t\t\tfor tq in passage_translations[k][td].keys():\n\t\t\t\t\taddElement_twolevel(doc_translation, tq, td, passage_scores[k] * passage_translations[k][td][tq])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L195_C4", "label": "for tq", "type": "for", "loc": [195, 196], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L194_C3", "vector": [6, 4, 0.8012, 0.0082, 4, 0.42, 0.0, 470, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "tq", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tfor tq in passage_translations[k][td].keys():\n\t\t\t\t\taddElement_twolevel(doc_translation, tq, td, passage_scores[k] * passage_translations[k][td][tq])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L196_C5", "label": "addElement_twolevel()", "type": "expression", "loc": [196, 196], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L195_C4", "vector": [8, 5, 0.8033, 0.0041, 5, 0.7, 0.0, 619, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "addElement_twolevel", "arg_names": [], "import_names": [], "rhs_call_name": "addElement_twolevel", "annotation": ""}, "snippet": "\t\t\t\t\taddElement_twolevel(doc_translation, tq, td, passage_scores[k] * passage_translations[k][td][tq])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L197_C2", "label": "for tq", "type": "for", "loc": [197, 202], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L189_C1", "vector": [6, 2, 0.8176, 0.0246, 2, 0.56, 0.6667, 470, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "tq", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor tq in doc_translation.keys():\n\t\t\tfor td in doc_translation[tq].keys():\n\t\t\t\tif td == 0:\n\t\t\t\t\tcontinue #Remember not do normalization to 0th element\n\t\t\t\tdoc_translation[tq][td] = doc_translation[tq][td] / doc_translation[tq][0]\n\t\t\tdoc_translation[tq][0] = 1.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L198_C3", "label": "for td", "type": "for", "loc": [198, 201], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L197_C2", "vector": [6, 3, 0.8176, 0.0164, 3, 0.89, 0.0, 102, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "td", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tfor td in doc_translation[tq].keys():\n\t\t\t\tif td == 0:\n\t\t\t\t\tcontinue #Remember not do normalization to 0th element\n\t\t\t\tdoc_translation[tq][td] = doc_translation[tq][td] / doc_translation[tq][0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:If_L199_C4", "label": "if", "type": "if", "loc": [199, 200], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L198_C3", "vector": [4, 4, 0.8176, 0.0082, 4, 0.23, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tif td == 0:\n\t\t\t\t\tcontinue #Remember not do normalization to 0th element"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L201_C4", "label": "assign", "type": "assigned_variable", "loc": [201, 201], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L198_C3", "vector": [14, 4, 0.8238, 0.0041, 4, 0.23, 1.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tdoc_translation[tq][td] = doc_translation[tq][td] / doc_translation[tq][0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L202_C3", "label": "assign", "type": "assigned_variable", "loc": [202, 202], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L197_C2", "vector": [14, 3, 0.8279, 0.0041, 3, 0.89, 1.0, 0, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tdoc_translation[tq][0] = 1.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Return_L203_C2", "label": "return", "type": "return", "loc": [203, 203], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L189_C1", "vector": [13, 2, 0.832, 0.0041, 2, 0.56, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn doc_translation"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L205_C1", "label": "update_translation", "type": "function", "loc": [205, 210], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:ClassDef_L50_C0", "vector": [2, 1, 0.8504, 0.0246, 1, 0.07, 0.8571, 337, 0, 3, 0, 0, 0, 0, 3], "semantic": {"name": "update_translation", "arg_names": ["self", "global_translation", "doc_translation"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef update_translation(self, global_translation, doc_translation):\n\t\tfor tq in doc_translation.keys():\n\t\t\tfor td in doc_translation[tq].keys():\n\t\t\t\tif td == 0:\n\t\t\t\t\tcontinue\n\t\t\t\taddElement_twolevel(global_translation, td, tq, doc_translation[tq][td])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L206_C2", "label": "for tq", "type": "for", "loc": [206, 210], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L205_C1", "vector": [6, 2, 0.8525, 0.0205, 2, 0.65, 0.0, 470, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "tq", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor tq in doc_translation.keys():\n\t\t\tfor td in doc_translation[tq].keys():\n\t\t\t\tif td == 0:\n\t\t\t\t\tcontinue\n\t\t\t\taddElement_twolevel(global_translation, td, tq, doc_translation[tq][td])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L207_C3", "label": "for td", "type": "for", "loc": [207, 210], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L206_C2", "vector": [6, 3, 0.8545, 0.0164, 3, 0.06, 0.0, 102, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "td", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tfor td in doc_translation[tq].keys():\n\t\t\t\tif td == 0:\n\t\t\t\t\tcontinue\n\t\t\t\taddElement_twolevel(global_translation, td, tq, doc_translation[tq][td])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:If_L208_C4", "label": "if", "type": "if", "loc": [208, 209], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L207_C3", "vector": [4, 4, 0.8545, 0.0082, 4, 0.25, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tif td == 0:\n\t\t\t\t\tcontinue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L210_C4", "label": "addElement_twolevel()", "type": "expression", "loc": [210, 210], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L207_C3", "vector": [8, 4, 0.8607, 0.0041, 4, 0.25, 1.0, 619, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "addElement_twolevel", "arg_names": [], "import_names": [], "rhs_call_name": "addElement_twolevel", "annotation": ""}, "snippet": "\t\t\t\taddElement_twolevel(global_translation, td, tq, doc_translation[tq][td])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L212_C1", "label": "translation_norm", "type": "function", "loc": [212, 218], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:ClassDef_L50_C0", "vector": [2, 1, 0.8811, 0.0287, 1, 0.07, 0.9286, 447, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "translation_norm", "arg_names": ["self", "global_translation"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef translation_norm(self, global_translation):\n\t\tfor td in global_translation.keys():\n\t\t\tfor tq in global_translation[td].keys():\n\t\t\t\tif tq == 0:\n\t\t\t\t\tcontinue\n\t\t\t\tglobal_translation[td][tq] = global_translation[td][tq] / global_translation[td][0]\n\t\t\tglobal_translation[td][0] = 1.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L213_C2", "label": "for td", "type": "for", "loc": [213, 218], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L212_C1", "vector": [6, 2, 0.8832, 0.0246, 2, 0.2, 0.0, 102, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "td", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor td in global_translation.keys():\n\t\t\tfor tq in global_translation[td].keys():\n\t\t\t\tif tq == 0:\n\t\t\t\t\tcontinue\n\t\t\t\tglobal_translation[td][tq] = global_translation[td][tq] / global_translation[td][0]\n\t\t\tglobal_translation[td][0] = 1.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L214_C3", "label": "for tq", "type": "for", "loc": [214, 217], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L213_C2", "vector": [6, 3, 0.8832, 0.0164, 3, 0.89, 0.0, 470, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "tq", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tfor tq in global_translation[td].keys():\n\t\t\t\tif tq == 0:\n\t\t\t\t\tcontinue\n\t\t\t\tglobal_translation[td][tq] = global_translation[td][tq] / global_translation[td][0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:If_L215_C4", "label": "if", "type": "if", "loc": [215, 216], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L214_C3", "vector": [4, 4, 0.8832, 0.0082, 4, 0.31, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tif tq == 0:\n\t\t\t\t\tcontinue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L217_C4", "label": "assign", "type": "assigned_variable", "loc": [217, 217], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L214_C3", "vector": [14, 4, 0.8893, 0.0041, 4, 0.31, 1.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tglobal_translation[td][tq] = global_translation[td][tq] / global_translation[td][0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L218_C3", "label": "assign", "type": "assigned_variable", "loc": [218, 218], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L213_C2", "vector": [14, 3, 0.8934, 0.0041, 3, 0.89, 1.0, 0, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tglobal_translation[td][0] = 1.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L220_C1", "label": "compare", "type": "function", "loc": [220, 235], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:ClassDef_L50_C0", "vector": [2, 1, 0.9324, 0.0656, 1, 0.07, 1.0, 383, 0, 3, 1, 0, 0, 0, 17], "semantic": {"name": "compare", "arg_names": ["self", "pt", "gt"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef compare(self, pt, gt):\n\t\tdiff = 0.0\n\t\ttd_list = set(pt.keys()) | set(gt.keys()) - set([0])\n\t\tword_num = 0\n\t\tfor td in td_list:\n\t\t\ttq_list = set()\n\t\t\tif pt.has_key(td):\n\t\t\t\ttq_list = tq_list | set(pt[td].keys())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L221_C2", "label": "diff =", "type": "assigned_variable", "loc": [221, 221], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L220_C1", "vector": [14, 2, 0.9057, 0.0041, 2, 0.06, 0.0, 833, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "diff", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tdiff = 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L222_C2", "label": "td_list =", "type": "assigned_variable", "loc": [222, 222], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L220_C1", "vector": [14, 2, 0.9098, 0.0041, 2, 0.06, 0.2, 524, 4, 0, 0, 0, 0, 0, 5], "semantic": {"name": "td_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\ttd_list = set(pt.keys()) | set(gt.keys()) - set([0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L223_C2", "label": "word_num =", "type": "assigned_variable", "loc": [223, 223], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L220_C1", "vector": [14, 2, 0.9139, 0.0041, 2, 0.06, 0.4, 354, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "word_num", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tword_num = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L224_C2", "label": "for td", "type": "for", "loc": [224, 233], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L220_C1", "vector": [6, 2, 0.9365, 0.041, 2, 0.06, 0.6, 102, 2, 0, 0, 0, 0, 0, 11], "semantic": {"name": "td", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor td in td_list:\n\t\t\ttq_list = set()\n\t\t\tif pt.has_key(td):\n\t\t\t\ttq_list = tq_list | set(pt[td].keys())\n\t\t\tif gt.has_key(td):\n\t\t\t\ttq_list = tq_list | set(gt[td].keys())\n\t\t\ttq_list = tq_list - set([0])\n\t\t\tfor tq in tq_list:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L225_C3", "label": "tq_list = set()", "type": "assigned_variable", "loc": [225, 225], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L224_C2", "vector": [14, 3, 0.9221, 0.0041, 3, 0.15, 0.0, 932, 3, 0, 0, 0, 21, 10, 1], "semantic": {"name": "tq_list", "arg_names": [], "import_names": [], "rhs_call_name": "set", "annotation": ""}, "snippet": "\t\t\ttq_list = set()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:If_L226_C3", "label": "if", "type": "if", "loc": [226, 227], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L224_C2", "vector": [4, 3, 0.9283, 0.0082, 3, 0.15, 0.25, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif pt.has_key(td):\n\t\t\t\ttq_list = tq_list | set(pt[td].keys())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L227_C4", "label": "tq_list =", "type": "assigned_variable", "loc": [227, 227], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:If_L226_C3", "vector": [14, 4, 0.9303, 0.0041, 4, 0.22, 0.0, 932, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "tq_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\ttq_list = tq_list | set(pt[td].keys())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:If_L228_C3", "label": "if", "type": "if", "loc": [228, 229], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L224_C2", "vector": [4, 3, 0.9365, 0.0082, 3, 0.15, 0.5, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif gt.has_key(td):\n\t\t\t\ttq_list = tq_list | set(gt[td].keys())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L229_C4", "label": "tq_list =", "type": "assigned_variable", "loc": [229, 229], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:If_L228_C3", "vector": [14, 4, 0.9385, 0.0041, 4, 0.79, 0.0, 932, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "tq_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\ttq_list = tq_list | set(gt[td].keys())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L230_C3", "label": "tq_list =", "type": "assigned_variable", "loc": [230, 230], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L224_C2", "vector": [14, 3, 0.9426, 0.0041, 3, 0.15, 0.75, 932, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "tq_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\ttq_list = tq_list - set([0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L231_C3", "label": "for tq", "type": "for", "loc": [231, 233], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L224_C2", "vector": [6, 3, 0.9508, 0.0123, 3, 0.15, 1.0, 470, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "tq", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tfor tq in tq_list:\n\t\t\t\tword_num = word_num + 1\n\t\t\t\tdiff = diff + abs(getElement_twolevel(pt, td, tq) - getElement_twolevel(gt, td, tq))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L232_C4", "label": "word_num =", "type": "assigned_variable", "loc": [232, 232], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L231_C3", "vector": [14, 4, 0.9508, 0.0041, 4, 0.81, 0.0, 354, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "word_num", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tword_num = word_num + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L233_C4", "label": "diff =", "type": "assigned_variable", "loc": [233, 233], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L231_C3", "vector": [14, 4, 0.9549, 0.0041, 4, 0.81, 1.0, 833, 4, 0, 0, 0, 0, 0, 3], "semantic": {"name": "diff", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tdiff = diff + abs(getElement_twolevel(pt, td, tq) - getElement_twolevel(gt, td, tq))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L234_C2", "label": "print()", "type": "expression", "loc": [234, 234], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L220_C1", "vector": [8, 2, 0.959, 0.0041, 2, 0.06, 0.8, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\t\tprint('word_num: %d' % (word_num))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Return_L235_C2", "label": "return", "type": "return", "loc": [235, 235], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L220_C1", "vector": [13, 2, 0.9631, 0.0041, 2, 0.06, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn diff"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:If_L237_C0", "label": "if", "type": "if", "loc": [237, 244], "level": 0, "parent": null, "vector": [4, 0, 0.9857, 0.0328, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n\tatm = ATM()\n\ttm_model = TranslationModel()\n\ti_tm = tm_model.getTM_dict(True)\n\tatm.train(i_tm, 10, 100)\n\tatm.load()\n\tatm.writeModel()\n\tprint(atm.getProb(65542, 71749))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L238_C1", "label": "atm = ATM()", "type": "assigned_variable", "loc": [238, 238], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:If_L237_C0", "vector": [14, 1, 0.9754, 0.0041, 1, 0.21, 0.0, 267, 3, 0, 0, 0, 532, 10, 1], "semantic": {"name": "atm", "arg_names": [], "import_names": [], "rhs_call_name": "ATM", "annotation": ""}, "snippet": "\tatm = ATM()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L239_C1", "label": "tm_model = TranslationModel()", "type": "assigned_variable", "loc": [239, 239], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:If_L237_C0", "vector": [14, 1, 0.9795, 0.0041, 1, 0.21, 0.1667, 477, 3, 0, 0, 0, 753, 10, 1], "semantic": {"name": "tm_model", "arg_names": [], "import_names": [], "rhs_call_name": "TranslationModel", "annotation": ""}, "snippet": "\ttm_model = TranslationModel()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L240_C1", "label": "i_tm = getTM_dict()", "type": "assigned_variable", "loc": [240, 240], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:If_L237_C0", "vector": [14, 1, 0.9836, 0.0041, 1, 0.21, 0.3333, 650, 3, 1, 0, 0, 968, 10, 1], "semantic": {"name": "i_tm", "arg_names": [], "import_names": [], "rhs_call_name": "getTM_dict", "annotation": ""}, "snippet": "\ti_tm = tm_model.getTM_dict(True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L241_C1", "label": "train()", "type": "expression", "loc": [241, 241], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:If_L237_C0", "vector": [8, 1, 0.9877, 0.0041, 1, 0.21, 0.5, 371, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "train", "arg_names": [], "import_names": [], "rhs_call_name": "train", "annotation": ""}, "snippet": "\tatm.train(i_tm, 10, 100)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L242_C1", "label": "load()", "type": "expression", "loc": [242, 242], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:If_L237_C0", "vector": [8, 1, 0.9918, 0.0041, 1, 0.21, 0.6667, 37, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "load", "arg_names": [], "import_names": [], "rhs_call_name": "load", "annotation": ""}, "snippet": "\tatm.load()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L243_C1", "label": "writeModel()", "type": "expression", "loc": [243, 243], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:If_L237_C0", "vector": [8, 1, 0.9959, 0.0041, 1, 0.21, 0.8333, 319, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "writeModel", "arg_names": [], "import_names": [], "rhs_call_name": "writeModel", "annotation": ""}, "snippet": "\tatm.writeModel()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L244_C1", "label": "print()", "type": "expression", "loc": [244, 244], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99969:If_L237_C0", "vector": [8, 1, 1.0, 0.0041, 1, 0.21, 1.0, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\tprint(atm.getProb(65542, 71749))"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L18_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L19_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L19_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L20_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L19_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L21_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L21_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L22_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L19_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L23_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L26_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L27_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L27_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L28_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L27_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L29_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L29_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L30_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L27_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L31_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L25_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L32_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L35_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L36_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L37_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L38_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L40_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L40_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L41_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L40_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L42_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L40_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L43_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L40_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L44_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L44_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L45_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L44_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L46_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L44_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L47_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L34_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Return_L48_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:ClassDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L51_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:ClassDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L57_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L57_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L58_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L57_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L59_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L59_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L60_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L59_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L61_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L59_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L62_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L62_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L63_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L59_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L64_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L59_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L65_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L59_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L66_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L59_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L67_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L59_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L68_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L68_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L68_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L68_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L72_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L59_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L75_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L59_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L76_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L59_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L77_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L57_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L78_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:ClassDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L79_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:ClassDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L86_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L86_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L87_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L86_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L88_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L86_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L89_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L86_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L90_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L86_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L91_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L86_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L92_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L86_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L93_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L86_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L94_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L86_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L95_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L95_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L98_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L95_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L99_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L95_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L101_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L95_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L102_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L95_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L103_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L95_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L104_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L104_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L105_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L95_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L106_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L106_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L107_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L95_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L108_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L108_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L109_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L95_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L110_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L110_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L111_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L110_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L112_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L95_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L113_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L95_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L114_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L95_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L115_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L95_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:If_L116_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L95_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L118_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L95_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L119_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L95_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L120_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L86_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L121_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:ClassDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L123_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L123_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L124_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L123_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L125_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L125_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L126_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L125_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L127_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L127_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:If_L128_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L127_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L130_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L125_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L131_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L125_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L132_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L123_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L133_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:ClassDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L134_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:ClassDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L137_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L137_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L138_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L137_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L139_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L137_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L140_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L137_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L141_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L137_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L142_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L142_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L143_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L142_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L144_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L142_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L145_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L145_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L146_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L145_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L147_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L145_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L148_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:ClassDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L149_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:ClassDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L152_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L152_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Return_L153_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:ClassDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L155_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L155_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L156_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L155_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L157_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L155_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L158_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L158_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:If_L159_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L158_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L161_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L155_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L162_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L155_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L163_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L155_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L164_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L164_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L165_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L164_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L166_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L166_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:If_L167_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L166_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L169_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L166_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L170_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L166_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L171_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L166_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L172_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L166_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:If_L173_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L166_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L175_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L166_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L176_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L164_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L177_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L155_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Return_L178_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:ClassDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L180_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L180_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L181_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L180_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L182_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L182_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L183_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L180_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:If_L184_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:If_L184_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Return_L185_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L180_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L186_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L186_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L187_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:ClassDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L189_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L189_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L190_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L189_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L191_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L191_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:If_L192_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L191_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L194_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L194_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L195_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L195_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L196_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L189_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L197_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L197_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L198_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L198_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:If_L199_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L198_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L201_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L197_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L202_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L189_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Return_L203_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:ClassDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L205_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L205_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L206_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L206_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L207_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L207_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:If_L208_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L207_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L210_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:ClassDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L212_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L212_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L213_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L213_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L214_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L214_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:If_L215_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L214_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L217_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L213_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L218_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:ClassDef_L50_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L220_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L220_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L221_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L220_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L222_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L220_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L223_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L220_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L224_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L224_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L225_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L224_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:If_L226_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:If_L226_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L227_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L224_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:If_L228_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:If_L228_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L229_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L224_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L230_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L224_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L231_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L231_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L232_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:For_L231_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L233_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L220_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L234_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:FunctionDef_L220_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Return_L235_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:If_L237_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L238_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:If_L237_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L239_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:If_L237_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Assign_L240_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:If_L237_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L241_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:If_L237_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L242_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:If_L237_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L243_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99969:If_L237_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99969:Expr_L244_C1"}] |
from os.path import exists, join
from Document import Document
from Lexicon import Lexicon
from config import *
from Query import Query
class QueryManager:
def create(self):
query_id = 0
query_file = open(query_path, 'w')
for i in xrange(doccount):
paper = Document(i)
comment_list = paper.getComments()
for j in xrange(len(comment_list)):
query_file.write('queryid='+str(query_id)+'\n')
query_file.write('ans_doc='+str(i)+'\n')
query_file.write('query='+comment_list[j].strip()+'\n')
query_id = query_id + 1
query_file.close()
def load(self):
self.query_list = []
query_file = open(query_path, 'r')
lines = query_file.readlines()
query_file.close()
querycount = (len(lines) + 1) / 3
for i in xrange(0, len(lines), 3):
query = Query(lines[i].split('=')[1].strip(),
int(lines[i+1].split('=')[1].strip()),lines[i+2].split('=')[1].strip())
self.query_list.append(query)
'''
根据query_id来获取query对象
'''
def getQuery(self, query_id):
return self.query_list[query_id]
def getSize(self):
return len(self.query_list)
if __name__ == '__main__':
qm = QueryManager()
qm.create()
qm.load()
print qm.getQuery(28911)
print qm.getSize()
| ajibawa-2023/Python-Code-Large/train/row_99970 | 31 | 38 | 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_99970:ImportFrom_L1_C0", "label": "from os.path import exists, join", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0263, 0.0263, 0, 0.66, 0.0, 79, 0, 2, 0, 0, 79, 0, 0], "semantic": {"name": "os.path", "arg_names": [], "import_names": ["exists", "join"], "rhs_call_name": "", "annotation": ""}, "snippet": "from os.path import exists, join"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99970:ImportFrom_L2_C0", "label": "from Document import Document", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0526, 0.0263, 0, 0.66, 0.2, 920, 0, 1, 0, 0, 920, 0, 0], "semantic": {"name": "Document", "arg_names": [], "import_names": ["Document"], "rhs_call_name": "", "annotation": ""}, "snippet": "from Document import Document"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99970:ImportFrom_L3_C0", "label": "from Lexicon import Lexicon", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0789, 0.0263, 0, 0.66, 0.4, 16, 0, 1, 0, 0, 16, 0, 0], "semantic": {"name": "Lexicon", "arg_names": [], "import_names": ["Lexicon"], "rhs_call_name": "", "annotation": ""}, "snippet": "from Lexicon import Lexicon"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99970:ImportFrom_L4_C0", "label": "from config import *", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.1053, 0.0263, 0, 0.66, 0.6, 308, 0, 1, 0, 0, 308, 0, 0], "semantic": {"name": "config", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from config import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99970:ImportFrom_L5_C0", "label": "from Query import Query", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.1316, 0.0263, 0, 0.66, 0.8, 279, 0, 1, 0, 0, 279, 0, 0], "semantic": {"name": "Query", "arg_names": [], "import_names": ["Query"], "rhs_call_name": "", "annotation": ""}, "snippet": "from Query import Query"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99970:ClassDef_L7_C0", "label": "QueryManager", "type": "class", "loc": [7, 37], "level": 0, "parent": null, "vector": [3, 0, 0.5789, 0.8158, 0, 0.66, 1.0, 95, 0, 4, 0, 0, 0, 0, 29], "semantic": {"name": "QueryManager", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class QueryManager:\n\n\tdef create(self):\n\t\tquery_id = 0\n\t\tquery_file = open(query_path, 'w')\n\t\tfor i in xrange(doccount):\n\t\t\tpaper = Document(i)\n\t\t\tcomment_list = paper.getComments()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99970:FunctionDef_L9_C1", "label": "create", "type": "function", "loc": [9, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99970:ClassDef_L7_C0", "vector": [2, 1, 0.3816, 0.3158, 1, 0.87, 0.0, 316, 0, 1, 0, 0, 0, 0, 13], "semantic": {"name": "create", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef create(self):\n\t\tquery_id = 0\n\t\tquery_file = open(query_path, 'w')\n\t\tfor i in xrange(doccount):\n\t\t\tpaper = Document(i)\n\t\t\tcomment_list = paper.getComments()\n\t\t\tfor j in xrange(len(comment_list)):\n\t\t\t\tquery_file.write('queryid='+str(query_id)+'\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99970:Assign_L10_C2", "label": "query_id =", "type": "assigned_variable", "loc": [10, 10], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99970:FunctionDef_L9_C1", "vector": [14, 2, 0.2632, 0.0263, 2, 0.04, 0.0, 163, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "query_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tquery_id = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99970:Assign_L11_C2", "label": "query_file = open()", "type": "assigned_variable", "loc": [11, 11], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99970:FunctionDef_L9_C1", "vector": [14, 2, 0.2895, 0.0263, 2, 0.04, 0.3333, 587, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "query_file", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": "\t\tquery_file = open(query_path, 'w')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99970:For_L12_C2", "label": "for i", "type": "for", "loc": [12, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99970:FunctionDef_L9_C1", "vector": [6, 2, 0.4079, 0.2105, 2, 0.04, 0.6667, 826, 3, 0, 0, 0, 0, 0, 11], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor i in xrange(doccount):\n\t\t\tpaper = Document(i)\n\t\t\tcomment_list = paper.getComments()\n\t\t\tfor j in xrange(len(comment_list)):\n\t\t\t\tquery_file.write('queryid='+str(query_id)+'\\n')\n\t\t\t\tquery_file.write('ans_doc='+str(i)+'\\n')\n\t\t\t\tquery_file.write('query='+comment_list[j].strip()+'\\n')\n\t\t\t\tquery_id = query_id + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99970:Assign_L13_C3", "label": "paper = Document()", "type": "assigned_variable", "loc": [13, 13], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99970:For_L12_C2", "vector": [14, 3, 0.3421, 0.0263, 3, 0.94, 0.0, 446, 3, 1, 0, 0, 920, 10, 1], "semantic": {"name": "paper", "arg_names": [], "import_names": [], "rhs_call_name": "Document", "annotation": ""}, "snippet": "\t\t\tpaper = Document(i)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99970:Assign_L14_C3", "label": "comment_list = getComments()", "type": "assigned_variable", "loc": [14, 14], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99970:For_L12_C2", "vector": [14, 3, 0.3684, 0.0263, 3, 0.94, 0.5, 271, 3, 0, 0, 0, 103, 10, 1], "semantic": {"name": "comment_list", "arg_names": [], "import_names": [], "rhs_call_name": "getComments", "annotation": ""}, "snippet": "\t\t\tcomment_list = paper.getComments()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99970:For_L15_C3", "label": "for j", "type": "for", "loc": [15, 19], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99970:For_L12_C2", "vector": [6, 3, 0.4474, 0.1316, 3, 0.94, 1.0, 100, 3, 0, 0, 0, 0, 0, 8], "semantic": {"name": "j", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tfor j in xrange(len(comment_list)):\n\t\t\t\tquery_file.write('queryid='+str(query_id)+'\\n')\n\t\t\t\tquery_file.write('ans_doc='+str(i)+'\\n')\n\t\t\t\tquery_file.write('query='+comment_list[j].strip()+'\\n')\n\t\t\t\tquery_id = query_id + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99970:Expr_L16_C4", "label": "write()", "type": "expression", "loc": [16, 16], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99970:For_L15_C3", "vector": [8, 4, 0.4211, 0.0263, 4, 0.09, 0.0, 837, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": "\t\t\t\tquery_file.write('queryid='+str(query_id)+'\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99970:Expr_L17_C4", "label": "write()", "type": "expression", "loc": [17, 17], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99970:For_L15_C3", "vector": [8, 4, 0.4474, 0.0263, 4, 0.09, 0.3333, 837, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": "\t\t\t\tquery_file.write('ans_doc='+str(i)+'\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99970:Expr_L18_C4", "label": "write()", "type": "expression", "loc": [18, 18], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99970:For_L15_C3", "vector": [8, 4, 0.4737, 0.0263, 4, 0.09, 0.6667, 837, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": "\t\t\t\tquery_file.write('query='+comment_list[j].strip()+'\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99970:Assign_L19_C4", "label": "query_id =", "type": "assigned_variable", "loc": [19, 19], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99970:For_L15_C3", "vector": [14, 4, 0.5, 0.0263, 4, 0.09, 1.0, 163, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "query_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tquery_id = query_id + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99970:Expr_L20_C2", "label": "close()", "type": "expression", "loc": [20, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99970:FunctionDef_L9_C1", "vector": [8, 2, 0.5263, 0.0263, 2, 0.04, 1.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": "\t\tquery_file.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99970:FunctionDef_L22_C1", "label": "load", "type": "function", "loc": [22, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99970:ClassDef_L7_C0", "vector": [2, 1, 0.7105, 0.2895, 1, 0.87, 0.3333, 37, 0, 1, 0, 0, 0, 0, 15], "semantic": {"name": "load", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef load(self):\n\t\tself.query_list = []\n\t\tquery_file = open(query_path, 'r')\n\t\tlines = query_file.readlines()\n\t\tquery_file.close()\n\n\t\tquerycount = (len(lines) + 1) / 3\n\t\tfor i in xrange(0, len(lines), 3):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99970:Assign_L23_C2", "label": "self.query_list =", "type": "assigned_variable", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99970:FunctionDef_L22_C1", "vector": [14, 2, 0.6053, 0.0263, 2, 0.36, 0.0, 304, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.query_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.query_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99970:Assign_L24_C2", "label": "query_file = open()", "type": "assigned_variable", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99970:FunctionDef_L22_C1", "vector": [14, 2, 0.6316, 0.0263, 2, 0.36, 0.2, 587, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "query_file", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": "\t\tquery_file = open(query_path, 'r')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99970:Assign_L25_C2", "label": "lines = readlines()", "type": "assigned_variable", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99970:FunctionDef_L22_C1", "vector": [14, 2, 0.6579, 0.0263, 2, 0.36, 0.4, 73, 3, 0, 0, 0, 841, 10, 1], "semantic": {"name": "lines", "arg_names": [], "import_names": [], "rhs_call_name": "readlines", "annotation": ""}, "snippet": "\t\tlines = query_file.readlines()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99970:Expr_L26_C2", "label": "close()", "type": "expression", "loc": [26, 26], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99970:FunctionDef_L22_C1", "vector": [8, 2, 0.6842, 0.0263, 2, 0.36, 0.6, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": "\t\tquery_file.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99970:Assign_L28_C2", "label": "querycount =", "type": "assigned_variable", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99970:FunctionDef_L22_C1", "vector": [14, 2, 0.7368, 0.0263, 2, 0.36, 0.8, 19, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "querycount", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tquerycount = (len(lines) + 1) / 3"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99970:For_L29_C2", "label": "for i", "type": "for", "loc": [29, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99970:FunctionDef_L22_C1", "vector": [6, 2, 0.8026, 0.1053, 2, 0.36, 1.0, 826, 3, 0, 0, 0, 0, 0, 11], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor i in xrange(0, len(lines), 3):\n\t\t\tquery = Query(lines[i].split('=')[1].strip(),\n\t\t\t\t\tint(lines[i+1].split('=')[1].strip()),lines[i+2].split('=')[1].strip())\n\t\t\tself.query_list.append(query)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99970:Assign_L30_C3", "label": "query = Query()", "type": "assigned_variable", "loc": [30, 31], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99970:For_L29_C2", "vector": [14, 3, 0.8026, 0.0526, 3, 0.35, 0.0, 546, 3, 3, 0, 0, 279, 10, 8], "semantic": {"name": "query", "arg_names": [], "import_names": [], "rhs_call_name": "Query", "annotation": ""}, "snippet": "\t\t\tquery = Query(lines[i].split('=')[1].strip(),\n\t\t\t\t\tint(lines[i+1].split('=')[1].strip()),lines[i+2].split('=')[1].strip())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99970:Expr_L32_C3", "label": "append()", "type": "expression", "loc": [32, 32], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99970:For_L29_C2", "vector": [8, 3, 0.8421, 0.0263, 3, 0.35, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": "\t\t\tself.query_list.append(query)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99970:FunctionDef_L33_C1", "label": "getQuery", "type": "function", "loc": [33, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99970:ClassDef_L7_C0", "vector": [2, 1, 0.8816, 0.0526, 1, 0.87, 0.6667, 369, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "getQuery", "arg_names": ["self", "query_id"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef getQuery(self, query_id):\n\t\treturn self.query_list[query_id]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99970:Return_L34_C2", "label": "return", "type": "return", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99970:FunctionDef_L33_C1", "vector": [13, 2, 0.8947, 0.0263, 2, 0.75, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn self.query_list[query_id]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99970:FunctionDef_L36_C1", "label": "getSize", "type": "function", "loc": [36, 37], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99970:ClassDef_L7_C0", "vector": [2, 1, 0.9605, 0.0526, 1, 0.87, 1.0, 517, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "getSize", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef getSize(self):\n\t\treturn len(self.query_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99970:Return_L37_C2", "label": "return", "type": "return", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99970:FunctionDef_L36_C1", "vector": [13, 2, 0.9737, 0.0263, 2, 0.93, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn len(self.query_list)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99970:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99970:FunctionDef_L9_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99970:FunctionDef_L9_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99970:Assign_L10_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99970:FunctionDef_L9_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99970:Assign_L11_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99970:FunctionDef_L9_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99970:For_L12_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99970:For_L12_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99970:Assign_L13_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99970:For_L12_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99970:Assign_L14_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99970:For_L12_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99970:For_L15_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99970:For_L15_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99970:Expr_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99970:For_L15_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99970:Expr_L17_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99970:For_L15_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99970:Expr_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99970:For_L15_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99970:Assign_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99970:FunctionDef_L9_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99970:Expr_L20_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99970:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99970:FunctionDef_L22_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99970:FunctionDef_L22_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99970:Assign_L23_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99970:FunctionDef_L22_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99970:Assign_L24_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99970:FunctionDef_L22_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99970:Assign_L25_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99970:FunctionDef_L22_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99970:Expr_L26_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99970:FunctionDef_L22_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99970:Assign_L28_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99970:FunctionDef_L22_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99970:For_L29_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99970:For_L29_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99970:Assign_L30_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99970:For_L29_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99970:Expr_L32_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99970:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99970:FunctionDef_L33_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99970:FunctionDef_L33_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99970:Return_L34_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99970:ClassDef_L7_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99970:FunctionDef_L36_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99970:FunctionDef_L36_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99970:Return_L37_C2"}] |
from Lexicon import Lexicon
from ML import ML
from config import *
from TranslationModel import TranslationModel
class OfflineTranslationModel:
'''
compute offline sum P(q|w)*P(w|D)
'''
def create(self):
lexicon = Lexicon()
lexicon.load()
doc_list = []
offline_tm = []
for doc in xrange(doccount):
ml = ML(str(doc))
ml.load()
doc_list.append(ml)
trans_model = TranslationModel()
trans_model.load()
for doc in xrange(doccount):
print 'Processing doc ' + str(doc)
dic = {}
for wordid in doc_list[doc].getWordsList():
extensionlist = trans_model.getExtensionList(wordid)
for trans_id in extensionlist:
if dic.has_key(trans_id):
dic[trans_id] = dic[trans_id] + trans_model.getProb(wordid, trans_id) * doc_list[doc].getProb(wordid)
else:
dic[trans_id] = trans_model.getProb(wordid, trans_id) * doc_list[doc].getProb(wordid)
offline_tm.append(dic)
f = open(Offline_TM_path, 'w')
for doc in xrange(doccount):
line = ''
for (key, value) in offline_tm[doc].items():
line = line + str(key) + ':' + str(value) + ' '
line = line + '\n'
f.write(line)
def load(self):
self.offline_tm = []
f = open(offline_TM_path, 'r')
lines = f.readlines()
f.close()
for i in xrange(len(lines)):
items = lines[i].split()
dic = {}
for item in items:
dic[int(item.split(':')[0])] = float(item.split(':')[1].strip())
self.offline_tm.append(dic)
def getProb(self, docId, wordId):
if self.offline_tm[docId].has_key(wordId):
return self.offline_tm[docId][wordId]
else:
return 0.0
if __name__ == '__main__':
otm = OfflineTranslationModel()
otm.create()
otm.load()
print otm.getProb(5182, 10242)
| ajibawa-2023/Python-Code-Large/train/row_99971 | 54 | 61 | 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_99971:ImportFrom_L1_C0", "label": "from Lexicon import Lexicon", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0164, 0.0164, 0, 0.66, 0.0, 16, 0, 1, 0, 0, 16, 0, 0], "semantic": {"name": "Lexicon", "arg_names": [], "import_names": ["Lexicon"], "rhs_call_name": "", "annotation": ""}, "snippet": "from Lexicon import Lexicon"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99971:ImportFrom_L2_C0", "label": "from ML import ML", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0328, 0.0164, 0, 0.66, 0.2, 455, 0, 1, 0, 0, 455, 0, 0], "semantic": {"name": "ML", "arg_names": [], "import_names": ["ML"], "rhs_call_name": "", "annotation": ""}, "snippet": "from ML import ML"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99971:ImportFrom_L3_C0", "label": "from config import *", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0492, 0.0164, 0, 0.66, 0.4, 308, 0, 1, 0, 0, 308, 0, 0], "semantic": {"name": "config", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from config import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99971:ImportFrom_L4_C0", "label": "from TranslationModel import TranslationModel", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0656, 0.0164, 0, 0.66, 0.6, 753, 0, 1, 0, 0, 753, 0, 0], "semantic": {"name": "TranslationModel", "arg_names": [], "import_names": ["TranslationModel"], "rhs_call_name": "", "annotation": ""}, "snippet": "from TranslationModel import TranslationModel"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99971:ClassDef_L6_C0", "label": "OfflineTranslationModel", "type": "class", "loc": [6, 55], "level": 0, "parent": null, "vector": [3, 0, 0.5, 0.8197, 0, 0.66, 0.8, 38, 0, 3, 0, 0, 0, 0, 39], "semantic": {"name": "OfflineTranslationModel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class OfflineTranslationModel:\n\t'''\n\tcompute offline sum P(q|w)*P(w|D)\n\t'''\n\tdef create(self):\n\t\tlexicon = Lexicon()\n\t\tlexicon.load()\n\t\tdoc_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99971:Expr_L7_C1", "label": "expression", "type": "expression", "loc": [7, 9], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99971:ClassDef_L6_C0", "vector": [8, 1, 0.1311, 0.0492, 1, 0.62, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t'''\n\tcompute offline sum P(q|w)*P(w|D)\n\t'''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99971:FunctionDef_L10_C1", "label": "create", "type": "function", "loc": [10, 38], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99971:ClassDef_L6_C0", "vector": [2, 1, 0.3934, 0.4754, 1, 0.62, 0.3333, 316, 0, 1, 0, 0, 0, 0, 26], "semantic": {"name": "create", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef create(self):\n\t\tlexicon = Lexicon()\n\t\tlexicon.load()\n\t\tdoc_list = []\n\t\toffline_tm = []\n\t\tfor doc in xrange(doccount):\n\t\t\tml = ML(str(doc))\n\t\t\tml.load()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99971:Assign_L11_C2", "label": "lexicon = Lexicon()", "type": "assigned_variable", "loc": [11, 11], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99971:FunctionDef_L10_C1", "vector": [14, 2, 0.1803, 0.0164, 2, 0.63, 0.0, 675, 3, 0, 0, 0, 16, 10, 1], "semantic": {"name": "lexicon", "arg_names": [], "import_names": [], "rhs_call_name": "Lexicon", "annotation": ""}, "snippet": "\t\tlexicon = Lexicon()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99971:Expr_L12_C2", "label": "load()", "type": "expression", "loc": [12, 12], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99971:FunctionDef_L10_C1", "vector": [8, 2, 0.1967, 0.0164, 2, 0.63, 0.1111, 37, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "load", "arg_names": [], "import_names": [], "rhs_call_name": "load", "annotation": ""}, "snippet": "\t\tlexicon.load()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99971:Assign_L13_C2", "label": "doc_list =", "type": "assigned_variable", "loc": [13, 13], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99971:FunctionDef_L10_C1", "vector": [14, 2, 0.2131, 0.0164, 2, 0.63, 0.2222, 578, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "doc_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tdoc_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99971:Assign_L14_C2", "label": "offline_tm =", "type": "assigned_variable", "loc": [14, 14], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99971:FunctionDef_L10_C1", "vector": [14, 2, 0.2295, 0.0164, 2, 0.63, 0.3333, 654, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "offline_tm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\toffline_tm = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99971:For_L15_C2", "label": "for doc", "type": "for", "loc": [15, 18], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99971:FunctionDef_L10_C1", "vector": [6, 2, 0.2705, 0.0656, 2, 0.63, 0.4444, 555, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "doc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor doc in xrange(doccount):\n\t\t\tml = ML(str(doc))\n\t\t\tml.load()\n\t\t\tdoc_list.append(ml)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99971:Assign_L16_C3", "label": "ml = ML()", "type": "assigned_variable", "loc": [16, 16], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99971:For_L15_C2", "vector": [14, 3, 0.2623, 0.0164, 3, 0.02, 0.0, 965, 3, 1, 0, 0, 455, 10, 2], "semantic": {"name": "ml", "arg_names": [], "import_names": [], "rhs_call_name": "ML", "annotation": ""}, "snippet": "\t\t\tml = ML(str(doc))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99971:Expr_L17_C3", "label": "load()", "type": "expression", "loc": [17, 17], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99971:For_L15_C2", "vector": [8, 3, 0.2787, 0.0164, 3, 0.02, 0.5, 37, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "load", "arg_names": [], "import_names": [], "rhs_call_name": "load", "annotation": ""}, "snippet": "\t\t\tml.load()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99971:Expr_L18_C3", "label": "append()", "type": "expression", "loc": [18, 18], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99971:For_L15_C2", "vector": [8, 3, 0.2951, 0.0164, 3, 0.02, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": "\t\t\tdoc_list.append(ml)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99971:Assign_L19_C2", "label": "trans_model = TranslationModel()", "type": "assigned_variable", "loc": [19, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99971:FunctionDef_L10_C1", "vector": [14, 2, 0.3115, 0.0164, 2, 0.63, 0.5556, 827, 3, 0, 0, 0, 753, 10, 1], "semantic": {"name": "trans_model", "arg_names": [], "import_names": [], "rhs_call_name": "TranslationModel", "annotation": ""}, "snippet": "\t\ttrans_model = TranslationModel()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99971:Expr_L20_C2", "label": "load()", "type": "expression", "loc": [20, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99971:FunctionDef_L10_C1", "vector": [8, 2, 0.3279, 0.0164, 2, 0.63, 0.6667, 37, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "load", "arg_names": [], "import_names": [], "rhs_call_name": "load", "annotation": ""}, "snippet": "\t\ttrans_model.load()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99971:For_L21_C2", "label": "for doc", "type": "for", "loc": [21, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99971:FunctionDef_L10_C1", "vector": [6, 2, 0.4262, 0.1803, 2, 0.63, 0.7778, 555, 3, 0, 0, 0, 0, 0, 11], "semantic": {"name": "doc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor doc in xrange(doccount):\n\t\t\tprint('Processing doc ' + str(doc))\n\t\t\tdic = {}\n\t\t\tfor wordid in doc_list[doc].getWordsList():\n\t\t\t\textensionlist = trans_model.getExtensionList(wordid)\n\t\t\t\tfor trans_id in extensionlist:\n\t\t\t\t\tif dic.has_key(trans_id):\n\t\t\t\t\t\tdic[trans_id] = dic[trans_id] + trans_model.getProb(wordid, trans_id) *\tdoc_list[doc].getProb(wordid)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99971:Expr_L22_C3", "label": "print()", "type": "expression", "loc": [22, 22], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99971:For_L21_C2", "vector": [8, 3, 0.3607, 0.0164, 3, 0.63, 0.0, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\t\t\tprint('Processing doc ' + str(doc))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99971:Assign_L23_C3", "label": "dic =", "type": "assigned_variable", "loc": [23, 23], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99971:For_L21_C2", "vector": [14, 3, 0.377, 0.0164, 3, 0.63, 0.3333, 37, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "dic", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tdic = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99971:For_L24_C3", "label": "for wordid", "type": "for", "loc": [24, 30], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99971:For_L21_C2", "vector": [6, 3, 0.4426, 0.1148, 3, 0.63, 0.6667, 207, 3, 0, 0, 0, 0, 0, 7], "semantic": {"name": "wordid", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tfor wordid in doc_list[doc].getWordsList():\n\t\t\t\textensionlist = trans_model.getExtensionList(wordid)\n\t\t\t\tfor trans_id in extensionlist:\n\t\t\t\t\tif dic.has_key(trans_id):\n\t\t\t\t\t\tdic[trans_id] = dic[trans_id] + trans_model.getProb(wordid, trans_id) *\tdoc_list[doc].getProb(wordid)\n\t\t\t\t\telse:\n\t\t\t\t\t\tdic[trans_id] = trans_model.getProb(wordid, trans_id) *\tdoc_list[doc].getProb(wordid)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99971:Assign_L25_C4", "label": "extensionlist = getExtensionList()", "type": "assigned_variable", "loc": [25, 25], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99971:For_L24_C3", "vector": [14, 4, 0.4098, 0.0164, 4, 0.06, 0.0, 604, 3, 1, 0, 0, 302, 10, 1], "semantic": {"name": "extensionlist", "arg_names": [], "import_names": [], "rhs_call_name": "getExtensionList", "annotation": ""}, "snippet": "\t\t\t\textensionlist = trans_model.getExtensionList(wordid)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99971:For_L26_C4", "label": "for trans_id", "type": "for", "loc": [26, 30], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99971:For_L24_C3", "vector": [6, 4, 0.459, 0.082, 4, 0.06, 1.0, 666, 2, 0, 0, 0, 0, 0, 5], "semantic": {"name": "trans_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tfor trans_id in extensionlist:\n\t\t\t\t\tif dic.has_key(trans_id):\n\t\t\t\t\t\tdic[trans_id] = dic[trans_id] + trans_model.getProb(wordid, trans_id) *\tdoc_list[doc].getProb(wordid)\n\t\t\t\t\telse:\n\t\t\t\t\t\tdic[trans_id] = trans_model.getProb(wordid, trans_id) *\tdoc_list[doc].getProb(wordid)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99971:If_L27_C5", "label": "if", "type": "if", "loc": [27, 30], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99971:For_L26_C4", "vector": [4, 5, 0.4672, 0.0656, 5, 0.21, 0.0, 0, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\t\tif dic.has_key(trans_id):\n\t\t\t\t\t\tdic[trans_id] = dic[trans_id] + trans_model.getProb(wordid, trans_id) *\tdoc_list[doc].getProb(wordid)\n\t\t\t\t\telse:\n\t\t\t\t\t\tdic[trans_id] = trans_model.getProb(wordid, trans_id) *\tdoc_list[doc].getProb(wordid)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99971:Assign_L28_C6", "label": "assign", "type": "assigned_variable", "loc": [28, 28], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99971:If_L27_C5", "vector": [14, 6, 0.459, 0.0164, 6, 0.1, 0.0, 0, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\t\t\tdic[trans_id] = dic[trans_id] + trans_model.getProb(wordid, trans_id) *\tdoc_list[doc].getProb(wordid)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99971:Assign_L30_C6", "label": "assign", "type": "assigned_variable", "loc": [30, 30], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99971:If_L27_C5", "vector": [14, 6, 0.4918, 0.0164, 6, 0.1, 1.0, 0, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\t\t\tdic[trans_id] = trans_model.getProb(wordid, trans_id) *\tdoc_list[doc].getProb(wordid)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99971:Expr_L31_C3", "label": "append()", "type": "expression", "loc": [31, 31], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99971:For_L21_C2", "vector": [8, 3, 0.5082, 0.0164, 3, 0.63, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": "\t\t\toffline_tm.append(dic)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99971:Assign_L32_C2", "label": "f = open()", "type": "assigned_variable", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99971:FunctionDef_L10_C1", "vector": [14, 2, 0.5246, 0.0164, 2, 0.63, 0.8889, 899, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": "\t\tf = open(Offline_TM_path, 'w')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99971:For_L33_C2", "label": "for doc", "type": "for", "loc": [33, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99971:FunctionDef_L10_C1", "vector": [6, 2, 0.582, 0.0984, 2, 0.63, 1.0, 555, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "doc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor doc in xrange(doccount):\n\t\t\tline = ''\n\t\t\tfor (key, value) in offline_tm[doc].items():\n\t\t\t\tline = line + str(key) + ':' + str(value) + ' '\n\t\t\tline = line + '\\n'\n\t\t\tf.write(line)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99971:Assign_L34_C3", "label": "line =", "type": "assigned_variable", "loc": [34, 34], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99971:For_L33_C2", "vector": [14, 3, 0.5574, 0.0164, 3, 0.24, 0.0, 373, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "line", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tline = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99971:For_L35_C3", "label": "for key, value", "type": "for", "loc": [35, 36], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99971:For_L33_C2", "vector": [6, 3, 0.582, 0.0328, 3, 0.24, 0.3333, 839, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "key, value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tfor (key, value) in offline_tm[doc].items():\n\t\t\t\tline = line + str(key) + ':' + str(value) + ' '"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99971:Assign_L36_C4", "label": "line =", "type": "assigned_variable", "loc": [36, 36], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99971:For_L35_C3", "vector": [14, 4, 0.5902, 0.0164, 4, 0.01, 0.0, 373, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "line", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tline = line + str(key) + ':' + str(value) + ' '"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99971:Assign_L37_C3", "label": "line =", "type": "assigned_variable", "loc": [37, 37], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99971:For_L33_C2", "vector": [14, 3, 0.6066, 0.0164, 3, 0.24, 0.6667, 373, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "line", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tline = line + '\\n'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99971:Expr_L38_C3", "label": "write()", "type": "expression", "loc": [38, 38], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99971:For_L33_C2", "vector": [8, 3, 0.623, 0.0164, 3, 0.24, 1.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": "\t\t\tf.write(line)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99971:FunctionDef_L39_C1", "label": "load", "type": "function", "loc": [39, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99971:ClassDef_L6_C0", "vector": [2, 1, 0.7213, 0.1803, 1, 0.62, 0.6667, 37, 0, 1, 0, 0, 0, 0, 12], "semantic": {"name": "load", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef load(self):\n\t\tself.offline_tm = []\n\t\tf = open(offline_TM_path, 'r')\n\t\tlines = f.readlines()\n\t\tf.close()\n\t\tfor i in xrange(len(lines)):\n\t\t\titems = lines[i].split()\n\t\t\tdic = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99971:Assign_L40_C2", "label": "self.offline_tm =", "type": "assigned_variable", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99971:FunctionDef_L39_C1", "vector": [14, 2, 0.6557, 0.0164, 2, 0.55, 0.0, 287, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.offline_tm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.offline_tm = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99971:Assign_L41_C2", "label": "f = open()", "type": "assigned_variable", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99971:FunctionDef_L39_C1", "vector": [14, 2, 0.6721, 0.0164, 2, 0.55, 0.25, 899, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": "\t\tf = open(offline_TM_path, 'r')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99971:Assign_L42_C2", "label": "lines = readlines()", "type": "assigned_variable", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99971:FunctionDef_L39_C1", "vector": [14, 2, 0.6885, 0.0164, 2, 0.55, 0.5, 73, 3, 0, 0, 0, 841, 10, 1], "semantic": {"name": "lines", "arg_names": [], "import_names": [], "rhs_call_name": "readlines", "annotation": ""}, "snippet": "\t\tlines = f.readlines()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99971:Expr_L43_C2", "label": "close()", "type": "expression", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99971:FunctionDef_L39_C1", "vector": [8, 2, 0.7049, 0.0164, 2, 0.55, 0.75, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": "\t\tf.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99971:For_L44_C2", "label": "for i", "type": "for", "loc": [44, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99971:FunctionDef_L39_C1", "vector": [6, 2, 0.7623, 0.0984, 2, 0.55, 1.0, 826, 3, 0, 0, 0, 0, 0, 9], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor i in xrange(len(lines)):\n\t\t\titems = lines[i].split()\n\t\t\tdic = {}\n\t\t\tfor item in items:\n\t\t\t\tdic[int(item.split(':')[0])] = float(item.split(':')[1].strip())\n\t\t\tself.offline_tm.append(dic)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99971:Assign_L45_C3", "label": "items = split()", "type": "assigned_variable", "loc": [45, 45], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99971:For_L44_C2", "vector": [14, 3, 0.7377, 0.0164, 3, 0.51, 0.0, 339, 3, 0, 0, 0, 908, 10, 1], "semantic": {"name": "items", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": "\t\t\titems = lines[i].split()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99971:Assign_L46_C3", "label": "dic =", "type": "assigned_variable", "loc": [46, 46], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99971:For_L44_C2", "vector": [14, 3, 0.7541, 0.0164, 3, 0.51, 0.3333, 37, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "dic", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tdic = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99971:For_L47_C3", "label": "for item", "type": "for", "loc": [47, 48], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99971:For_L44_C2", "vector": [6, 3, 0.7787, 0.0328, 3, 0.51, 0.6667, 434, 2, 0, 0, 0, 0, 0, 5], "semantic": {"name": "item", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tfor item in items:\n\t\t\t\tdic[int(item.split(':')[0])] = float(item.split(':')[1].strip())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99971:Assign_L48_C4", "label": " = float()", "type": "assigned_variable", "loc": [48, 48], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99971:For_L47_C3", "vector": [14, 4, 0.7869, 0.0164, 4, 0.92, 0.0, 0, 3, 1, 0, 0, 639, 10, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "float", "annotation": ""}, "snippet": "\t\t\t\tdic[int(item.split(':')[0])] = float(item.split(':')[1].strip())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99971:Expr_L49_C3", "label": "append()", "type": "expression", "loc": [49, 49], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99971:For_L44_C2", "vector": [8, 3, 0.8033, 0.0164, 3, 0.51, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": "\t\t\tself.offline_tm.append(dic)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99971:FunctionDef_L51_C1", "label": "getProb", "type": "function", "loc": [51, 55], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99971:ClassDef_L6_C0", "vector": [2, 1, 0.8689, 0.082, 1, 0.62, 1.0, 528, 0, 3, 1, 0, 0, 0, 1], "semantic": {"name": "getProb", "arg_names": ["self", "docId", "wordId"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef getProb(self, docId, wordId):\n\t\tif self.offline_tm[docId].has_key(wordId):\n\t\t\treturn self.offline_tm[docId][wordId]\n\t\telse:\n\t\t\treturn 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99971:If_L52_C2", "label": "if", "type": "if", "loc": [52, 55], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99971:FunctionDef_L51_C1", "vector": [4, 2, 0.877, 0.0656, 2, 0.71, 0.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif self.offline_tm[docId].has_key(wordId):\n\t\t\treturn self.offline_tm[docId][wordId]\n\t\telse:\n\t\t\treturn 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99971:Return_L53_C3", "label": "return", "type": "return", "loc": [53, 53], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99971:If_L52_C2", "vector": [13, 3, 0.8689, 0.0164, 3, 0.22, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn self.offline_tm[docId][wordId]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99971:Return_L55_C3", "label": "return", "type": "return", "loc": [55, 55], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99971:If_L52_C2", "vector": [13, 3, 0.9016, 0.0164, 3, 0.22, 1.0, 0, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99971:If_L57_C0", "label": "if", "type": "if", "loc": [57, 61], "level": 0, "parent": null, "vector": [4, 0, 0.9672, 0.082, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n\totm = OfflineTranslationModel()\n\totm.create()\n\totm.load()\n\tprint(otm.getProb(5182, 10242))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99971:Assign_L58_C1", "label": "otm = OfflineTranslationModel()", "type": "assigned_variable", "loc": [58, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99971:If_L57_C0", "vector": [14, 1, 0.9508, 0.0164, 1, 0.75, 0.0, 780, 3, 0, 0, 0, 38, 10, 1], "semantic": {"name": "otm", "arg_names": [], "import_names": [], "rhs_call_name": "OfflineTranslationModel", "annotation": ""}, "snippet": "\totm = OfflineTranslationModel()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99971:Expr_L59_C1", "label": "create()", "type": "expression", "loc": [59, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99971:If_L57_C0", "vector": [8, 1, 0.9672, 0.0164, 1, 0.75, 0.3333, 316, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "create", "arg_names": [], "import_names": [], "rhs_call_name": "create", "annotation": ""}, "snippet": "\totm.create()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99971:Expr_L60_C1", "label": "load()", "type": "expression", "loc": [60, 60], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99971:If_L57_C0", "vector": [8, 1, 0.9836, 0.0164, 1, 0.75, 0.6667, 37, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "load", "arg_names": [], "import_names": [], "rhs_call_name": "load", "annotation": ""}, "snippet": "\totm.load()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99971:Expr_L61_C1", "label": "print()", "type": "expression", "loc": [61, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99971:If_L57_C0", "vector": [8, 1, 1.0, 0.0164, 1, 0.75, 1.0, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\tprint(otm.getProb(5182, 10242))"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99971:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99971:Expr_L7_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99971:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99971:FunctionDef_L10_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99971:FunctionDef_L10_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99971:Assign_L11_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99971:FunctionDef_L10_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99971:Expr_L12_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99971:FunctionDef_L10_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99971:Assign_L13_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99971:FunctionDef_L10_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99971:Assign_L14_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99971:FunctionDef_L10_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99971:For_L15_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99971:For_L15_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99971:Assign_L16_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99971:For_L15_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99971:Expr_L17_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99971:For_L15_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99971:Expr_L18_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99971:FunctionDef_L10_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99971:Assign_L19_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99971:FunctionDef_L10_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99971:Expr_L20_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99971:FunctionDef_L10_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99971:For_L21_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99971:For_L21_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99971:Expr_L22_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99971:For_L21_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99971:Assign_L23_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99971:For_L21_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99971:For_L24_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99971:For_L24_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99971:Assign_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99971:For_L24_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99971:For_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99971:For_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99971:If_L27_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99971:If_L27_C5", "t": "ajibawa-2023/Python-Code-Large/train/row_99971:Assign_L28_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99971:If_L27_C5", "t": "ajibawa-2023/Python-Code-Large/train/row_99971:Assign_L30_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99971:For_L21_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99971:Expr_L31_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99971:FunctionDef_L10_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99971:Assign_L32_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99971:FunctionDef_L10_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99971:For_L33_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99971:For_L33_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99971:Assign_L34_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99971:For_L33_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99971:For_L35_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99971:For_L35_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99971:Assign_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99971:For_L33_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99971:Assign_L37_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99971:For_L33_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99971:Expr_L38_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99971:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99971:FunctionDef_L39_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99971:FunctionDef_L39_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99971:Assign_L40_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99971:FunctionDef_L39_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99971:Assign_L41_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99971:FunctionDef_L39_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99971:Assign_L42_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99971:FunctionDef_L39_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99971:Expr_L43_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99971:FunctionDef_L39_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99971:For_L44_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99971:For_L44_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99971:Assign_L45_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99971:For_L44_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99971:Assign_L46_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99971:For_L44_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99971:For_L47_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99971:For_L47_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99971:Assign_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99971:For_L44_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99971:Expr_L49_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99971:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99971:FunctionDef_L51_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99971:FunctionDef_L51_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99971:If_L52_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99971:If_L52_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99971:Return_L53_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99971:If_L52_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99971:Return_L55_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99971:If_L57_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99971:Assign_L58_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99971:If_L57_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99971:Expr_L59_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99971:If_L57_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99971:Expr_L60_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99971:If_L57_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99971:Expr_L61_C1"}] |
from config import OfflineTMSingle_path
from os.path import join
class OfflineTMSingle:
def __init__(self, docId):
self.path = join(OfflineTMSingle_path, str(docId))
def load(self):
self.model = {}
f = open(self.path, 'r')
line = f.readlines()[0]
f.close()
items = line.split()
for item in items:
self.model[int(item.split(':')[0])]=float(item.split(':')[1])
def getProb(self, wordId):
if self.model.has_key(wordId):
return self.model[wordId]
return 0.0
if __name__ == '__main__':
otms = OfflineTMSingle(12)
otms.load()
print otms.getProb(262153)
| ajibawa-2023/Python-Code-Large/train/row_99972 | 21 | 23 | 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_99972:ImportFrom_L1_C0", "label": "from config import OfflineTMSingle_path", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0435, 0.0435, 0, 0.66, 0.0, 308, 0, 1, 0, 0, 308, 0, 0], "semantic": {"name": "config", "arg_names": [], "import_names": ["OfflineTMSingle_path"], "rhs_call_name": "", "annotation": ""}, "snippet": "from config import OfflineTMSingle_path"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99972:ImportFrom_L2_C0", "label": "from os.path import join", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.087, 0.0435, 0, 0.66, 0.3333, 79, 0, 1, 0, 0, 79, 0, 0], "semantic": {"name": "os.path", "arg_names": [], "import_names": ["join"], "rhs_call_name": "", "annotation": ""}, "snippet": "from os.path import join"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99972:ClassDef_L4_C0", "label": "OfflineTMSingle", "type": "class", "loc": [4, 19], "level": 0, "parent": null, "vector": [3, 0, 0.5, 0.6957, 0, 0.66, 0.6667, 106, 0, 3, 0, 0, 0, 0, 11], "semantic": {"name": "OfflineTMSingle", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class OfflineTMSingle:\n\tdef __init__(self, docId):\n\t\tself.path = join(OfflineTMSingle_path, str(docId))\n\t\n\tdef load(self):\n\t\tself.model = {}\n\t\tf = open(self.path, 'r')\n\t\tline = f.readlines()[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99972:FunctionDef_L5_C1", "label": "__init__", "type": "function", "loc": [5, 6], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99972:ClassDef_L4_C0", "vector": [2, 1, 0.2391, 0.087, 1, 0.57, 0.0, 555, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "__init__", "arg_names": ["self", "docId"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __init__(self, docId):\n\t\tself.path = join(OfflineTMSingle_path, str(docId))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99972:Assign_L6_C2", "label": "self.path = join()", "type": "assigned_variable", "loc": [6, 6], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99972:FunctionDef_L5_C1", "vector": [14, 2, 0.2609, 0.0435, 2, 0.8, 0.0, 425, 3, 2, 0, 0, 933, 10, 2], "semantic": {"name": "self.path", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": "\t\tself.path = join(OfflineTMSingle_path, str(docId))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99972:FunctionDef_L8_C1", "label": "load", "type": "function", "loc": [8, 15], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99972:ClassDef_L4_C0", "vector": [2, 1, 0.5, 0.3478, 1, 0.57, 0.5, 37, 0, 1, 0, 0, 0, 0, 8], "semantic": {"name": "load", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef load(self):\n\t\tself.model = {}\n\t\tf = open(self.path, 'r')\n\t\tline = f.readlines()[0]\n\t\tf.close()\n\t\titems = line.split()\n\t\tfor item in items:\n\t\t\tself.model[int(item.split(':')[0])]=float(item.split(':')[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99972:Assign_L9_C2", "label": "self.model =", "type": "assigned_variable", "loc": [9, 9], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99972:FunctionDef_L8_C1", "vector": [14, 2, 0.3913, 0.0435, 2, 0.24, 0.0, 81, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.model", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.model = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99972:Assign_L10_C2", "label": "f = open()", "type": "assigned_variable", "loc": [10, 10], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99972:FunctionDef_L8_C1", "vector": [14, 2, 0.4348, 0.0435, 2, 0.24, 0.2, 899, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": "\t\tf = open(self.path, 'r')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99972:Assign_L11_C2", "label": "line =", "type": "assigned_variable", "loc": [11, 11], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99972:FunctionDef_L8_C1", "vector": [14, 2, 0.4783, 0.0435, 2, 0.24, 0.4, 373, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "line", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tline = f.readlines()[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99972:Expr_L12_C2", "label": "close()", "type": "expression", "loc": [12, 12], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99972:FunctionDef_L8_C1", "vector": [8, 2, 0.5217, 0.0435, 2, 0.24, 0.6, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": "\t\tf.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99972:Assign_L13_C2", "label": "items = split()", "type": "assigned_variable", "loc": [13, 13], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99972:FunctionDef_L8_C1", "vector": [14, 2, 0.5652, 0.0435, 2, 0.24, 0.8, 339, 3, 0, 0, 0, 908, 10, 1], "semantic": {"name": "items", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": "\t\titems = line.split()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99972:For_L14_C2", "label": "for item", "type": "for", "loc": [14, 15], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99972:FunctionDef_L8_C1", "vector": [6, 2, 0.6304, 0.087, 2, 0.24, 1.0, 434, 2, 0, 0, 0, 0, 0, 4], "semantic": {"name": "item", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor item in items:\n\t\t\tself.model[int(item.split(':')[0])]=float(item.split(':')[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99972:Assign_L15_C3", "label": " = float()", "type": "assigned_variable", "loc": [15, 15], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99972:For_L14_C2", "vector": [14, 3, 0.6522, 0.0435, 3, 0.87, 0.0, 0, 3, 1, 0, 0, 639, 10, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "float", "annotation": ""}, "snippet": "\t\t\tself.model[int(item.split(':')[0])]=float(item.split(':')[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99972:FunctionDef_L16_C1", "label": "getProb", "type": "function", "loc": [16, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99972:ClassDef_L4_C0", "vector": [2, 1, 0.7609, 0.1739, 1, 0.57, 1.0, 528, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "getProb", "arg_names": ["self", "wordId"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef getProb(self, wordId):\n\t\tif self.model.has_key(wordId):\n\t\t\treturn self.model[wordId]\n\t\treturn 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99972:If_L17_C2", "label": "if", "type": "if", "loc": [17, 18], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99972:FunctionDef_L16_C1", "vector": [4, 2, 0.7609, 0.087, 2, 0.64, 0.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif self.model.has_key(wordId):\n\t\t\treturn self.model[wordId]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99972:Return_L18_C3", "label": "return", "type": "return", "loc": [18, 18], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99972:If_L17_C2", "vector": [13, 3, 0.7826, 0.0435, 3, 0.67, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn self.model[wordId]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99972:Return_L19_C2", "label": "return", "type": "return", "loc": [19, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99972:FunctionDef_L16_C1", "vector": [13, 2, 0.8261, 0.0435, 2, 0.64, 1.0, 0, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99972:If_L20_C0", "label": "if", "type": "if", "loc": [20, 23], "level": 0, "parent": null, "vector": [4, 0, 0.9348, 0.1739, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n\totms = OfflineTMSingle(12)\n\totms.load()\n\tprint(otms.getProb(262153))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99972:Assign_L21_C1", "label": "otms = OfflineTMSingle()", "type": "assigned_variable", "loc": [21, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99972:If_L20_C0", "vector": [14, 1, 0.913, 0.0435, 1, 0.77, 0.0, 178, 3, 1, 0, 0, 106, 10, 1], "semantic": {"name": "otms", "arg_names": [], "import_names": [], "rhs_call_name": "OfflineTMSingle", "annotation": ""}, "snippet": "\totms = OfflineTMSingle(12)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99972:Expr_L22_C1", "label": "load()", "type": "expression", "loc": [22, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99972:If_L20_C0", "vector": [8, 1, 0.9565, 0.0435, 1, 0.77, 0.5, 37, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "load", "arg_names": [], "import_names": [], "rhs_call_name": "load", "annotation": ""}, "snippet": "\totms.load()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99972:Expr_L23_C1", "label": "print()", "type": "expression", "loc": [23, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99972:If_L20_C0", "vector": [8, 1, 1.0, 0.0435, 1, 0.77, 1.0, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\tprint(otms.getProb(262153))"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99972:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99972:FunctionDef_L5_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99972:FunctionDef_L5_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99972:Assign_L6_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99972:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99972:FunctionDef_L8_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99972:FunctionDef_L8_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99972:Assign_L9_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99972:FunctionDef_L8_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99972:Assign_L10_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99972:FunctionDef_L8_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99972:Assign_L11_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99972:FunctionDef_L8_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99972:Expr_L12_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99972:FunctionDef_L8_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99972:Assign_L13_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99972:FunctionDef_L8_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99972:For_L14_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99972:For_L14_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99972:Assign_L15_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99972:ClassDef_L4_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99972:FunctionDef_L16_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99972:FunctionDef_L16_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99972:If_L17_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99972:If_L17_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99972:Return_L18_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99972:FunctionDef_L16_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99972:Return_L19_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99972:If_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99972:Assign_L21_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99972:If_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99972:Expr_L22_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99972:If_L20_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99972:Expr_L23_C1"}] |
import os
from config import *
import logging
class Document:
'''
一篇文档的对象
'''
def __init__(self, docnum):
self.path = os.path.join(datapath, str(docnum))
if not os.path.exists(self.path):
logging.error('Not exists %s' % self.path)
f = open(self.path, 'r')
lines = f.readlines()
f.close()
self.title = lines[0].split('=')[1].strip()
self.abstract = lines[1].split('=')[1].strip()
self.body = lines[2].split('=')[1].strip()
self.comments = []
for line in lines[4:]:
self.comments.append(line)
def getTitle(self):
return self.title
def getAbstract(self):
return self.abstract
def getBody(self):
return self.body
def getComments(self):
return self.comments
def getFulltext(self):
return ' '.join([self.title, self.abstract, self.body])
if __name__ == '__main__':
logging.basicConfig(filename='log', format='%(asctime)s %(levelname)s %(message)s',
level=logging.DEBUG)
paper = Document(38300)
print paper.getTitle()
print paper.getAbstract()
print paper.getBody()
print '\n'.join(paper.getComments())
print '--------------------------------'
print paper.getPassageModels()
| ajibawa-2023/Python-Code-Large/train/row_99973 | 27 | 38 | 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_99973:Import_L1_C0", "label": "os import os", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0263, 0.0263, 0, 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_99973:ImportFrom_L2_C0", "label": "from config import *", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0526, 0.0263, 0, 0.66, 0.3333, 308, 0, 1, 0, 0, 308, 0, 0], "semantic": {"name": "config", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from config import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99973:Import_L3_C0", "label": "logging import logging", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0789, 0.0263, 0, 0.66, 0.6667, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "logging", "arg_names": [], "import_names": ["logging"], "rhs_call_name": "", "annotation": ""}, "snippet": "import logging"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99973:ClassDef_L5_C0", "label": "Document", "type": "class", "loc": [5, 36], "level": 0, "parent": null, "vector": [3, 0, 0.5395, 0.8421, 0, 0.66, 1.0, 920, 0, 6, 0, 0, 0, 0, 15], "semantic": {"name": "Document", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Document:\n\tdef __init__(self, docnum):\n\t\tself.path = os.path.join(datapath, str(docnum))\n\t\tif not os.path.exists(self.path):\n\t\t\tlogging.error('Not exists %s' % self.path) \n\t\tf = open(self.path, 'r')\n\t\tlines = f.readlines()\n\t\tf.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99973:FunctionDef_L6_C1", "label": "__init__", "type": "function", "loc": [6, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99973:ClassDef_L5_C0", "vector": [2, 1, 0.3553, 0.4211, 1, 0.79, 0.0, 555, 0, 2, 0, 0, 0, 0, 14], "semantic": {"name": "__init__", "arg_names": ["self", "docnum"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __init__(self, docnum):\n\t\tself.path = os.path.join(datapath, str(docnum))\n\t\tif not os.path.exists(self.path):\n\t\t\tlogging.error('Not exists %s' % self.path) \n\t\tf = open(self.path, 'r')\n\t\tlines = f.readlines()\n\t\tf.close()\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99973:Assign_L7_C2", "label": "self.path = join()", "type": "assigned_variable", "loc": [7, 7], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99973:FunctionDef_L6_C1", "vector": [14, 2, 0.1842, 0.0263, 2, 0.79, 0.0, 425, 3, 2, 0, 0, 933, 10, 2], "semantic": {"name": "self.path", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": "\t\tself.path = os.path.join(datapath, str(docnum))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99973:If_L8_C2", "label": "if", "type": "if", "loc": [8, 9], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99973:FunctionDef_L6_C1", "vector": [4, 2, 0.2237, 0.0526, 2, 0.79, 0.1111, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif not os.path.exists(self.path):\n\t\t\tlogging.error('Not exists %s' % self.path) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99973:Expr_L9_C3", "label": "error()", "type": "expression", "loc": [9, 9], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99973:If_L8_C2", "vector": [8, 3, 0.2368, 0.0263, 3, 0.14, 0.0, 771, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "error", "arg_names": [], "import_names": [], "rhs_call_name": "error", "annotation": ""}, "snippet": "\t\t\tlogging.error('Not exists %s' % self.path) "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99973:Assign_L10_C2", "label": "f = open()", "type": "assigned_variable", "loc": [10, 10], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99973:FunctionDef_L6_C1", "vector": [14, 2, 0.2632, 0.0263, 2, 0.79, 0.2222, 899, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": "\t\tf = open(self.path, 'r')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99973:Assign_L11_C2", "label": "lines = readlines()", "type": "assigned_variable", "loc": [11, 11], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99973:FunctionDef_L6_C1", "vector": [14, 2, 0.2895, 0.0263, 2, 0.79, 0.3333, 73, 3, 0, 0, 0, 841, 10, 1], "semantic": {"name": "lines", "arg_names": [], "import_names": [], "rhs_call_name": "readlines", "annotation": ""}, "snippet": "\t\tlines = f.readlines()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99973:Expr_L12_C2", "label": "close()", "type": "expression", "loc": [12, 12], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99973:FunctionDef_L6_C1", "vector": [8, 2, 0.3158, 0.0263, 2, 0.79, 0.4444, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": "\t\tf.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99973:Assign_L14_C2", "label": "self.title = strip()", "type": "assigned_variable", "loc": [14, 14], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99973:FunctionDef_L6_C1", "vector": [14, 2, 0.3684, 0.0263, 2, 0.79, 0.5556, 629, 3, 0, 0, 0, 973, 10, 2], "semantic": {"name": "self.title", "arg_names": [], "import_names": [], "rhs_call_name": "strip", "annotation": ""}, "snippet": "\t\tself.title = lines[0].split('=')[1].strip()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99973:Assign_L15_C2", "label": "self.abstract = strip()", "type": "assigned_variable", "loc": [15, 15], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99973:FunctionDef_L6_C1", "vector": [14, 2, 0.3947, 0.0263, 2, 0.79, 0.6667, 792, 3, 0, 0, 0, 973, 10, 2], "semantic": {"name": "self.abstract", "arg_names": [], "import_names": [], "rhs_call_name": "strip", "annotation": ""}, "snippet": "\t\tself.abstract = lines[1].split('=')[1].strip()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99973:Assign_L16_C2", "label": "self.body = strip()", "type": "assigned_variable", "loc": [16, 16], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99973:FunctionDef_L6_C1", "vector": [14, 2, 0.4211, 0.0263, 2, 0.79, 0.7778, 523, 3, 0, 0, 0, 973, 10, 2], "semantic": {"name": "self.body", "arg_names": [], "import_names": [], "rhs_call_name": "strip", "annotation": ""}, "snippet": "\t\tself.body = lines[2].split('=')[1].strip()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99973:Assign_L18_C2", "label": "self.comments =", "type": "assigned_variable", "loc": [18, 18], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99973:FunctionDef_L6_C1", "vector": [14, 2, 0.4737, 0.0263, 2, 0.79, 0.8889, 384, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.comments", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.comments = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99973:For_L20_C2", "label": "for line", "type": "for", "loc": [20, 21], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99973:FunctionDef_L6_C1", "vector": [6, 2, 0.5395, 0.0526, 2, 0.79, 1.0, 373, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "line", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor line in lines[4:]:\n\t\t\tself.comments.append(line)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99973:Expr_L21_C3", "label": "append()", "type": "expression", "loc": [21, 21], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99973:For_L20_C2", "vector": [8, 3, 0.5526, 0.0263, 3, 0.37, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": "\t\t\tself.comments.append(line)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99973:FunctionDef_L23_C1", "label": "getTitle", "type": "function", "loc": [23, 24], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99973:ClassDef_L5_C0", "vector": [2, 1, 0.6184, 0.0526, 1, 0.79, 0.2, 651, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "getTitle", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef getTitle(self):\n\t\treturn self.title"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99973:Return_L24_C2", "label": "return", "type": "return", "loc": [24, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99973:FunctionDef_L23_C1", "vector": [13, 2, 0.6316, 0.0263, 2, 0.51, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn self.title"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99973:FunctionDef_L26_C1", "label": "getAbstract", "type": "function", "loc": [26, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99973:ClassDef_L5_C0", "vector": [2, 1, 0.6974, 0.0526, 1, 0.79, 0.4, 556, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "getAbstract", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef getAbstract(self):\n\t\treturn self.abstract"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99973:Return_L27_C2", "label": "return", "type": "return", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99973:FunctionDef_L26_C1", "vector": [13, 2, 0.7105, 0.0263, 2, 0.52, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn self.abstract"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99973:FunctionDef_L29_C1", "label": "getBody", "type": "function", "loc": [29, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99973:ClassDef_L5_C0", "vector": [2, 1, 0.7763, 0.0526, 1, 0.79, 0.6, 765, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "getBody", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef getBody(self):\n\t\treturn self.body"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99973:Return_L30_C2", "label": "return", "type": "return", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99973:FunctionDef_L29_C1", "vector": [13, 2, 0.7895, 0.0263, 2, 0.38, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn self.body"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99973:FunctionDef_L32_C1", "label": "getComments", "type": "function", "loc": [32, 33], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99973:ClassDef_L5_C0", "vector": [2, 1, 0.8553, 0.0526, 1, 0.79, 0.8, 103, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "getComments", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef getComments(self):\n\t\treturn self.comments"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99973:Return_L33_C2", "label": "return", "type": "return", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99973:FunctionDef_L32_C1", "vector": [13, 2, 0.8684, 0.0263, 2, 0.44, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn self.comments"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99973:FunctionDef_L35_C1", "label": "getFulltext", "type": "function", "loc": [35, 36], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99973:ClassDef_L5_C0", "vector": [2, 1, 0.9342, 0.0526, 1, 0.79, 1.0, 4, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "getFulltext", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef getFulltext(self):\n\t\treturn ' '.join([self.title, self.abstract, self.body])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99973:Return_L36_C2", "label": "return", "type": "return", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99973:FunctionDef_L35_C1", "vector": [13, 2, 0.9474, 0.0263, 2, 0.21, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn ' '.join([self.title, self.abstract, self.body])"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99973:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99973:FunctionDef_L6_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99973:FunctionDef_L6_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99973:Assign_L7_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99973:FunctionDef_L6_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99973:If_L8_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99973:If_L8_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99973:Expr_L9_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99973:FunctionDef_L6_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99973:Assign_L10_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99973:FunctionDef_L6_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99973:Assign_L11_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99973:FunctionDef_L6_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99973:Expr_L12_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99973:FunctionDef_L6_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99973:Assign_L14_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99973:FunctionDef_L6_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99973:Assign_L15_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99973:FunctionDef_L6_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99973:Assign_L16_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99973:FunctionDef_L6_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99973:Assign_L18_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99973:FunctionDef_L6_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99973:For_L20_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99973:For_L20_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99973:Expr_L21_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99973:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99973:FunctionDef_L23_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99973:FunctionDef_L23_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99973:Return_L24_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99973:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99973:FunctionDef_L26_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99973:FunctionDef_L26_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99973:Return_L27_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99973:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99973:FunctionDef_L29_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99973:FunctionDef_L29_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99973:Return_L30_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99973:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99973:FunctionDef_L32_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99973:FunctionDef_L32_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99973:Return_L33_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99973:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99973:FunctionDef_L35_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99973:FunctionDef_L35_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99973:Return_L36_C2"}] |
from os.path import exists, join
from Document import Document
from Lexicon import Lexicon
from config import *
class Query:
'''
for a specific query indexed by its number
'''
def __init__(self, query_id, ans_doc, query):
self.query_id = query_id
self.ans_doc = ans_doc
self.query = query
#query有三个属性,ansdoc代表与这个query相关的文档编号,query代表这个query的字面内容,query_id是这个query的编号
def getAnsdoc(self):
return self.ans_doc
def getQuery(self):
return self.query
def getQueryId(self):
return self.query_id
def setAnsdoc(self, ans_doc):
self.ans_doc = ans_doc
def setQuery(self, query):
self.query = query
def setQueryId(self, query_id):
self.query_id = query_id
| ajibawa-2023/Python-Code-Large/train/row_99974 | 22 | 30 | 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_99974:ImportFrom_L1_C0", "label": "from os.path import exists, join", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0333, 0.0333, 0, 0.66, 0.0, 79, 0, 2, 0, 0, 79, 0, 0], "semantic": {"name": "os.path", "arg_names": [], "import_names": ["exists", "join"], "rhs_call_name": "", "annotation": ""}, "snippet": "from os.path import exists, join"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99974:ImportFrom_L2_C0", "label": "from Document import Document", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0667, 0.0333, 0, 0.66, 0.25, 920, 0, 1, 0, 0, 920, 0, 0], "semantic": {"name": "Document", "arg_names": [], "import_names": ["Document"], "rhs_call_name": "", "annotation": ""}, "snippet": "from Document import Document"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99974:ImportFrom_L3_C0", "label": "from Lexicon import Lexicon", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.1, 0.0333, 0, 0.66, 0.5, 16, 0, 1, 0, 0, 16, 0, 0], "semantic": {"name": "Lexicon", "arg_names": [], "import_names": ["Lexicon"], "rhs_call_name": "", "annotation": ""}, "snippet": "from Lexicon import Lexicon"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99974:ImportFrom_L4_C0", "label": "from config import *", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.1333, 0.0333, 0, 0.66, 0.75, 308, 0, 1, 0, 0, 308, 0, 0], "semantic": {"name": "config", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from config import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99974:ClassDef_L6_C0", "label": "Query", "type": "class", "loc": [6, 29], "level": 0, "parent": null, "vector": [3, 0, 0.5833, 0.8, 0, 0.66, 1.0, 279, 0, 7, 0, 0, 0, 0, 0], "semantic": {"name": "Query", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Query:\n\t\n\t'''\n\tfor a specific query indexed by its number\n\t'''\n\tdef __init__(self, query_id, ans_doc, query):\n\t\tself.query_id = query_id\n\t\tself.ans_doc = ans_doc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99974:Expr_L8_C1", "label": "expression", "type": "expression", "loc": [8, 10], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99974:ClassDef_L6_C0", "vector": [8, 1, 0.3, 0.1, 1, 0.74, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t'''\n\tfor a specific query indexed by its number\n\t'''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99974:FunctionDef_L11_C1", "label": "__init__", "type": "function", "loc": [11, 14], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99974:ClassDef_L6_C0", "vector": [2, 1, 0.4167, 0.1333, 1, 0.74, 0.1429, 555, 0, 4, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "query_id", "ans_doc", "query"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __init__(self, query_id, ans_doc, query):\n\t\tself.query_id = query_id\n\t\tself.ans_doc = ans_doc\n\t\tself.query = query"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99974:Assign_L12_C2", "label": "self.query_id =", "type": "assigned_variable", "loc": [12, 12], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99974:FunctionDef_L11_C1", "vector": [14, 2, 0.4, 0.0333, 2, 0.31, 0.0, 612, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.query_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.query_id = query_id"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99974:Assign_L13_C2", "label": "self.ans_doc =", "type": "assigned_variable", "loc": [13, 13], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99974:FunctionDef_L11_C1", "vector": [14, 2, 0.4333, 0.0333, 2, 0.31, 0.5, 495, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.ans_doc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.ans_doc = ans_doc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99974:Assign_L14_C2", "label": "self.query =", "type": "assigned_variable", "loc": [14, 14], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99974:FunctionDef_L11_C1", "vector": [14, 2, 0.4667, 0.0333, 2, 0.31, 1.0, 241, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.query", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.query = query"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99974:FunctionDef_L16_C1", "label": "getAnsdoc", "type": "function", "loc": [16, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99974:ClassDef_L6_C0", "vector": [2, 1, 0.55, 0.0667, 1, 0.74, 0.2857, 435, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "getAnsdoc", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef getAnsdoc(self):\n\t\treturn self.ans_doc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99974:Return_L17_C2", "label": "return", "type": "return", "loc": [17, 17], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99974:FunctionDef_L16_C1", "vector": [13, 2, 0.5667, 0.0333, 2, 0.48, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn self.ans_doc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99974:FunctionDef_L18_C1", "label": "getQuery", "type": "function", "loc": [18, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99974:ClassDef_L6_C0", "vector": [2, 1, 0.6167, 0.0667, 1, 0.74, 0.4286, 369, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "getQuery", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef getQuery(self):\n\t\treturn self.query"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99974:Return_L19_C2", "label": "return", "type": "return", "loc": [19, 19], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99974:FunctionDef_L18_C1", "vector": [13, 2, 0.6333, 0.0333, 2, 0.27, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn self.query"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99974:FunctionDef_L20_C1", "label": "getQueryId", "type": "function", "loc": [20, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99974:ClassDef_L6_C0", "vector": [2, 1, 0.6833, 0.0667, 1, 0.74, 0.5714, 710, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "getQueryId", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef getQueryId(self):\n\t\treturn self.query_id"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99974:Return_L21_C2", "label": "return", "type": "return", "loc": [21, 21], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99974:FunctionDef_L20_C1", "vector": [13, 2, 0.7, 0.0333, 2, 0.71, 0.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn self.query_id"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99974:FunctionDef_L24_C1", "label": "setAnsdoc", "type": "function", "loc": [24, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99974:ClassDef_L6_C0", "vector": [2, 1, 0.8167, 0.0667, 1, 0.74, 0.7143, 506, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "setAnsdoc", "arg_names": ["self", "ans_doc"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef setAnsdoc(self, ans_doc):\n\t\tself.ans_doc = ans_doc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99974:Assign_L25_C2", "label": "self.ans_doc =", "type": "assigned_variable", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99974:FunctionDef_L24_C1", "vector": [14, 2, 0.8333, 0.0333, 2, 0.77, 0.0, 495, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.ans_doc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.ans_doc = ans_doc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99974:FunctionDef_L26_C1", "label": "setQuery", "type": "function", "loc": [26, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99974:ClassDef_L6_C0", "vector": [2, 1, 0.8833, 0.0667, 1, 0.74, 0.8571, 321, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "setQuery", "arg_names": ["self", "query"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef setQuery(self, query):\n\t\tself.query = query"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99974:Assign_L27_C2", "label": "self.query =", "type": "assigned_variable", "loc": [27, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99974:FunctionDef_L26_C1", "vector": [14, 2, 0.9, 0.0333, 2, 0.12, 0.0, 241, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.query", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.query = query"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99974:FunctionDef_L28_C1", "label": "setQueryId", "type": "function", "loc": [28, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99974:ClassDef_L6_C0", "vector": [2, 1, 0.95, 0.0667, 1, 0.74, 1.0, 494, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "setQueryId", "arg_names": ["self", "query_id"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef setQueryId(self, query_id):\n\t\tself.query_id = query_id"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99974:Assign_L29_C2", "label": "self.query_id =", "type": "assigned_variable", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99974:FunctionDef_L28_C1", "vector": [14, 2, 0.9667, 0.0333, 2, 0.36, 0.0, 612, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.query_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.query_id = query_id"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99974:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99974:Expr_L8_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99974:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99974:FunctionDef_L11_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99974:FunctionDef_L11_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99974:Assign_L12_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99974:FunctionDef_L11_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99974:Assign_L13_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99974:FunctionDef_L11_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99974:Assign_L14_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99974:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99974:FunctionDef_L16_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99974:FunctionDef_L16_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99974:Return_L17_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99974:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99974:FunctionDef_L18_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99974:FunctionDef_L18_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99974:Return_L19_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99974:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99974:FunctionDef_L20_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99974:FunctionDef_L20_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99974:Return_L21_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99974:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99974:FunctionDef_L24_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99974:FunctionDef_L24_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99974:Assign_L25_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99974:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99974:FunctionDef_L26_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99974:FunctionDef_L26_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99974:Assign_L27_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99974:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99974:FunctionDef_L28_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99974:FunctionDef_L28_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99974:Assign_L29_C2"}] |
from config import *
from os.path import exists
from Document import Document
from Lexicon import Lexicon
from os import mkdir,rmdir
import os.path
class ML:
'''Generate collection-wise and document-wise information , namely P(w|C), P(w|D)'''
'''doc是一个字符串形式,字符串字面可以为数字或collection,前者代表文档的ML,后者代表集合的ML'''
def __init__(self, doc):
'''
doc can be a document number or collection as the whole
doc must be str type
'''
self.doc = doc
#ML信息,列表形式,有很多0存在
def getML(self, lexicon, word_list):
'''
word num is 1-indexed
'''
numTerms = lexicon.getSize()+1
ML = []
for i in xrange(numTerms):
ML.append(0)
for word in word_list:
word_index = lexicon.getIdByTerm(word)
ML[word_index] = ML[word_index] + 1
ML[0] = ML[0] + 1
return ML
#这个和上面的意义一样,只是是一个字典的形式
def getML_dict(self, lexicon, word_list):
model = {}
model[0] = len(word_list)
for word in word_list:
word_index = lexicon.getIdByTerm(word)
if model.has_key(word_index):
model[word_index] = model[word_index] + 1
else:
model[word_index] = 1
return model
def create(self):
if exists(ML_path):
rmdir(ML_path)
mkdir(ML_path)
lexicon = Lexicon()
lexicon.load()
collection_content = ''
for doc_index in xrange(doccount):
print 'Processing ' + str(doc_index)
paper = Document(doc_index)
content = paper.getFulltext()
word_list = content.split()
doc_ML = self.getML(lexicon, word_list)
f = open(os.path.join(ML_path, str(doc_index)), 'w')
f.write(str(doc_ML[0])+'\n')
for i in xrange(1,len(doc_ML)):
if doc_ML[i] != 0:
f.write(str(i) + ' ' + str(doc_ML[i]) + '\n')
f.close()
collection_content = collection_content + content + ' ' + ' '.join(paper.getComments())
collection_list = collection_content.split()
collection_ML = self.getML(lexicon, collection_list)
f = open(collection_path, 'w')
f.write(str(collection_ML[0])+'\n')
for i in xrange(1, len(collection_ML)):
if collection_ML[i] != 0:
f.write(str(i) + ' ' + str(collection_ML[i]) + '\n')
f.close()
def load(self):
self.ML = {}
f = open(os.path.join(ML_path, self.doc), 'r')
lines = f.readlines()
f.close()
self.ML[0] = int(lines[0].strip())
for line in lines[1:]:
word_id = int(line.split()[0])
word_num = int(line.split()[1])
self.ML[word_id] = word_num
#根据词编号,返回这个ML中这个词的分数
def getProb(self, word_id):
if self.ML.has_key(word_id):
return 1.0 * self.ML[word_id] / self.ML[0]
return 0.0
def getWordsList(self):
return sorted(self.ML.keys())[1:]
'''
生成这篇文档的passage model,是一个字典的列表,列表的每一项为一个passage model的字典
'''
def getPassageModels(self):
paper = Document(self.doc)
self.models = []
items = paper.getFulltext().split()
doc_len = len(items)
lexicon = Lexicon()
lexicon.load()
left = []
right = []
for i in xrange(0, doc_len, passage_length):
left.append(i)
right.append(min(doc_len,i+passage_length))
#Add the tail to the last passage
length = len(left)
#因为最后一段往往不足100个词,所以将最后一段假如倒数第二段
if len(right) > 2:
right[-2] = right[-1]
length -= 1
for i in xrange(length):
self.models.append(self.getML_dict(lexicon, items[left[i]:right[i]]))
return self.models
if __name__ == '__main__':
ml = ML('2')
ml.create()
ml.load()
print ml.getProb(717)
#print ml.getWordsList()
print collection_path
print '------------------------'
#print ml.getPassageModels()
| ajibawa-2023/Python-Code-Large/train/row_99975 | 94 | 113 | 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_99975:ImportFrom_L1_C0", "label": "from config import *", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0088, 0.0088, 0, 0.66, 0.0, 308, 0, 1, 0, 0, 308, 0, 0], "semantic": {"name": "config", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from config import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:ImportFrom_L2_C0", "label": "from os.path import exists", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0177, 0.0088, 0, 0.66, 0.1667, 79, 0, 1, 0, 0, 79, 0, 0], "semantic": {"name": "os.path", "arg_names": [], "import_names": ["exists"], "rhs_call_name": "", "annotation": ""}, "snippet": "from os.path import exists"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:ImportFrom_L3_C0", "label": "from Document import Document", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0265, 0.0088, 0, 0.66, 0.3333, 920, 0, 1, 0, 0, 920, 0, 0], "semantic": {"name": "Document", "arg_names": [], "import_names": ["Document"], "rhs_call_name": "", "annotation": ""}, "snippet": "from Document import Document"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:ImportFrom_L4_C0", "label": "from Lexicon import Lexicon", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0354, 0.0088, 0, 0.66, 0.5, 16, 0, 1, 0, 0, 16, 0, 0], "semantic": {"name": "Lexicon", "arg_names": [], "import_names": ["Lexicon"], "rhs_call_name": "", "annotation": ""}, "snippet": "from Lexicon import Lexicon"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:ImportFrom_L5_C0", "label": "from os import mkdir, rmdir", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0442, 0.0088, 0, 0.66, 0.6667, 688, 0, 2, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["mkdir", "rmdir"], "rhs_call_name": "", "annotation": ""}, "snippet": "from os import mkdir,rmdir"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:Import_L6_C0", "label": "os.path import os.path", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0531, 0.0088, 0, 0.66, 0.8333, 79, 0, 1, 0, 0, 79, 0, 0], "semantic": {"name": "os.path", "arg_names": [], "import_names": ["os.path"], "rhs_call_name": "", "annotation": ""}, "snippet": "import os.path"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:ClassDef_L8_C0", "label": "ML", "type": "class", "loc": [8, 112], "level": 0, "parent": null, "vector": [3, 0, 0.531, 0.9292, 0, 0.66, 1.0, 455, 0, 8, 0, 0, 0, 0, 71], "semantic": {"name": "ML", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ML:\n\t'''Generate collection-wise and document-wise information , namely P(w|C), P(w|D)'''\n\t'''doc\u662f\u4e00\u4e2a\u5b57\u7b26\u4e32\u5f62\u5f0f\uff0c\u5b57\u7b26\u4e32\u5b57\u9762\u53ef\u4ee5\u4e3a\u6570\u5b57\u6216collection\uff0c\u524d\u8005\u4ee3\u8868\u6587\u6863\u7684ML\uff0c\u540e\u8005\u4ee3\u8868\u96c6\u5408\u7684ML'''\n\tdef __init__(self, doc):\n\t\t'''\n\t\tdoc can be a document number or collection as the whole\n\t\tdoc must be str type\n\t\t'''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:Expr_L9_C1", "label": "expression", "type": "expression", "loc": [9, 9], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:ClassDef_L8_C0", "vector": [8, 1, 0.0796, 0.0088, 1, 0.94, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t'''Generate collection-wise and document-wise information , namely P(w|C), P(w|D)'''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:Expr_L10_C1", "label": "expression", "type": "expression", "loc": [10, 10], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:ClassDef_L8_C0", "vector": [8, 1, 0.0885, 0.0088, 1, 0.94, 0.1111, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t'''doc\u662f\u4e00\u4e2a\u5b57\u7b26\u4e32\u5f62\u5f0f\uff0c\u5b57\u7b26\u4e32\u5b57\u9762\u53ef\u4ee5\u4e3a\u6570\u5b57\u6216collection\uff0c\u524d\u8005\u4ee3\u8868\u6587\u6863\u7684ML\uff0c\u540e\u8005\u4ee3\u8868\u96c6\u5408\u7684ML'''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L11_C1", "label": "__init__", "type": "function", "loc": [11, 16], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:ClassDef_L8_C0", "vector": [2, 1, 0.1195, 0.0531, 1, 0.94, 0.2222, 555, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "doc"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __init__(self, doc):\n\t\t'''\n\t\tdoc can be a document number or collection as the whole\n\t\tdoc must be str type\n\t\t'''\n\t\tself.doc = doc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:Expr_L12_C2", "label": "expression", "type": "expression", "loc": [12, 15], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L11_C1", "vector": [8, 2, 0.1195, 0.0354, 2, 0.83, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t'''\n\t\tdoc can be a document number or collection as the whole\n\t\tdoc must be str type\n\t\t'''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L16_C2", "label": "self.doc =", "type": "assigned_variable", "loc": [16, 16], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L11_C1", "vector": [14, 2, 0.1416, 0.0088, 2, 0.83, 1.0, 114, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.doc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.doc = doc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L17_C1", "label": "getML", "type": "function", "loc": [17, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:ClassDef_L8_C0", "vector": [2, 1, 0.2035, 0.115, 1, 0.94, 0.3333, 826, 0, 3, 1, 0, 0, 0, 4], "semantic": {"name": "getML", "arg_names": ["self", "lexicon", "word_list"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef getML(self, lexicon, word_list):\n\t\t'''\n\t\tword num is 1-indexed\n\t\t'''\n\t\tnumTerms = lexicon.getSize()+1\n\t\tML = []\n\t\tfor i in xrange(numTerms):\n\t\t\tML.append(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:Expr_L18_C2", "label": "expression", "type": "expression", "loc": [18, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L17_C1", "vector": [8, 2, 0.1681, 0.0265, 2, 0.55, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t'''\n\t\tword num is 1-indexed\n\t\t'''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L21_C2", "label": "numTerms =", "type": "assigned_variable", "loc": [21, 21], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L17_C1", "vector": [14, 2, 0.1858, 0.0088, 2, 0.55, 0.2, 541, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "numTerms", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tnumTerms = lexicon.getSize()+1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L22_C2", "label": "ML =", "type": "assigned_variable", "loc": [22, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L17_C1", "vector": [14, 2, 0.1947, 0.0088, 2, 0.55, 0.4, 455, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "ML", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tML = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:For_L23_C2", "label": "for i", "type": "for", "loc": [23, 24], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L17_C1", "vector": [6, 2, 0.208, 0.0177, 2, 0.55, 0.6, 826, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor i in xrange(numTerms):\n\t\t\tML.append(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:Expr_L24_C3", "label": "append()", "type": "expression", "loc": [24, 24], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:For_L23_C2", "vector": [8, 3, 0.2124, 0.0088, 3, 0.26, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": "\t\t\tML.append(0)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:For_L25_C2", "label": "for word", "type": "for", "loc": [25, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L17_C1", "vector": [6, 2, 0.2345, 0.0354, 2, 0.55, 0.8, 107, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "word", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor word in word_list:\n\t\t\tword_index = lexicon.getIdByTerm(word)\n\t\t\tML[word_index] = ML[word_index] + 1\n\t\t\tML[0] = ML[0] + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L26_C3", "label": "word_index = getIdByTerm()", "type": "assigned_variable", "loc": [26, 26], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:For_L25_C2", "vector": [14, 3, 0.2301, 0.0088, 3, 0.59, 0.0, 913, 3, 1, 0, 0, 805, 10, 1], "semantic": {"name": "word_index", "arg_names": [], "import_names": [], "rhs_call_name": "getIdByTerm", "annotation": ""}, "snippet": "\t\t\tword_index = lexicon.getIdByTerm(word)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L27_C3", "label": "assign", "type": "assigned_variable", "loc": [27, 27], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:For_L25_C2", "vector": [14, 3, 0.2389, 0.0088, 3, 0.59, 0.5, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tML[word_index] = ML[word_index] + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L28_C3", "label": "assign", "type": "assigned_variable", "loc": [28, 28], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:For_L25_C2", "vector": [14, 3, 0.2478, 0.0088, 3, 0.59, 1.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tML[0] = ML[0] + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:Return_L29_C2", "label": "return", "type": "return", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L17_C1", "vector": [13, 2, 0.2566, 0.0088, 2, 0.55, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn ML"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L30_C1", "label": "getML_dict", "type": "function", "loc": [30, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:ClassDef_L8_C0", "vector": [2, 1, 0.3053, 0.0885, 1, 0.94, 0.4444, 964, 0, 3, 1, 0, 0, 0, 3], "semantic": {"name": "getML_dict", "arg_names": ["self", "lexicon", "word_list"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef getML_dict(self, lexicon, word_list):\n\t\tmodel = {}\n\t\tmodel[0] = len(word_list)\n\t\tfor word in word_list:\n\t\t\tword_index = lexicon.getIdByTerm(word)\n\t\t\tif model.has_key(word_index):\n\t\t\t\tmodel[word_index] = model[word_index] + 1\n\t\t\telse:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L31_C2", "label": "model =", "type": "assigned_variable", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L30_C1", "vector": [14, 2, 0.2743, 0.0088, 2, 0.34, 0.0, 722, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "model", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tmodel = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L32_C2", "label": " = len()", "type": "assigned_variable", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L30_C1", "vector": [14, 2, 0.2832, 0.0088, 2, 0.34, 0.3333, 0, 3, 1, 0, 0, 890, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": "\t\tmodel[0] = len(word_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:For_L33_C2", "label": "for word", "type": "for", "loc": [33, 38], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L30_C1", "vector": [6, 2, 0.3142, 0.0531, 2, 0.34, 0.6667, 107, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "word", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor word in word_list:\n\t\t\tword_index = lexicon.getIdByTerm(word)\n\t\t\tif model.has_key(word_index):\n\t\t\t\tmodel[word_index] = model[word_index] + 1\n\t\t\telse:\n\t\t\t\tmodel[word_index] = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L34_C3", "label": "word_index = getIdByTerm()", "type": "assigned_variable", "loc": [34, 34], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:For_L33_C2", "vector": [14, 3, 0.3009, 0.0088, 3, 0.47, 0.0, 913, 3, 1, 0, 0, 805, 10, 1], "semantic": {"name": "word_index", "arg_names": [], "import_names": [], "rhs_call_name": "getIdByTerm", "annotation": ""}, "snippet": "\t\t\tword_index = lexicon.getIdByTerm(word)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:If_L35_C3", "label": "if", "type": "if", "loc": [35, 38], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:For_L33_C2", "vector": [4, 3, 0.323, 0.0354, 3, 0.47, 1.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif model.has_key(word_index):\n\t\t\t\tmodel[word_index] = model[word_index] + 1\n\t\t\telse:\n\t\t\t\tmodel[word_index] = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L36_C4", "label": "assign", "type": "assigned_variable", "loc": [36, 36], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:If_L35_C3", "vector": [14, 4, 0.3186, 0.0088, 4, 0.21, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tmodel[word_index] = model[word_index] + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L38_C4", "label": "assign", "type": "assigned_variable", "loc": [38, 38], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:If_L35_C3", "vector": [14, 4, 0.3363, 0.0088, 4, 0.21, 1.0, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tmodel[word_index] = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:Return_L39_C2", "label": "return", "type": "return", "loc": [39, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L30_C1", "vector": [13, 2, 0.3451, 0.0088, 2, 0.34, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn model"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L41_C1", "label": "create", "type": "function", "loc": [41, 72], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:ClassDef_L8_C0", "vector": [2, 1, 0.5, 0.2832, 1, 0.94, 0.5556, 316, 0, 1, 0, 0, 0, 0, 36], "semantic": {"name": "create", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef create(self):\n\t\tif exists(ML_path):\n\t\t\trmdir(ML_path)\n\t\tmkdir(ML_path)\n\n\t\tlexicon = Lexicon()\n\t\tlexicon.load()\n\t\tcollection_content = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:If_L42_C2", "label": "if", "type": "if", "loc": [42, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L41_C1", "vector": [4, 2, 0.3761, 0.0177, 2, 0.25, 0.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif exists(ML_path):\n\t\t\trmdir(ML_path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:Expr_L43_C3", "label": "rmdir()", "type": "expression", "loc": [43, 43], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:If_L42_C2", "vector": [8, 3, 0.3805, 0.0088, 3, 0.28, 0.0, 730, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "rmdir", "arg_names": [], "import_names": [], "rhs_call_name": "rmdir", "annotation": ""}, "snippet": "\t\t\trmdir(ML_path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:Expr_L44_C2", "label": "mkdir()", "type": "expression", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L41_C1", "vector": [8, 2, 0.3894, 0.0088, 2, 0.25, 0.0909, 853, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "mkdir", "arg_names": [], "import_names": [], "rhs_call_name": "mkdir", "annotation": ""}, "snippet": "\t\tmkdir(ML_path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L46_C2", "label": "lexicon = Lexicon()", "type": "assigned_variable", "loc": [46, 46], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L41_C1", "vector": [14, 2, 0.4071, 0.0088, 2, 0.25, 0.1818, 675, 3, 0, 0, 0, 16, 10, 1], "semantic": {"name": "lexicon", "arg_names": [], "import_names": [], "rhs_call_name": "Lexicon", "annotation": ""}, "snippet": "\t\tlexicon = Lexicon()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:Expr_L47_C2", "label": "load()", "type": "expression", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L41_C1", "vector": [8, 2, 0.4159, 0.0088, 2, 0.25, 0.2727, 37, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "load", "arg_names": [], "import_names": [], "rhs_call_name": "load", "annotation": ""}, "snippet": "\t\tlexicon.load()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L48_C2", "label": "collection_content =", "type": "assigned_variable", "loc": [48, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L41_C1", "vector": [14, 2, 0.4248, 0.0088, 2, 0.25, 0.3636, 839, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "collection_content", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tcollection_content = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:For_L50_C2", "label": "for doc_index", "type": "for", "loc": [50, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L41_C1", "vector": [6, 2, 0.5, 0.1239, 2, 0.25, 0.4545, 968, 3, 0, 0, 0, 0, 0, 20], "semantic": {"name": "doc_index", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor doc_index in xrange(doccount):\n\t\t\tprint('Processing ' + str(doc_index))\n\t\t\tpaper = Document(doc_index)\n\t\t\tcontent = paper.getFulltext() \n\t\t\tword_list = content.split()\n\t\t\tdoc_ML = self.getML(lexicon, word_list)\n\t\t\tf = open(os.path.join(ML_path, str(doc_index)), 'w')\n\t\t\tf.write(str(doc_ML[0])+'\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:Expr_L51_C3", "label": "print()", "type": "expression", "loc": [51, 51], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:For_L50_C2", "vector": [8, 3, 0.4513, 0.0088, 3, 0.78, 0.0, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\t\t\tprint('Processing ' + str(doc_index))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L52_C3", "label": "paper = Document()", "type": "assigned_variable", "loc": [52, 52], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:For_L50_C2", "vector": [14, 3, 0.4602, 0.0088, 3, 0.78, 0.1111, 446, 3, 1, 0, 0, 920, 10, 1], "semantic": {"name": "paper", "arg_names": [], "import_names": [], "rhs_call_name": "Document", "annotation": ""}, "snippet": "\t\t\tpaper = Document(doc_index)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L53_C3", "label": "content = getFulltext()", "type": "assigned_variable", "loc": [53, 53], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:For_L50_C2", "vector": [14, 3, 0.469, 0.0088, 3, 0.78, 0.2222, 273, 3, 0, 0, 0, 4, 10, 1], "semantic": {"name": "content", "arg_names": [], "import_names": [], "rhs_call_name": "getFulltext", "annotation": ""}, "snippet": "\t\t\tcontent = paper.getFulltext() "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L54_C3", "label": "word_list = split()", "type": "assigned_variable", "loc": [54, 54], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:For_L50_C2", "vector": [14, 3, 0.4779, 0.0088, 3, 0.78, 0.3333, 434, 3, 0, 0, 0, 908, 10, 1], "semantic": {"name": "word_list", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": "\t\t\tword_list = content.split()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L55_C3", "label": "doc_ML = getML()", "type": "assigned_variable", "loc": [55, 55], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:For_L50_C2", "vector": [14, 3, 0.4867, 0.0088, 3, 0.78, 0.4444, 241, 3, 2, 0, 0, 826, 10, 1], "semantic": {"name": "doc_ML", "arg_names": [], "import_names": [], "rhs_call_name": "getML", "annotation": ""}, "snippet": "\t\t\tdoc_ML = self.getML(lexicon, word_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L56_C3", "label": "f = open()", "type": "assigned_variable", "loc": [56, 56], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:For_L50_C2", "vector": [14, 3, 0.4956, 0.0088, 3, 0.78, 0.5556, 899, 3, 2, 0, 0, 693, 10, 3], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": "\t\t\tf = open(os.path.join(ML_path, str(doc_index)), 'w')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:Expr_L57_C3", "label": "write()", "type": "expression", "loc": [57, 57], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:For_L50_C2", "vector": [8, 3, 0.5044, 0.0088, 3, 0.78, 0.6667, 837, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": "\t\t\tf.write(str(doc_ML[0])+'\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:For_L58_C3", "label": "for i", "type": "for", "loc": [58, 60], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:For_L50_C2", "vector": [6, 3, 0.5221, 0.0265, 3, 0.78, 0.7778, 826, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tfor i in xrange(1,len(doc_ML)):\n\t\t\t\tif doc_ML[i] != 0:\n\t\t\t\t\tf.write(str(i) + ' ' + str(doc_ML[i]) + '\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:If_L59_C4", "label": "if", "type": "if", "loc": [59, 60], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:For_L58_C3", "vector": [4, 4, 0.5265, 0.0177, 4, 0.86, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tif doc_ML[i] != 0:\n\t\t\t\t\tf.write(str(i) + ' ' + str(doc_ML[i]) + '\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:Expr_L60_C5", "label": "write()", "type": "expression", "loc": [60, 60], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:If_L59_C4", "vector": [8, 5, 0.531, 0.0088, 5, 0.49, 0.0, 837, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": "\t\t\t\t\tf.write(str(i) + ' ' + str(doc_ML[i]) + '\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:Expr_L61_C3", "label": "close()", "type": "expression", "loc": [61, 61], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:For_L50_C2", "vector": [8, 3, 0.5398, 0.0088, 3, 0.78, 0.8889, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": "\t\t\tf.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L63_C3", "label": "collection_content =", "type": "assigned_variable", "loc": [63, 63], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:For_L50_C2", "vector": [14, 3, 0.5575, 0.0088, 3, 0.78, 1.0, 839, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "collection_content", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tcollection_content = collection_content + content + ' ' + ' '.join(paper.getComments())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L65_C2", "label": "collection_list = split()", "type": "assigned_variable", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L41_C1", "vector": [14, 2, 0.5752, 0.0088, 2, 0.25, 0.5455, 132, 3, 0, 0, 0, 908, 10, 1], "semantic": {"name": "collection_list", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": "\t\tcollection_list = collection_content.split()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L66_C2", "label": "collection_ML = getML()", "type": "assigned_variable", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L41_C1", "vector": [14, 2, 0.5841, 0.0088, 2, 0.25, 0.6364, 229, 3, 2, 0, 0, 826, 10, 1], "semantic": {"name": "collection_ML", "arg_names": [], "import_names": [], "rhs_call_name": "getML", "annotation": ""}, "snippet": "\t\tcollection_ML = self.getML(lexicon, collection_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L67_C2", "label": "f = open()", "type": "assigned_variable", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L41_C1", "vector": [14, 2, 0.5929, 0.0088, 2, 0.25, 0.7273, 899, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": "\t\tf = open(collection_path, 'w')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:Expr_L68_C2", "label": "write()", "type": "expression", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L41_C1", "vector": [8, 2, 0.6018, 0.0088, 2, 0.25, 0.8182, 837, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": "\t\tf.write(str(collection_ML[0])+'\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:For_L69_C2", "label": "for i", "type": "for", "loc": [69, 71], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L41_C1", "vector": [6, 2, 0.6195, 0.0265, 2, 0.25, 0.9091, 826, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor i in xrange(1, len(collection_ML)):\n\t\t\tif collection_ML[i] != 0:\n\t\t\t\tf.write(str(i) + ' ' + str(collection_ML[i]) + '\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:If_L70_C3", "label": "if", "type": "if", "loc": [70, 71], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:For_L69_C2", "vector": [4, 3, 0.6239, 0.0177, 3, 0.12, 0.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif collection_ML[i] != 0:\n\t\t\t\tf.write(str(i) + ' ' + str(collection_ML[i]) + '\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:Expr_L71_C4", "label": "write()", "type": "expression", "loc": [71, 71], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:If_L70_C3", "vector": [8, 4, 0.6283, 0.0088, 4, 0.25, 0.0, 837, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": "\t\t\t\tf.write(str(i) + ' ' + str(collection_ML[i]) + '\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:Expr_L72_C2", "label": "close()", "type": "expression", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L41_C1", "vector": [8, 2, 0.6372, 0.0088, 2, 0.25, 1.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": "\t\tf.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L74_C1", "label": "load", "type": "function", "loc": [74, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:ClassDef_L8_C0", "vector": [2, 1, 0.6947, 0.0885, 1, 0.94, 0.6667, 37, 0, 1, 0, 0, 0, 0, 10], "semantic": {"name": "load", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef load(self):\n\t\tself.ML = {}\n\t\tf = open(os.path.join(ML_path, self.doc), 'r')\n\t\tlines = f.readlines()\n\t\tf.close()\n\t\tself.ML[0] = int(lines[0].strip())\n\t\tfor line in lines[1:]:\n\t\t\tword_id = int(line.split()[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L75_C2", "label": "self.ML =", "type": "assigned_variable", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L74_C1", "vector": [14, 2, 0.6637, 0.0088, 2, 0.27, 0.0, 673, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.ML", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.ML = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L76_C2", "label": "f = open()", "type": "assigned_variable", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L74_C1", "vector": [14, 2, 0.6726, 0.0088, 2, 0.27, 0.2, 899, 3, 2, 0, 0, 693, 10, 2], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": "\t\tf = open(os.path.join(ML_path, self.doc), 'r')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L77_C2", "label": "lines = readlines()", "type": "assigned_variable", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L74_C1", "vector": [14, 2, 0.6814, 0.0088, 2, 0.27, 0.4, 73, 3, 0, 0, 0, 841, 10, 1], "semantic": {"name": "lines", "arg_names": [], "import_names": [], "rhs_call_name": "readlines", "annotation": ""}, "snippet": "\t\tlines = f.readlines()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:Expr_L78_C2", "label": "close()", "type": "expression", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L74_C1", "vector": [8, 2, 0.6903, 0.0088, 2, 0.27, 0.6, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": "\t\tf.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L79_C2", "label": " = int()", "type": "assigned_variable", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L74_C1", "vector": [14, 2, 0.6991, 0.0088, 2, 0.27, 0.8, 0, 3, 1, 0, 0, 901, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": "\t\tself.ML[0] = int(lines[0].strip())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:For_L80_C2", "label": "for line", "type": "for", "loc": [80, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L74_C1", "vector": [6, 2, 0.7212, 0.0354, 2, 0.27, 1.0, 373, 6, 0, 0, 0, 0, 0, 4], "semantic": {"name": "line", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor line in lines[1:]:\n\t\t\tword_id = int(line.split()[0])\n\t\t\tword_num = int(line.split()[1])\n\t\t\tself.ML[word_id] = word_num"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L81_C3", "label": "word_id = int()", "type": "assigned_variable", "loc": [81, 81], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:For_L80_C2", "vector": [14, 3, 0.7168, 0.0088, 3, 0.69, 0.0, 160, 3, 1, 0, 0, 901, 10, 2], "semantic": {"name": "word_id", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": "\t\t\tword_id = int(line.split()[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L82_C3", "label": "word_num = int()", "type": "assigned_variable", "loc": [82, 82], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:For_L80_C2", "vector": [14, 3, 0.7257, 0.0088, 3, 0.69, 0.5, 354, 3, 1, 0, 0, 901, 10, 2], "semantic": {"name": "word_num", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": "\t\t\tword_num = int(line.split()[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L83_C3", "label": "assign", "type": "assigned_variable", "loc": [83, 83], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:For_L80_C2", "vector": [14, 3, 0.7345, 0.0088, 3, 0.69, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tself.ML[word_id] = word_num"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L85_C1", "label": "getProb", "type": "function", "loc": [85, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:ClassDef_L8_C0", "vector": [2, 1, 0.7655, 0.0354, 1, 0.94, 0.7778, 528, 0, 2, 1, 0, 0, 0, 1], "semantic": {"name": "getProb", "arg_names": ["self", "word_id"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef getProb(self, word_id):\n\t\tif self.ML.has_key(word_id):\n\t\t\treturn 1.0 * self.ML[word_id] / self.ML[0]\n\t\treturn 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:If_L86_C2", "label": "if", "type": "if", "loc": [86, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L85_C1", "vector": [4, 2, 0.7655, 0.0177, 2, 0.84, 0.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif self.ML.has_key(word_id):\n\t\t\treturn 1.0 * self.ML[word_id] / self.ML[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:Return_L87_C3", "label": "return", "type": "return", "loc": [87, 87], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:If_L86_C2", "vector": [13, 3, 0.7699, 0.0088, 3, 0.82, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn 1.0 * self.ML[word_id] / self.ML[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:Return_L88_C2", "label": "return", "type": "return", "loc": [88, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L85_C1", "vector": [13, 2, 0.7788, 0.0088, 2, 0.84, 1.0, 0, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L90_C1", "label": "getWordsList", "type": "function", "loc": [90, 91], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:ClassDef_L8_C0", "vector": [2, 1, 0.8009, 0.0177, 1, 0.94, 0.8889, 985, 0, 1, 1, 0, 0, 0, 2], "semantic": {"name": "getWordsList", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef getWordsList(self):\n\t\treturn sorted(self.ML.keys())[1:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:Return_L91_C2", "label": "return", "type": "return", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L90_C1", "vector": [13, 2, 0.8053, 0.0088, 2, 0.35, 0.0, 0, 6, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn sorted(self.ML.keys())[1:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L92_C1", "label": "getPassageModels", "type": "function", "loc": [92, 112], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:ClassDef_L8_C0", "vector": [2, 1, 0.9027, 0.1858, 1, 0.94, 1.0, 974, 0, 1, 1, 0, 0, 0, 15], "semantic": {"name": "getPassageModels", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef getPassageModels(self):\n\t\tpaper = Document(self.doc)\n\t\tself.models = []\n\t\titems = paper.getFulltext().split()\n\t\tdoc_len = len(items)\n\t\tlexicon = Lexicon()\n\t\tlexicon.load()\n\t\tleft = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L93_C2", "label": "paper = Document()", "type": "assigned_variable", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L92_C1", "vector": [14, 2, 0.823, 0.0088, 2, 0.48, 0.0, 446, 3, 1, 0, 0, 920, 10, 1], "semantic": {"name": "paper", "arg_names": [], "import_names": [], "rhs_call_name": "Document", "annotation": ""}, "snippet": "\t\tpaper = Document(self.doc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L94_C2", "label": "self.models =", "type": "assigned_variable", "loc": [94, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L92_C1", "vector": [14, 2, 0.8319, 0.0088, 2, 0.48, 0.0833, 134, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.models", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.models = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L95_C2", "label": "items = split()", "type": "assigned_variable", "loc": [95, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L92_C1", "vector": [14, 2, 0.8407, 0.0088, 2, 0.48, 0.1667, 339, 3, 0, 0, 0, 908, 10, 2], "semantic": {"name": "items", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": "\t\titems = paper.getFulltext().split()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L96_C2", "label": "doc_len = len()", "type": "assigned_variable", "loc": [96, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L92_C1", "vector": [14, 2, 0.8496, 0.0088, 2, 0.48, 0.25, 449, 3, 1, 0, 0, 890, 10, 1], "semantic": {"name": "doc_len", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": "\t\tdoc_len = len(items)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L97_C2", "label": "lexicon = Lexicon()", "type": "assigned_variable", "loc": [97, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L92_C1", "vector": [14, 2, 0.8584, 0.0088, 2, 0.48, 0.3333, 675, 3, 0, 0, 0, 16, 10, 1], "semantic": {"name": "lexicon", "arg_names": [], "import_names": [], "rhs_call_name": "Lexicon", "annotation": ""}, "snippet": "\t\tlexicon = Lexicon()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:Expr_L98_C2", "label": "load()", "type": "expression", "loc": [98, 98], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L92_C1", "vector": [8, 2, 0.8673, 0.0088, 2, 0.48, 0.4167, 37, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "load", "arg_names": [], "import_names": [], "rhs_call_name": "load", "annotation": ""}, "snippet": "\t\tlexicon.load()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L99_C2", "label": "left =", "type": "assigned_variable", "loc": [99, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L92_C1", "vector": [14, 2, 0.8761, 0.0088, 2, 0.48, 0.5, 605, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "left", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tleft = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L100_C2", "label": "right =", "type": "assigned_variable", "loc": [100, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L92_C1", "vector": [14, 2, 0.885, 0.0088, 2, 0.48, 0.5833, 724, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "right", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tright = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:For_L101_C2", "label": "for i", "type": "for", "loc": [101, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L92_C1", "vector": [6, 2, 0.9027, 0.0265, 2, 0.48, 0.6667, 826, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor i in xrange(0, doc_len, passage_length):\n\t\t\tleft.append(i)\n\t\t\tright.append(min(doc_len,i+passage_length))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:Expr_L102_C3", "label": "append()", "type": "expression", "loc": [102, 102], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:For_L101_C2", "vector": [8, 3, 0.9027, 0.0088, 3, 0.87, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": "\t\t\tleft.append(i)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:Expr_L103_C3", "label": "append()", "type": "expression", "loc": [103, 103], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:For_L101_C2", "vector": [8, 3, 0.9115, 0.0088, 3, 0.87, 1.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": "\t\t\tright.append(min(doc_len,i+passage_length))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L105_C2", "label": "length = len()", "type": "assigned_variable", "loc": [105, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L92_C1", "vector": [14, 2, 0.9292, 0.0088, 2, 0.48, 0.75, 221, 3, 1, 0, 0, 890, 10, 1], "semantic": {"name": "length", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": "\t\tlength = len(left)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:If_L107_C2", "label": "if", "type": "if", "loc": [107, 109], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L92_C1", "vector": [4, 2, 0.9558, 0.0265, 2, 0.48, 0.8333, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif len(right) > 2:\n\t\t\tright[-2] = right[-1]\n\t\t\tlength -= 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L108_C3", "label": "assign", "type": "assigned_variable", "loc": [108, 108], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:If_L107_C2", "vector": [14, 3, 0.9558, 0.0088, 3, 0.03, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tright[-2] = right[-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:For_L110_C2", "label": "for i", "type": "for", "loc": [110, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L92_C1", "vector": [6, 2, 0.9779, 0.0177, 2, 0.48, 0.9167, 826, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor i in xrange(length):\n\t\t\tself.models.append(self.getML_dict(lexicon, items[left[i]:right[i]]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:Expr_L111_C3", "label": "append()", "type": "expression", "loc": [111, 111], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:For_L110_C2", "vector": [8, 3, 0.9823, 0.0088, 3, 0.88, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": "\t\t\tself.models.append(self.getML_dict(lexicon, items[left[i]:right[i]]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99975:Return_L112_C2", "label": "return", "type": "return", "loc": [112, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L92_C1", "vector": [13, 2, 0.9912, 0.0088, 2, 0.48, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn self.models"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99975:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:Expr_L9_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:Expr_L10_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L11_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L11_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:Expr_L12_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L11_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L16_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L17_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L17_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:Expr_L18_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L17_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L21_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L17_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L22_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L17_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:For_L23_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:For_L23_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:Expr_L24_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L17_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:For_L25_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:For_L25_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L26_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:For_L25_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L27_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:For_L25_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L28_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L17_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:Return_L29_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L30_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L30_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L31_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L30_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L32_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L30_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:For_L33_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:For_L33_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L34_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:For_L33_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:If_L35_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:If_L35_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:If_L35_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L30_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:Return_L39_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L41_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L41_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:If_L42_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:If_L42_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:Expr_L43_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L41_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:Expr_L44_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L41_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L46_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L41_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:Expr_L47_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L41_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L48_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L41_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:For_L50_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:For_L50_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:Expr_L51_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:For_L50_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L52_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:For_L50_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L53_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:For_L50_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L54_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:For_L50_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L55_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:For_L50_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L56_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:For_L50_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:Expr_L57_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:For_L50_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:For_L58_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:For_L58_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:If_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:If_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:Expr_L60_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:For_L50_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:Expr_L61_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:For_L50_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L63_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L41_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L65_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L41_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L66_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L41_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L67_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L41_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:Expr_L68_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L41_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:For_L69_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:For_L69_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:If_L70_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:If_L70_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:Expr_L71_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L41_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:Expr_L72_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L74_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L74_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L75_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L74_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L76_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L74_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L77_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L74_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:Expr_L78_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L74_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L79_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L74_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:For_L80_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:For_L80_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L81_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:For_L80_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L82_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:For_L80_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L83_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L85_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L85_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:If_L86_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:If_L86_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:Return_L87_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L85_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:Return_L88_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L90_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L90_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:Return_L91_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:ClassDef_L8_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L92_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L92_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L93_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L92_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L94_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L92_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L95_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L92_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L96_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L92_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L97_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L92_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:Expr_L98_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L92_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L99_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L92_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L100_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L92_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:For_L101_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:For_L101_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:Expr_L102_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:For_L101_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:Expr_L103_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L92_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L105_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L92_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:If_L107_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:If_L107_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:Assign_L108_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L92_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:For_L110_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:For_L110_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:Expr_L111_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99975:FunctionDef_L92_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99975:Return_L112_C2"}] |
from Lexicon import Lexicon
from ML import ML
from config import *
from TranslationModel import TranslationModel
from multiprocessing import Pipe, Process
import os
from os.path import join, exists
class OfflineTranslationModel:
'''
compute offline sum P(q|w)*P(w|D)
'''
def create_multi(self, begin, end, doc_list, trans_model):
# ans = []
for i in xrange(begin, end):
doc = i - begin
print 'Processing doc ' + str(i)
dic = {}
for wordid in doc_list[doc].getWordsList():
extensionlist = trans_model.getExtensionList(wordid)
for trans_id in extensionlist:
if dic.has_key(trans_id):
dic[trans_id] = dic[trans_id] + trans_model.getProb(wordid, trans_id) * doc_list[doc].getProb(wordid)
else:
dic[trans_id] = trans_model.getProb(wordid, trans_id) * doc_list[doc].getProb(wordid)
f = open(join(tmp_path,str(i)), 'w')
line = ''
for (key, value) in dic.items():
line = line + str(key) + ':' + str(value) + ' '
f.write(line+'\n')
f.close()
# ans.append(dic)
# conn.send(ans)
# conn.close()
def create(self,is_filt=False):
if os.path.exists(tmp_path):
os.rmdir(tmp_path)
os.mkdir(tmp_path)
lexicon = Lexicon()
lexicon.load()
doc_list = []
offline_tm = []
for doc in xrange(doccount):
ml = ML(str(doc))
ml.load()
doc_list.append(ml)
trans_model = TranslationModel()
trans_model.load(is_filt)
kernelnum = 16
# connectPairs = []
pools = []
for i in xrange(kernelnum):
# connectPairs.append(Pipe())
pools.append(Process(target=self.create_multi,args=(doccount*i/kernelnum,doccount*(i+1)/kernelnum, doc_list[doccount*i/kernelnum:doccount*(i+1)/kernelnum],trans_model)))
for i in xrange(kernelnum):
pools[i].start()
# for i in xrange(kernelnum):
# l = connectPairs[i][1].recv()
# for m in l:
# offline_tm.append(m)
# connectPairs[i][1].close()
for i in xrange(kernelnum):
pools[i].join()
wf = open(Offline_TM_path, 'w')
for doc in os.listdir(tmp_path):
f = open(join(tmp_path, str(doc)), 'r')
wf.write(f.read())
f.close()
wf.close()
def load(self):
self.offline_tm = []
f = open(Offline_TM_path, 'r')
lines = f.readlines()
f.close()
for i in xrange(len(lines)):
items = lines[i].split()
dic = {}
for item in items:
dic[int(item.split(':')[0])] = float(item.split(':')[1].strip())
self.offline_tm.append(dic)
def getProb(self, docId, wordId):
if self.offline_tm[docId].has_key(wordId):
return self.offline_tm[docId][wordId]
else:
return 0.0
if __name__ == '__main__':
otm = OfflineTranslationModel()
otm.create(True)
otm.load()
print otm.getProb(5182, 10242)
| ajibawa-2023/Python-Code-Large/train/row_99976 | 74 | 97 | 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_99976:ImportFrom_L1_C0", "label": "from Lexicon import Lexicon", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0103, 0.0103, 0, 0.66, 0.0, 16, 0, 1, 0, 0, 16, 0, 0], "semantic": {"name": "Lexicon", "arg_names": [], "import_names": ["Lexicon"], "rhs_call_name": "", "annotation": ""}, "snippet": "from Lexicon import Lexicon"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:ImportFrom_L2_C0", "label": "from ML import ML", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0206, 0.0103, 0, 0.66, 0.125, 455, 0, 1, 0, 0, 455, 0, 0], "semantic": {"name": "ML", "arg_names": [], "import_names": ["ML"], "rhs_call_name": "", "annotation": ""}, "snippet": "from ML import ML"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:ImportFrom_L3_C0", "label": "from config import *", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0309, 0.0103, 0, 0.66, 0.25, 308, 0, 1, 0, 0, 308, 0, 0], "semantic": {"name": "config", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from config import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:ImportFrom_L4_C0", "label": "from TranslationModel import TranslationModel", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0412, 0.0103, 0, 0.66, 0.375, 753, 0, 1, 0, 0, 753, 0, 0], "semantic": {"name": "TranslationModel", "arg_names": [], "import_names": ["TranslationModel"], "rhs_call_name": "", "annotation": ""}, "snippet": "from TranslationModel import TranslationModel"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:ImportFrom_L5_C0", "label": "from multiprocessing import Pipe, Process", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0515, 0.0103, 0, 0.66, 0.5, 901, 0, 2, 0, 0, 901, 0, 0], "semantic": {"name": "multiprocessing", "arg_names": [], "import_names": ["Pipe", "Process"], "rhs_call_name": "", "annotation": ""}, "snippet": "from multiprocessing import Pipe, Process"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:Import_L6_C0", "label": "os import os", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0619, 0.0103, 0, 0.66, 0.625, 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_99976:ImportFrom_L7_C0", "label": "from os.path import join, exists", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0722, 0.0103, 0, 0.66, 0.75, 79, 0, 2, 0, 0, 79, 0, 0], "semantic": {"name": "os.path", "arg_names": [], "import_names": ["join", "exists"], "rhs_call_name": "", "annotation": ""}, "snippet": "from os.path import join, exists"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:ClassDef_L9_C0", "label": "OfflineTranslationModel", "type": "class", "loc": [9, 91], "level": 0, "parent": null, "vector": [3, 0, 0.5155, 0.8557, 0, 0.66, 0.875, 38, 0, 4, 0, 0, 0, 0, 59], "semantic": {"name": "OfflineTranslationModel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class OfflineTranslationModel:\n\t'''\n\tcompute offline sum P(q|w)*P(w|D)\n\t'''\n\n\tdef create_multi(self, begin, end, doc_list, trans_model):\n#\t\tans = []\n\t\tfor i in xrange(begin, end):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:Expr_L10_C1", "label": "expression", "type": "expression", "loc": [10, 12], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99976:ClassDef_L9_C0", "vector": [8, 1, 0.1134, 0.0309, 1, 0.68, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t'''\n\tcompute offline sum P(q|w)*P(w|D)\n\t'''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:FunctionDef_L14_C1", "label": "create_multi", "type": "function", "loc": [14, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99976:ClassDef_L9_C0", "vector": [2, 1, 0.2371, 0.1959, 1, 0.68, 0.25, 566, 0, 5, 0, 0, 0, 0, 18], "semantic": {"name": "create_multi", "arg_names": ["self", "begin", "end", "doc_list", "trans_model"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef create_multi(self, begin, end, doc_list, trans_model):\n#\t\tans = []\n\t\tfor i in xrange(begin, end):\n\t\t\tdoc = i - begin\n\t\t\tprint('Processing doc ' + str(i))\n\t\t\tdic = {}\n\t\t\tfor wordid in doc_list[doc].getWordsList():\n\t\t\t\textensionlist = trans_model.getExtensionList(wordid)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L16_C2", "label": "for i", "type": "for", "loc": [16, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99976:FunctionDef_L14_C1", "vector": [6, 2, 0.2474, 0.1753, 2, 0.2, 0.0, 826, 3, 0, 0, 0, 0, 0, 18], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor i in xrange(begin, end):\n\t\t\tdoc = i - begin\n\t\t\tprint('Processing doc ' + str(i))\n\t\t\tdic = {}\n\t\t\tfor wordid in doc_list[doc].getWordsList():\n\t\t\t\textensionlist = trans_model.getExtensionList(wordid)\n\t\t\t\tfor trans_id in extensionlist:\n\t\t\t\t\tif dic.has_key(trans_id):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:Assign_L17_C3", "label": "doc =", "type": "assigned_variable", "loc": [17, 17], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L16_C2", "vector": [14, 3, 0.1753, 0.0103, 3, 0.85, 0.0, 555, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "doc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tdoc = i - begin"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:Expr_L18_C3", "label": "print()", "type": "expression", "loc": [18, 18], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L16_C2", "vector": [8, 3, 0.1856, 0.0103, 3, 0.85, 0.125, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\t\t\tprint('Processing doc ' + str(i))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:Assign_L19_C3", "label": "dic =", "type": "assigned_variable", "loc": [19, 19], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L16_C2", "vector": [14, 3, 0.1959, 0.0103, 3, 0.85, 0.25, 37, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "dic", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tdic = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L20_C3", "label": "for wordid", "type": "for", "loc": [20, 26], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L16_C2", "vector": [6, 3, 0.2371, 0.0722, 3, 0.85, 0.375, 207, 3, 0, 0, 0, 0, 0, 7], "semantic": {"name": "wordid", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tfor wordid in doc_list[doc].getWordsList():\n\t\t\t\textensionlist = trans_model.getExtensionList(wordid)\n\t\t\t\tfor trans_id in extensionlist:\n\t\t\t\t\tif dic.has_key(trans_id):\n\t\t\t\t\t\tdic[trans_id] = dic[trans_id] + trans_model.getProb(wordid,\ttrans_id) * doc_list[doc].getProb(wordid)\n\t\t\t\t\telse:\n\t\t\t\t\t\tdic[trans_id] = trans_model.getProb(wordid, trans_id) *\tdoc_list[doc].getProb(wordid)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:Assign_L21_C4", "label": "extensionlist = getExtensionList()", "type": "assigned_variable", "loc": [21, 21], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L20_C3", "vector": [14, 4, 0.2165, 0.0103, 4, 0.15, 0.0, 604, 3, 1, 0, 0, 302, 10, 1], "semantic": {"name": "extensionlist", "arg_names": [], "import_names": [], "rhs_call_name": "getExtensionList", "annotation": ""}, "snippet": "\t\t\t\textensionlist = trans_model.getExtensionList(wordid)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L22_C4", "label": "for trans_id", "type": "for", "loc": [22, 26], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L20_C3", "vector": [6, 4, 0.2474, 0.0515, 4, 0.15, 1.0, 666, 2, 0, 0, 0, 0, 0, 5], "semantic": {"name": "trans_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tfor trans_id in extensionlist:\n\t\t\t\t\tif dic.has_key(trans_id):\n\t\t\t\t\t\tdic[trans_id] = dic[trans_id] + trans_model.getProb(wordid,\ttrans_id) * doc_list[doc].getProb(wordid)\n\t\t\t\t\telse:\n\t\t\t\t\t\tdic[trans_id] = trans_model.getProb(wordid, trans_id) *\tdoc_list[doc].getProb(wordid)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:If_L23_C5", "label": "if", "type": "if", "loc": [23, 26], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L22_C4", "vector": [4, 5, 0.2526, 0.0412, 5, 0.61, 0.0, 0, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\t\tif dic.has_key(trans_id):\n\t\t\t\t\t\tdic[trans_id] = dic[trans_id] + trans_model.getProb(wordid,\ttrans_id) * doc_list[doc].getProb(wordid)\n\t\t\t\t\telse:\n\t\t\t\t\t\tdic[trans_id] = trans_model.getProb(wordid, trans_id) *\tdoc_list[doc].getProb(wordid)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:Assign_L24_C6", "label": "assign", "type": "assigned_variable", "loc": [24, 24], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99976:If_L23_C5", "vector": [14, 6, 0.2474, 0.0103, 6, 0.48, 0.0, 0, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\t\t\tdic[trans_id] = dic[trans_id] + trans_model.getProb(wordid,\ttrans_id) * doc_list[doc].getProb(wordid)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:Assign_L26_C6", "label": "assign", "type": "assigned_variable", "loc": [26, 26], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99976:If_L23_C5", "vector": [14, 6, 0.268, 0.0103, 6, 0.48, 1.0, 0, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\t\t\tdic[trans_id] = trans_model.getProb(wordid, trans_id) *\tdoc_list[doc].getProb(wordid)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:Assign_L27_C3", "label": "f = open()", "type": "assigned_variable", "loc": [27, 27], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L16_C2", "vector": [14, 3, 0.2784, 0.0103, 3, 0.85, 0.5, 899, 3, 2, 0, 0, 693, 10, 3], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": "\t\t\tf = open(join(tmp_path,str(i)), 'w')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:Assign_L28_C3", "label": "line =", "type": "assigned_variable", "loc": [28, 28], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L16_C2", "vector": [14, 3, 0.2887, 0.0103, 3, 0.85, 0.625, 373, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "line", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tline = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L29_C3", "label": "for key, value", "type": "for", "loc": [29, 30], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L16_C2", "vector": [6, 3, 0.3041, 0.0206, 3, 0.85, 0.75, 839, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "key, value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tfor (key, value) in dic.items():\n\t\t\t\tline = line + str(key) + ':' + str(value) + ' '"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:Assign_L30_C4", "label": "line =", "type": "assigned_variable", "loc": [30, 30], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L29_C3", "vector": [14, 4, 0.3093, 0.0103, 4, 0.53, 0.0, 373, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "line", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tline = line + str(key) + ':' + str(value) + ' '"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:Expr_L31_C3", "label": "write()", "type": "expression", "loc": [31, 31], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L16_C2", "vector": [8, 3, 0.3196, 0.0103, 3, 0.85, 0.875, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": "\t\t\tf.write(line+'\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:Expr_L32_C3", "label": "close()", "type": "expression", "loc": [32, 32], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L16_C2", "vector": [8, 3, 0.3299, 0.0103, 3, 0.85, 1.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": "\t\t\tf.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:FunctionDef_L37_C1", "label": "create", "type": "function", "loc": [37, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99976:ClassDef_L9_C0", "vector": [2, 1, 0.567, 0.3814, 1, 0.68, 0.5, 316, 0, 2, 0, 0, 0, 0, 28], "semantic": {"name": "create", "arg_names": ["self", "is_filt"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef create(self,is_filt=False):\n\t\tif os.path.exists(tmp_path):\n\t\t\tos.rmdir(tmp_path)\n\t\tos.mkdir(tmp_path)\n\t\tlexicon = Lexicon()\n\t\tlexicon.load()\n\t\tdoc_list = []\n\t\toffline_tm = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:If_L38_C2", "label": "if", "type": "if", "loc": [38, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99976:FunctionDef_L37_C1", "vector": [4, 2, 0.3969, 0.0206, 2, 0.17, 0.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif os.path.exists(tmp_path):\n\t\t\tos.rmdir(tmp_path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:Expr_L39_C3", "label": "rmdir()", "type": "expression", "loc": [39, 39], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99976:If_L38_C2", "vector": [8, 3, 0.4021, 0.0103, 3, 0.19, 0.0, 730, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "rmdir", "arg_names": [], "import_names": [], "rhs_call_name": "rmdir", "annotation": ""}, "snippet": "\t\t\tos.rmdir(tmp_path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:Expr_L40_C2", "label": "mkdir()", "type": "expression", "loc": [40, 40], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99976:FunctionDef_L37_C1", "vector": [8, 2, 0.4124, 0.0103, 2, 0.17, 0.0625, 853, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "mkdir", "arg_names": [], "import_names": [], "rhs_call_name": "mkdir", "annotation": ""}, "snippet": "\t\tos.mkdir(tmp_path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:Assign_L41_C2", "label": "lexicon = Lexicon()", "type": "assigned_variable", "loc": [41, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99976:FunctionDef_L37_C1", "vector": [14, 2, 0.4227, 0.0103, 2, 0.17, 0.125, 675, 3, 0, 0, 0, 16, 10, 1], "semantic": {"name": "lexicon", "arg_names": [], "import_names": [], "rhs_call_name": "Lexicon", "annotation": ""}, "snippet": "\t\tlexicon = Lexicon()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:Expr_L42_C2", "label": "load()", "type": "expression", "loc": [42, 42], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99976:FunctionDef_L37_C1", "vector": [8, 2, 0.433, 0.0103, 2, 0.17, 0.1875, 37, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "load", "arg_names": [], "import_names": [], "rhs_call_name": "load", "annotation": ""}, "snippet": "\t\tlexicon.load()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:Assign_L43_C2", "label": "doc_list =", "type": "assigned_variable", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99976:FunctionDef_L37_C1", "vector": [14, 2, 0.4433, 0.0103, 2, 0.17, 0.25, 578, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "doc_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tdoc_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:Assign_L44_C2", "label": "offline_tm =", "type": "assigned_variable", "loc": [44, 44], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99976:FunctionDef_L37_C1", "vector": [14, 2, 0.4536, 0.0103, 2, 0.17, 0.3125, 654, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "offline_tm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\toffline_tm = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L45_C2", "label": "for doc", "type": "for", "loc": [45, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99976:FunctionDef_L37_C1", "vector": [6, 2, 0.4794, 0.0412, 2, 0.17, 0.375, 555, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "doc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor doc in xrange(doccount):\n\t\t\tml = ML(str(doc))\n\t\t\tml.load()\n\t\t\tdoc_list.append(ml)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:Assign_L46_C3", "label": "ml = ML()", "type": "assigned_variable", "loc": [46, 46], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L45_C2", "vector": [14, 3, 0.4742, 0.0103, 3, 0.16, 0.0, 965, 3, 1, 0, 0, 455, 10, 2], "semantic": {"name": "ml", "arg_names": [], "import_names": [], "rhs_call_name": "ML", "annotation": ""}, "snippet": "\t\t\tml = ML(str(doc))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:Expr_L47_C3", "label": "load()", "type": "expression", "loc": [47, 47], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L45_C2", "vector": [8, 3, 0.4845, 0.0103, 3, 0.16, 0.5, 37, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "load", "arg_names": [], "import_names": [], "rhs_call_name": "load", "annotation": ""}, "snippet": "\t\t\tml.load()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:Expr_L48_C3", "label": "append()", "type": "expression", "loc": [48, 48], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L45_C2", "vector": [8, 3, 0.4948, 0.0103, 3, 0.16, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": "\t\t\tdoc_list.append(ml)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:Assign_L49_C2", "label": "trans_model = TranslationModel()", "type": "assigned_variable", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99976:FunctionDef_L37_C1", "vector": [14, 2, 0.5052, 0.0103, 2, 0.17, 0.4375, 827, 3, 0, 0, 0, 753, 10, 1], "semantic": {"name": "trans_model", "arg_names": [], "import_names": [], "rhs_call_name": "TranslationModel", "annotation": ""}, "snippet": "\t\ttrans_model = TranslationModel()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:Expr_L50_C2", "label": "load()", "type": "expression", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99976:FunctionDef_L37_C1", "vector": [8, 2, 0.5155, 0.0103, 2, 0.17, 0.5, 37, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "load", "arg_names": [], "import_names": [], "rhs_call_name": "load", "annotation": ""}, "snippet": "\t\ttrans_model.load(is_filt)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:Assign_L52_C2", "label": "kernelnum =", "type": "assigned_variable", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99976:FunctionDef_L37_C1", "vector": [14, 2, 0.5361, 0.0103, 2, 0.17, 0.5625, 871, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "kernelnum", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tkernelnum = 16"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:Assign_L54_C2", "label": "pools =", "type": "assigned_variable", "loc": [54, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99976:FunctionDef_L37_C1", "vector": [14, 2, 0.5567, 0.0103, 2, 0.17, 0.625, 640, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "pools", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tpools = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L55_C2", "label": "for i", "type": "for", "loc": [55, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99976:FunctionDef_L37_C1", "vector": [6, 2, 0.5773, 0.0309, 2, 0.17, 0.6875, 826, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor i in xrange(kernelnum):\n\t\t#\tconnectPairs.append(Pipe())\n\t\t\tpools.append(Process(target=self.create_multi,args=(doccount*i/kernelnum,doccount*(i+1)/kernelnum, doc_list[doccount*i/kernelnum:doccount*(i+1)/kernelnum],trans_model)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:Expr_L57_C3", "label": "append()", "type": "expression", "loc": [57, 57], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L55_C2", "vector": [8, 3, 0.5876, 0.0103, 3, 0.27, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": "\t\t\tpools.append(Process(target=self.create_multi,args=(doccount*i/kernelnum,doccount*(i+1)/kernelnum, doc_list[doccount*i/kernelnum:doccount*(i+1)/kernelnum],trans_model)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L58_C2", "label": "for i", "type": "for", "loc": [58, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99976:FunctionDef_L37_C1", "vector": [6, 2, 0.6031, 0.0206, 2, 0.17, 0.75, 826, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor i in xrange(kernelnum):\n\t\t\tpools[i].start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:Expr_L59_C3", "label": "start()", "type": "expression", "loc": [59, 59], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L58_C2", "vector": [8, 3, 0.6082, 0.0103, 3, 0.25, 0.0, 511, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "start", "arg_names": [], "import_names": [], "rhs_call_name": "start", "annotation": ""}, "snippet": "\t\t\tpools[i].start()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L65_C2", "label": "for i", "type": "for", "loc": [65, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99976:FunctionDef_L37_C1", "vector": [6, 2, 0.6753, 0.0206, 2, 0.17, 0.8125, 826, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor i in xrange(kernelnum):\n\t\t\tpools[i].join()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:Expr_L66_C3", "label": "join()", "type": "expression", "loc": [66, 66], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L65_C2", "vector": [8, 3, 0.6804, 0.0103, 3, 0.87, 0.0, 933, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "join", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": "\t\t\tpools[i].join()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:Assign_L68_C2", "label": "wf = open()", "type": "assigned_variable", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99976:FunctionDef_L37_C1", "vector": [14, 2, 0.701, 0.0103, 2, 0.17, 0.875, 192, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "wf", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": "\t\twf = open(Offline_TM_path, 'w')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L69_C2", "label": "for doc", "type": "for", "loc": [69, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99976:FunctionDef_L37_C1", "vector": [6, 2, 0.7268, 0.0412, 2, 0.17, 0.9375, 555, 3, 0, 0, 0, 0, 0, 7], "semantic": {"name": "doc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor doc in os.listdir(tmp_path):\n\t\t\tf = open(join(tmp_path, str(doc)), 'r')\n\t\t\twf.write(f.read())\n\t\t\tf.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:Assign_L70_C3", "label": "f = open()", "type": "assigned_variable", "loc": [70, 70], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L69_C2", "vector": [14, 3, 0.7216, 0.0103, 3, 0.04, 0.0, 899, 3, 2, 0, 0, 693, 10, 3], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": "\t\t\tf = open(join(tmp_path, str(doc)), 'r')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:Expr_L71_C3", "label": "write()", "type": "expression", "loc": [71, 71], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L69_C2", "vector": [8, 3, 0.732, 0.0103, 3, 0.04, 0.5, 837, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": "\t\t\twf.write(f.read())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:Expr_L72_C3", "label": "close()", "type": "expression", "loc": [72, 72], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L69_C2", "vector": [8, 3, 0.7423, 0.0103, 3, 0.04, 1.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": "\t\t\tf.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:Expr_L73_C2", "label": "close()", "type": "expression", "loc": [73, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99976:FunctionDef_L37_C1", "vector": [8, 2, 0.7526, 0.0103, 2, 0.17, 1.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": "\t\twf.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:FunctionDef_L75_C1", "label": "load", "type": "function", "loc": [75, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99976:ClassDef_L9_C0", "vector": [2, 1, 0.8247, 0.1134, 1, 0.68, 0.75, 37, 0, 1, 0, 0, 0, 0, 12], "semantic": {"name": "load", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef load(self):\n\t\tself.offline_tm = []\n\t\tf = open(Offline_TM_path, 'r')\n\t\tlines = f.readlines()\n\t\tf.close()\n\t\tfor i in xrange(len(lines)):\n\t\t\titems = lines[i].split()\n\t\t\tdic = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:Assign_L76_C2", "label": "self.offline_tm =", "type": "assigned_variable", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99976:FunctionDef_L75_C1", "vector": [14, 2, 0.7835, 0.0103, 2, 0.9, 0.0, 287, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.offline_tm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.offline_tm = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:Assign_L77_C2", "label": "f = open()", "type": "assigned_variable", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99976:FunctionDef_L75_C1", "vector": [14, 2, 0.7938, 0.0103, 2, 0.9, 0.25, 899, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": "\t\tf = open(Offline_TM_path, 'r')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:Assign_L78_C2", "label": "lines = readlines()", "type": "assigned_variable", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99976:FunctionDef_L75_C1", "vector": [14, 2, 0.8041, 0.0103, 2, 0.9, 0.5, 73, 3, 0, 0, 0, 841, 10, 1], "semantic": {"name": "lines", "arg_names": [], "import_names": [], "rhs_call_name": "readlines", "annotation": ""}, "snippet": "\t\tlines = f.readlines()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:Expr_L79_C2", "label": "close()", "type": "expression", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99976:FunctionDef_L75_C1", "vector": [8, 2, 0.8144, 0.0103, 2, 0.9, 0.75, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": "\t\tf.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L80_C2", "label": "for i", "type": "for", "loc": [80, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99976:FunctionDef_L75_C1", "vector": [6, 2, 0.8505, 0.0619, 2, 0.9, 1.0, 826, 3, 0, 0, 0, 0, 0, 9], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor i in xrange(len(lines)):\n\t\t\titems = lines[i].split()\n\t\t\tdic = {}\n\t\t\tfor item in items:\n\t\t\t\tdic[int(item.split(':')[0])] = float(item.split(':')[1].strip())\n\t\t\tself.offline_tm.append(dic)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:Assign_L81_C3", "label": "items = split()", "type": "assigned_variable", "loc": [81, 81], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L80_C2", "vector": [14, 3, 0.8351, 0.0103, 3, 0.51, 0.0, 339, 3, 0, 0, 0, 908, 10, 1], "semantic": {"name": "items", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": "\t\t\titems = lines[i].split()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:Assign_L82_C3", "label": "dic =", "type": "assigned_variable", "loc": [82, 82], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L80_C2", "vector": [14, 3, 0.8454, 0.0103, 3, 0.51, 0.3333, 37, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "dic", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tdic = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L83_C3", "label": "for item", "type": "for", "loc": [83, 84], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L80_C2", "vector": [6, 3, 0.8608, 0.0206, 3, 0.51, 0.6667, 434, 2, 0, 0, 0, 0, 0, 5], "semantic": {"name": "item", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tfor item in items:\n\t\t\t\tdic[int(item.split(':')[0])] = float(item.split(':')[1].strip())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:Assign_L84_C4", "label": " = float()", "type": "assigned_variable", "loc": [84, 84], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L83_C3", "vector": [14, 4, 0.866, 0.0103, 4, 0.52, 0.0, 0, 3, 1, 0, 0, 639, 10, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "float", "annotation": ""}, "snippet": "\t\t\t\tdic[int(item.split(':')[0])] = float(item.split(':')[1].strip())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:Expr_L85_C3", "label": "append()", "type": "expression", "loc": [85, 85], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L80_C2", "vector": [8, 3, 0.8763, 0.0103, 3, 0.51, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": "\t\t\tself.offline_tm.append(dic)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:FunctionDef_L87_C1", "label": "getProb", "type": "function", "loc": [87, 91], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99976:ClassDef_L9_C0", "vector": [2, 1, 0.9175, 0.0515, 1, 0.68, 1.0, 528, 0, 3, 1, 0, 0, 0, 1], "semantic": {"name": "getProb", "arg_names": ["self", "docId", "wordId"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef getProb(self, docId, wordId):\n\t\tif self.offline_tm[docId].has_key(wordId):\n\t\t\treturn self.offline_tm[docId][wordId]\n\t\telse:\n\t\t\treturn 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:If_L88_C2", "label": "if", "type": "if", "loc": [88, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99976:FunctionDef_L87_C1", "vector": [4, 2, 0.9227, 0.0412, 2, 0.54, 0.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif self.offline_tm[docId].has_key(wordId):\n\t\t\treturn self.offline_tm[docId][wordId]\n\t\telse:\n\t\t\treturn 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:Return_L89_C3", "label": "return", "type": "return", "loc": [89, 89], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99976:If_L88_C2", "vector": [13, 3, 0.9175, 0.0103, 3, 0.73, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn self.offline_tm[docId][wordId]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:Return_L91_C3", "label": "return", "type": "return", "loc": [91, 91], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99976:If_L88_C2", "vector": [13, 3, 0.9381, 0.0103, 3, 0.73, 1.0, 0, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:If_L93_C0", "label": "if", "type": "if", "loc": [93, 97], "level": 0, "parent": null, "vector": [4, 0, 0.9794, 0.0515, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n\totm = OfflineTranslationModel()\n\totm.create(True)\n\totm.load()\n\tprint(otm.getProb(5182, 10242))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:Assign_L94_C1", "label": "otm = OfflineTranslationModel()", "type": "assigned_variable", "loc": [94, 94], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99976:If_L93_C0", "vector": [14, 1, 0.9691, 0.0103, 1, 0.83, 0.0, 780, 3, 0, 0, 0, 38, 10, 1], "semantic": {"name": "otm", "arg_names": [], "import_names": [], "rhs_call_name": "OfflineTranslationModel", "annotation": ""}, "snippet": "\totm = OfflineTranslationModel()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:Expr_L95_C1", "label": "create()", "type": "expression", "loc": [95, 95], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99976:If_L93_C0", "vector": [8, 1, 0.9794, 0.0103, 1, 0.83, 0.3333, 316, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "create", "arg_names": [], "import_names": [], "rhs_call_name": "create", "annotation": ""}, "snippet": "\totm.create(True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:Expr_L96_C1", "label": "load()", "type": "expression", "loc": [96, 96], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99976:If_L93_C0", "vector": [8, 1, 0.9897, 0.0103, 1, 0.83, 0.6667, 37, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "load", "arg_names": [], "import_names": [], "rhs_call_name": "load", "annotation": ""}, "snippet": "\totm.load()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99976:Expr_L97_C1", "label": "print()", "type": "expression", "loc": [97, 97], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99976:If_L93_C0", "vector": [8, 1, 1.0, 0.0103, 1, 0.83, 1.0, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\tprint(otm.getProb(5182, 10242))"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99976:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99976:Expr_L10_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99976:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99976:FunctionDef_L14_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99976:FunctionDef_L14_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L16_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L16_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99976:Assign_L17_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L16_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99976:Expr_L18_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L16_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99976:Assign_L19_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L16_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L20_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L20_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99976:Assign_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L20_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L22_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99976:If_L23_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99976:If_L23_C5", "t": "ajibawa-2023/Python-Code-Large/train/row_99976:Assign_L24_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99976:If_L23_C5", "t": "ajibawa-2023/Python-Code-Large/train/row_99976:Assign_L26_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L16_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99976:Assign_L27_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L16_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99976:Assign_L28_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L16_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L29_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L29_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99976:Assign_L30_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L16_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99976:Expr_L31_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L16_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99976:Expr_L32_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99976:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99976:FunctionDef_L37_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99976:FunctionDef_L37_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99976:If_L38_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99976:If_L38_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99976:Expr_L39_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99976:FunctionDef_L37_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99976:Expr_L40_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99976:FunctionDef_L37_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99976:Assign_L41_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99976:FunctionDef_L37_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99976:Expr_L42_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99976:FunctionDef_L37_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99976:Assign_L43_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99976:FunctionDef_L37_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99976:Assign_L44_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99976:FunctionDef_L37_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L45_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L45_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99976:Assign_L46_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L45_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99976:Expr_L47_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L45_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99976:Expr_L48_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99976:FunctionDef_L37_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99976:Assign_L49_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99976:FunctionDef_L37_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99976:Expr_L50_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99976:FunctionDef_L37_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99976:Assign_L52_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99976:FunctionDef_L37_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99976:Assign_L54_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99976:FunctionDef_L37_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L55_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L55_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99976:Expr_L57_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99976:FunctionDef_L37_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L58_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L58_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99976:Expr_L59_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99976:FunctionDef_L37_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L65_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L65_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99976:Expr_L66_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99976:FunctionDef_L37_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99976:Assign_L68_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99976:FunctionDef_L37_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L69_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L69_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99976:Assign_L70_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L69_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99976:Expr_L71_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L69_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99976:Expr_L72_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99976:FunctionDef_L37_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99976:Expr_L73_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99976:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99976:FunctionDef_L75_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99976:FunctionDef_L75_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99976:Assign_L76_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99976:FunctionDef_L75_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99976:Assign_L77_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99976:FunctionDef_L75_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99976:Assign_L78_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99976:FunctionDef_L75_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99976:Expr_L79_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99976:FunctionDef_L75_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L80_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L80_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99976:Assign_L81_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L80_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99976:Assign_L82_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L80_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L83_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L83_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99976:Assign_L84_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99976:For_L80_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99976:Expr_L85_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99976:ClassDef_L9_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99976:FunctionDef_L87_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99976:FunctionDef_L87_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99976:If_L88_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99976:If_L88_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99976:Return_L89_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99976:If_L88_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99976:Return_L91_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99976:If_L93_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99976:Assign_L94_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99976:If_L93_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99976:Expr_L95_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99976:If_L93_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99976:Expr_L96_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99976:If_L93_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99976:Expr_L97_C1"}] |
from os.path import exists, join
from Document import Document
from Lexicon import Lexicon
from config import *
class TranslationModel:
def load(self, is_filt=False):
self.tm = []
for i in xrange(lexicon_size+1):
self.tm.append({})
tm_file = open(TM_path, 'r')
lines = tm_file.readlines()
tm_file.close()
for i in xrange(lexicon_size):
self.tm[i+1][0] = int(lines[i].split()[0])
pair_list = lines[i].split()[1:]
length = len(pair_list)
if is_filt and filter_num < length:
length = filter_num
for j in xrange(length):
pair = pair_list[j]
term_id = int(pair.split(':')[0])
count = int(pair.split(':')[1])
self.tm[i+1][term_id] = count
'''
在ATM中调用,获得global translation model的二阶字典表示
'''
def getTM_dict(self, is_filt=False):
tm = {}
tm_file = open(TM_path, 'r')
lines = tm_file.readlines()
tm_file.close()
for i in xrange(lexicon_size):
sum_num = int(lines[i].split()[0])
if sum_num == 0:
continue
tm[i+1] = {}
tm[i+1][0] = sum_num
pair_list = lines[i].split()[1:]
length = len(pair_list)
if is_filt and filter_num < length:
length = filter_num
for j in xrange(length):
pair = pair_list[j]
term_id = int(pair.split(':')[0])
count = int(pair.split(':')[1])
tm[i+1][term_id] = count
return tm
def create(self):
abstract = []
comments = []
for i in xrange(doccount):
paper = Document(i)
abstract.append(paper.getAbstract())
comments.append(paper.getComments())
self.lexicon = Lexicon()
self.lexicon.load()
self.tm = []
for i in xrange(lexicon_size+1):
self.tm.append({})
self.tm[i][0] = 0
for i in xrange(doccount):
print 'Processing doc %d' % i
if len(abstract[i]) != 0 and len(comments[i]) != 0:
self.__UniCalculate(abstract[i], comments[i])
tm_file = open(TM_path, 'w')
for i in xrange(1, lexicon_size+1):
line = str(self.tm[i][0]) + ' '
for (key, value) in sorted(self.tm[i].iteritems(), key=lambda d:d[1], reverse =
True)[1:]:
line = line + str(key) + ':' + str(value) + ' '
line = line + '\n'
tm_file.write(line)
tm_file.close()
def __UniCalculate(self, abstract, comment_list):
'''
Treat different comments of a document as difference comments
'''
abs_words = abstract.split()
self.__unify(abs_words)
for comment in comment_list:
comment_words = comment.split()
self.__unify(comment_words)
for aw in abs_words:
aw_id = self.lexicon.getIdByTerm(aw)
for cw in comment_words:
cw_id = self.lexicon.getIdByTerm(cw)
if self.tm[aw_id].has_key(cw_id):
self.tm[aw_id][cw_id] = self.tm[aw_id][cw_id] + 1
else:
self.tm[aw_id][cw_id] = 1
self.tm[aw_id][0] = self.tm[aw_id][0] + len(comment_words)
def __MultiCalculate(self, abstract, comment_list):
'''
Treat different comments of a document as only one comment
'''
abs_words = abstract.split()
comment_words = []
for comment in comment_words():
comment_words.extend(comment.strip())
self.__unify(abs_words)
self.__unify(comment_words)
for aw in abs_words:
aw_id = self.lexicon.getIdByTerm(aw)
for cw in comment_words:
cw_id = self.lexicon.getIdByTerm(cw)
if self.tm[aw_id].has_key(cw_id):
self.tm[aw_id][cw_id] = self.tm[aw_id][cw_id] + 1
else:
self.tm[aw_id][cw_id] = 1
self.tm[aw_id][0] = self.tm[aw_id][0] + len(comment_words)
def __unify(self, word_list):
return list(set(word_list))
def getProb(self, orig_id, dest_id):
if self.tm[orig_id].has_key(dest_id):
return 1.0 * self.tm[orig_id][dest_id] / self.tm[orig_id][0]
return 0.0
def getExtensionList(self, word_id):
return sorted(self.tm[word_id].keys())[1:]
if __name__ == '__main__':
tm = TranslationModel()
tm.create()
tm.load(False)
print tm.getProb(206,37107)
| ajibawa-2023/Python-Code-Large/train/row_99977 | 107 | 131 | 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_99977:ImportFrom_L1_C0", "label": "from os.path import exists, join", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0076, 0.0076, 0, 0.66, 0.0, 79, 0, 2, 0, 0, 79, 0, 0], "semantic": {"name": "os.path", "arg_names": [], "import_names": ["exists", "join"], "rhs_call_name": "", "annotation": ""}, "snippet": "from os.path import exists, join"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:ImportFrom_L2_C0", "label": "from Document import Document", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0153, 0.0076, 0, 0.66, 0.25, 920, 0, 1, 0, 0, 920, 0, 0], "semantic": {"name": "Document", "arg_names": [], "import_names": ["Document"], "rhs_call_name": "", "annotation": ""}, "snippet": "from Document import Document"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:ImportFrom_L3_C0", "label": "from Lexicon import Lexicon", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0229, 0.0076, 0, 0.66, 0.5, 16, 0, 1, 0, 0, 16, 0, 0], "semantic": {"name": "Lexicon", "arg_names": [], "import_names": ["Lexicon"], "rhs_call_name": "", "annotation": ""}, "snippet": "from Lexicon import Lexicon"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:ImportFrom_L4_C0", "label": "from config import *", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0305, 0.0076, 0, 0.66, 0.75, 308, 0, 1, 0, 0, 308, 0, 0], "semantic": {"name": "config", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from config import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:ClassDef_L6_C0", "label": "TranslationModel", "type": "class", "loc": [6, 130], "level": 0, "parent": null, "vector": [3, 0, 0.5191, 0.9542, 0, 0.66, 1.0, 753, 0, 8, 0, 0, 0, 0, 75], "semantic": {"name": "TranslationModel", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class TranslationModel:\n\n\tdef load(self, is_filt=False):\n\t\tself.tm = []\n\t\tfor i in xrange(lexicon_size+1):\n\t\t\tself.tm.append({})\n\t\ttm_file = open(TM_path, 'r')\n\t\tlines = tm_file.readlines()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L8_C1", "label": "load", "type": "function", "loc": [8, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:ClassDef_L6_C0", "vector": [2, 1, 0.1336, 0.1527, 1, 0.95, 0.0, 37, 0, 2, 0, 0, 0, 0, 15], "semantic": {"name": "load", "arg_names": ["self", "is_filt"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef load(self, is_filt=False):\n\t\tself.tm = []\n\t\tfor i in xrange(lexicon_size+1):\n\t\t\tself.tm.append({})\n\t\ttm_file = open(TM_path, 'r')\n\t\tlines = tm_file.readlines()\n\t\ttm_file.close()\n\t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L9_C2", "label": "self.tm =", "type": "assigned_variable", "loc": [9, 9], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L8_C1", "vector": [14, 2, 0.0687, 0.0076, 2, 0.79, 0.0, 774, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.tm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.tm = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L10_C2", "label": "for i", "type": "for", "loc": [10, 11], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L8_C1", "vector": [6, 2, 0.0802, 0.0153, 2, 0.79, 0.2, 826, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor i in xrange(lexicon_size+1):\n\t\t\tself.tm.append({})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:Expr_L11_C3", "label": "append()", "type": "expression", "loc": [11, 11], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L10_C2", "vector": [8, 3, 0.084, 0.0076, 3, 0.47, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": "\t\t\tself.tm.append({})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L12_C2", "label": "tm_file = open()", "type": "assigned_variable", "loc": [12, 12], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L8_C1", "vector": [14, 2, 0.0916, 0.0076, 2, 0.79, 0.4, 825, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "tm_file", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": "\t\ttm_file = open(TM_path, 'r')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L13_C2", "label": "lines = readlines()", "type": "assigned_variable", "loc": [13, 13], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L8_C1", "vector": [14, 2, 0.0992, 0.0076, 2, 0.79, 0.6, 73, 3, 0, 0, 0, 841, 10, 1], "semantic": {"name": "lines", "arg_names": [], "import_names": [], "rhs_call_name": "readlines", "annotation": ""}, "snippet": "\t\tlines = tm_file.readlines()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:Expr_L14_C2", "label": "close()", "type": "expression", "loc": [14, 14], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L8_C1", "vector": [8, 2, 0.1069, 0.0076, 2, 0.79, 0.8, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": "\t\ttm_file.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L16_C2", "label": "for i", "type": "for", "loc": [16, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L8_C1", "vector": [6, 2, 0.1641, 0.0916, 2, 0.79, 1.0, 826, 3, 0, 0, 0, 0, 0, 10], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor i in xrange(lexicon_size):\n\t\t\tself.tm[i+1][0] = int(lines[i].split()[0])\n\t\t\tpair_list = lines[i].split()[1:]\n\n\t\t\tlength = len(pair_list)\n\t\t\tif is_filt and filter_num < length:\n\t\t\t\tlength = filter_num\n\t\t\tfor j in xrange(length):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L17_C3", "label": " = int()", "type": "assigned_variable", "loc": [17, 17], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L16_C2", "vector": [14, 3, 0.1298, 0.0076, 3, 0.46, 0.0, 0, 3, 1, 0, 0, 901, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": "\t\t\tself.tm[i+1][0] = int(lines[i].split()[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L18_C3", "label": "pair_list =", "type": "assigned_variable", "loc": [18, 18], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L16_C2", "vector": [14, 3, 0.1374, 0.0076, 3, 0.46, 0.25, 946, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pair_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tpair_list = lines[i].split()[1:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L20_C3", "label": "length = len()", "type": "assigned_variable", "loc": [20, 20], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L16_C2", "vector": [14, 3, 0.1527, 0.0076, 3, 0.46, 0.5, 221, 3, 1, 0, 0, 890, 10, 1], "semantic": {"name": "length", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": "\t\t\tlength = len(pair_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:If_L21_C3", "label": "if", "type": "if", "loc": [21, 22], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L16_C2", "vector": [4, 3, 0.1641, 0.0153, 3, 0.46, 0.75, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif is_filt and filter_num < length:\n\t\t\t\tlength = filter_num"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L22_C4", "label": "length =", "type": "assigned_variable", "loc": [22, 22], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:If_L21_C3", "vector": [14, 4, 0.1679, 0.0076, 4, 0.58, 0.0, 221, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "length", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tlength = filter_num"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L23_C3", "label": "for j", "type": "for", "loc": [23, 27], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L16_C2", "vector": [6, 3, 0.1908, 0.0382, 3, 0.46, 1.0, 100, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "j", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tfor j in xrange(length):\n\t\t\t\tpair = pair_list[j]\n\t\t\t\tterm_id = int(pair.split(':')[0])\n\t\t\t\tcount = int(pair.split(':')[1])\n\t\t\t\tself.tm[i+1][term_id] = count"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L24_C4", "label": "pair =", "type": "assigned_variable", "loc": [24, 24], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L23_C3", "vector": [14, 4, 0.1832, 0.0076, 4, 0.77, 0.0, 825, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pair", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tpair = pair_list[j]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L25_C4", "label": "term_id = int()", "type": "assigned_variable", "loc": [25, 25], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L23_C3", "vector": [14, 4, 0.1908, 0.0076, 4, 0.77, 0.3333, 225, 3, 1, 0, 0, 901, 10, 2], "semantic": {"name": "term_id", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": "\t\t\t\tterm_id = int(pair.split(':')[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L26_C4", "label": "count = int()", "type": "assigned_variable", "loc": [26, 26], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L23_C3", "vector": [14, 4, 0.1985, 0.0076, 4, 0.77, 0.6667, 778, 3, 1, 0, 0, 901, 10, 2], "semantic": {"name": "count", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": "\t\t\t\tcount = int(pair.split(':')[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L27_C4", "label": "assign", "type": "assigned_variable", "loc": [27, 27], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L23_C3", "vector": [14, 4, 0.2061, 0.0076, 4, 0.77, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tself.tm[i+1][term_id] = count"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L28_C1", "label": "getTM_dict", "type": "function", "loc": [28, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:ClassDef_L6_C0", "vector": [2, 1, 0.2939, 0.1679, 1, 0.95, 0.1429, 968, 0, 2, 1, 0, 0, 0, 13], "semantic": {"name": "getTM_dict", "arg_names": ["self", "is_filt"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef getTM_dict(self, is_filt=False):\n\t\ttm = {}\n\t\ttm_file = open(TM_path, 'r')\n\t\tlines = tm_file.readlines()\n\t\ttm_file.close()\n\n\t\tfor i in xrange(lexicon_size):\n\t\t\tsum_num = int(lines[i].split()[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L29_C2", "label": "tm =", "type": "assigned_variable", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L28_C1", "vector": [14, 2, 0.2214, 0.0076, 2, 0.26, 0.0, 404, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "tm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\ttm = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L30_C2", "label": "tm_file = open()", "type": "assigned_variable", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L28_C1", "vector": [14, 2, 0.229, 0.0076, 2, 0.26, 0.2, 825, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "tm_file", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": "\t\ttm_file = open(TM_path, 'r')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L31_C2", "label": "lines = readlines()", "type": "assigned_variable", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L28_C1", "vector": [14, 2, 0.2366, 0.0076, 2, 0.26, 0.4, 73, 3, 0, 0, 0, 841, 10, 1], "semantic": {"name": "lines", "arg_names": [], "import_names": [], "rhs_call_name": "readlines", "annotation": ""}, "snippet": "\t\tlines = tm_file.readlines()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:Expr_L32_C2", "label": "close()", "type": "expression", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L28_C1", "vector": [8, 2, 0.2443, 0.0076, 2, 0.26, 0.6, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": "\t\ttm_file.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L34_C2", "label": "for i", "type": "for", "loc": [34, 48], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L28_C1", "vector": [6, 2, 0.313, 0.1145, 2, 0.26, 0.8, 826, 3, 0, 0, 0, 0, 0, 10], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor i in xrange(lexicon_size):\n\t\t\tsum_num = int(lines[i].split()[0])\n\t\t\tif sum_num == 0:\n\t\t\t\tcontinue\n\t\t\ttm[i+1] = {}\n\t\t\ttm[i+1][0] = sum_num\n\t\t\tpair_list = lines[i].split()[1:]\n\t\t\tlength = len(pair_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L35_C3", "label": "sum_num = int()", "type": "assigned_variable", "loc": [35, 35], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L34_C2", "vector": [14, 3, 0.2672, 0.0076, 3, 0.21, 0.0, 954, 3, 1, 0, 0, 901, 10, 2], "semantic": {"name": "sum_num", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": "\t\t\tsum_num = int(lines[i].split()[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:If_L36_C3", "label": "if", "type": "if", "loc": [36, 37], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L34_C2", "vector": [4, 3, 0.2786, 0.0153, 3, 0.21, 0.1429, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif sum_num == 0:\n\t\t\t\tcontinue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L38_C3", "label": "assign", "type": "assigned_variable", "loc": [38, 38], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L34_C2", "vector": [14, 3, 0.2901, 0.0076, 3, 0.21, 0.2857, 0, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\ttm[i+1] = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L39_C3", "label": "assign", "type": "assigned_variable", "loc": [39, 39], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L34_C2", "vector": [14, 3, 0.2977, 0.0076, 3, 0.21, 0.4286, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\ttm[i+1][0] = sum_num"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L40_C3", "label": "pair_list =", "type": "assigned_variable", "loc": [40, 40], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L34_C2", "vector": [14, 3, 0.3053, 0.0076, 3, 0.21, 0.5714, 946, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "pair_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tpair_list = lines[i].split()[1:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L41_C3", "label": "length = len()", "type": "assigned_variable", "loc": [41, 41], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L34_C2", "vector": [14, 3, 0.313, 0.0076, 3, 0.21, 0.7143, 221, 3, 1, 0, 0, 890, 10, 1], "semantic": {"name": "length", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": "\t\t\tlength = len(pair_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:If_L42_C3", "label": "if", "type": "if", "loc": [42, 43], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L34_C2", "vector": [4, 3, 0.3244, 0.0153, 3, 0.21, 0.8571, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif is_filt and filter_num < length:\n\t\t\t\tlength = filter_num"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L43_C4", "label": "length =", "type": "assigned_variable", "loc": [43, 43], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:If_L42_C3", "vector": [14, 4, 0.3282, 0.0076, 4, 0.48, 0.0, 221, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "length", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tlength = filter_num"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L44_C3", "label": "for j", "type": "for", "loc": [44, 48], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L34_C2", "vector": [6, 3, 0.3511, 0.0382, 3, 0.21, 1.0, 100, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "j", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tfor j in xrange(length):\n\t\t\t\tpair = pair_list[j]\n\t\t\t\tterm_id = int(pair.split(':')[0])\n\t\t\t\tcount = int(pair.split(':')[1])\n\t\t\t\ttm[i+1][term_id] = count"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L45_C4", "label": "pair =", "type": "assigned_variable", "loc": [45, 45], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L44_C3", "vector": [14, 4, 0.3435, 0.0076, 4, 0.07, 0.0, 825, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "pair", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tpair = pair_list[j]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L46_C4", "label": "term_id = int()", "type": "assigned_variable", "loc": [46, 46], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L44_C3", "vector": [14, 4, 0.3511, 0.0076, 4, 0.07, 0.3333, 225, 3, 1, 0, 0, 901, 10, 2], "semantic": {"name": "term_id", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": "\t\t\t\tterm_id = int(pair.split(':')[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L47_C4", "label": "count = int()", "type": "assigned_variable", "loc": [47, 47], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L44_C3", "vector": [14, 4, 0.3588, 0.0076, 4, 0.07, 0.6667, 778, 3, 1, 0, 0, 901, 10, 2], "semantic": {"name": "count", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": "\t\t\t\tcount = int(pair.split(':')[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L48_C4", "label": "assign", "type": "assigned_variable", "loc": [48, 48], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L44_C3", "vector": [14, 4, 0.3664, 0.0076, 4, 0.07, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\ttm[i+1][term_id] = count"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:Return_L49_C2", "label": "return", "type": "return", "loc": [49, 49], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L28_C1", "vector": [13, 2, 0.374, 0.0076, 2, 0.26, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn tm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L51_C1", "label": "create", "type": "function", "loc": [51, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:ClassDef_L6_C0", "vector": [2, 1, 0.5, 0.229, 1, 0.95, 0.2857, 316, 0, 1, 0, 0, 0, 0, 24], "semantic": {"name": "create", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef create(self):\n\t\tabstract = []\n\t\tcomments = []\n\t\tfor i in xrange(doccount):\n\t\t\tpaper = Document(i)\n\t\t\tabstract.append(paper.getAbstract())\n\t\t\tcomments.append(paper.getComments())\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L52_C2", "label": "abstract =", "type": "assigned_variable", "loc": [52, 52], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L51_C1", "vector": [14, 2, 0.3969, 0.0076, 2, 0.64, 0.0, 301, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "abstract", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tabstract = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L53_C2", "label": "comments =", "type": "assigned_variable", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L51_C1", "vector": [14, 2, 0.4046, 0.0076, 2, 0.64, 0.1, 122, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "comments", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tcomments = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L54_C2", "label": "for i", "type": "for", "loc": [54, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L51_C1", "vector": [6, 2, 0.4237, 0.0305, 2, 0.64, 0.2, 826, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor i in xrange(doccount):\n\t\t\tpaper = Document(i)\n\t\t\tabstract.append(paper.getAbstract())\n\t\t\tcomments.append(paper.getComments())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L55_C3", "label": "paper = Document()", "type": "assigned_variable", "loc": [55, 55], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L54_C2", "vector": [14, 3, 0.4198, 0.0076, 3, 0.85, 0.0, 446, 3, 1, 0, 0, 920, 10, 1], "semantic": {"name": "paper", "arg_names": [], "import_names": [], "rhs_call_name": "Document", "annotation": ""}, "snippet": "\t\t\tpaper = Document(i)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:Expr_L56_C3", "label": "append()", "type": "expression", "loc": [56, 56], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L54_C2", "vector": [8, 3, 0.4275, 0.0076, 3, 0.85, 0.5, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": "\t\t\tabstract.append(paper.getAbstract())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:Expr_L57_C3", "label": "append()", "type": "expression", "loc": [57, 57], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L54_C2", "vector": [8, 3, 0.4351, 0.0076, 3, 0.85, 1.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": "\t\t\tcomments.append(paper.getComments())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L59_C2", "label": "self.lexicon = Lexicon()", "type": "assigned_variable", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L51_C1", "vector": [14, 2, 0.4504, 0.0076, 2, 0.64, 0.3, 61, 3, 0, 0, 0, 16, 10, 1], "semantic": {"name": "self.lexicon", "arg_names": [], "import_names": [], "rhs_call_name": "Lexicon", "annotation": ""}, "snippet": "\t\tself.lexicon = Lexicon()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:Expr_L60_C2", "label": "load()", "type": "expression", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L51_C1", "vector": [8, 2, 0.458, 0.0076, 2, 0.64, 0.4, 37, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "load", "arg_names": [], "import_names": [], "rhs_call_name": "load", "annotation": ""}, "snippet": "\t\tself.lexicon.load()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L62_C2", "label": "self.tm =", "type": "assigned_variable", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L51_C1", "vector": [14, 2, 0.4733, 0.0076, 2, 0.64, 0.5, 774, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.tm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.tm = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L63_C2", "label": "for i", "type": "for", "loc": [63, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L51_C1", "vector": [6, 2, 0.4885, 0.0229, 2, 0.64, 0.6, 826, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor i in xrange(lexicon_size+1):\n\t\t\tself.tm.append({})\n\t\t\tself.tm[i][0] = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:Expr_L64_C3", "label": "append()", "type": "expression", "loc": [64, 64], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L63_C2", "vector": [8, 3, 0.4885, 0.0076, 3, 0.32, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": "\t\t\tself.tm.append({})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L65_C3", "label": "assign", "type": "assigned_variable", "loc": [65, 65], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L63_C2", "vector": [14, 3, 0.4962, 0.0076, 3, 0.32, 1.0, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tself.tm[i][0] = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L67_C2", "label": "for i", "type": "for", "loc": [67, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L51_C1", "vector": [6, 2, 0.5229, 0.0305, 2, 0.64, 0.7, 826, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor i in xrange(doccount):\n\t\t\tprint('Processing doc %d' % i)\n\t\t\tif len(abstract[i]) != 0 and len(comments[i]) != 0:\n\t\t\t\tself.__UniCalculate(abstract[i], comments[i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:Expr_L68_C3", "label": "print()", "type": "expression", "loc": [68, 68], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L67_C2", "vector": [8, 3, 0.5191, 0.0076, 3, 0.94, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\t\t\tprint('Processing doc %d' % i)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:If_L69_C3", "label": "if", "type": "if", "loc": [69, 70], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L67_C2", "vector": [4, 3, 0.5305, 0.0153, 3, 0.94, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif len(abstract[i]) != 0 and len(comments[i]) != 0:\n\t\t\t\tself.__UniCalculate(abstract[i], comments[i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:Expr_L70_C4", "label": "__UniCalculate()", "type": "expression", "loc": [70, 70], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:If_L69_C3", "vector": [8, 4, 0.5344, 0.0076, 4, 0.02, 0.0, 58, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "__UniCalculate", "arg_names": [], "import_names": [], "rhs_call_name": "__UniCalculate", "annotation": ""}, "snippet": "\t\t\t\tself.__UniCalculate(abstract[i], comments[i])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L72_C2", "label": "tm_file = open()", "type": "assigned_variable", "loc": [72, 72], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L51_C1", "vector": [14, 2, 0.5496, 0.0076, 2, 0.64, 0.8, 825, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "tm_file", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": "\t\ttm_file = open(TM_path, 'w')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L73_C2", "label": "for i", "type": "for", "loc": [73, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L51_C1", "vector": [6, 2, 0.5802, 0.0534, 2, 0.64, 0.9, 826, 3, 0, 0, 0, 0, 0, 7], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor i in xrange(1, lexicon_size+1):\n\t\t\tline = str(self.tm[i][0]) + ' '\n\t\t\tfor (key, value) in sorted(self.tm[i].iteritems(), key=lambda d:d[1], reverse =\n\t\t\t\t\tTrue)[1:]:\n\t\t\t\tline = line + str(key) + ':' + str(value) + ' '\n\t\t\tline = line + '\\n'\n\t\t\ttm_file.write(line)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L74_C3", "label": "line =", "type": "assigned_variable", "loc": [74, 74], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L73_C2", "vector": [14, 3, 0.5649, 0.0076, 3, 0.71, 0.0, 373, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "line", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tline = str(self.tm[i][0]) + ' '"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L75_C3", "label": "for key, value", "type": "for", "loc": [75, 77], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L73_C2", "vector": [6, 3, 0.5802, 0.0229, 3, 0.71, 0.3333, 839, 6, 0, 0, 0, 0, 0, 4], "semantic": {"name": "key, value", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tfor (key, value) in sorted(self.tm[i].iteritems(), key=lambda d:d[1], reverse =\n\t\t\t\t\tTrue)[1:]:\n\t\t\t\tline = line + str(key) + ':' + str(value) + ' '"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L77_C4", "label": "line =", "type": "assigned_variable", "loc": [77, 77], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L75_C3", "vector": [14, 4, 0.5878, 0.0076, 4, 0.97, 0.0, 373, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "line", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tline = line + str(key) + ':' + str(value) + ' '"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L78_C3", "label": "line =", "type": "assigned_variable", "loc": [78, 78], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L73_C2", "vector": [14, 3, 0.5954, 0.0076, 3, 0.71, 0.6667, 373, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "line", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tline = line + '\\n'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:Expr_L79_C3", "label": "write()", "type": "expression", "loc": [79, 79], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L73_C2", "vector": [8, 3, 0.6031, 0.0076, 3, 0.71, 1.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": "\t\t\ttm_file.write(line)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:Expr_L80_C2", "label": "close()", "type": "expression", "loc": [80, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L51_C1", "vector": [8, 2, 0.6107, 0.0076, 2, 0.64, 1.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": "\t\ttm_file.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L82_C1", "label": "__UniCalculate", "type": "function", "loc": [82, 99], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:ClassDef_L6_C0", "vector": [2, 1, 0.6908, 0.1374, 1, 0.95, 0.4286, 58, 0, 3, 0, 0, 0, 0, 8], "semantic": {"name": "__UniCalculate", "arg_names": ["self", "abstract", "comment_list"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __UniCalculate(self, abstract, comment_list):\n\t\t'''\n\t\tTreat different comments of a document as difference comments\n\t\t'''\n\t\tabs_words = abstract.split()\n\t\tself.__unify(abs_words)\n\t\tfor comment in comment_list:\n\t\t\tcomment_words = comment.split()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:Expr_L83_C2", "label": "expression", "type": "expression", "loc": [83, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L82_C1", "vector": [8, 2, 0.6412, 0.0229, 2, 0.56, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t'''\n\t\tTreat different comments of a document as difference comments\n\t\t'''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L86_C2", "label": "abs_words = split()", "type": "assigned_variable", "loc": [86, 86], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L82_C1", "vector": [14, 2, 0.6565, 0.0076, 2, 0.56, 0.3333, 174, 3, 0, 0, 0, 908, 10, 1], "semantic": {"name": "abs_words", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": "\t\tabs_words = abstract.split()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:Expr_L87_C2", "label": "__unify()", "type": "expression", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L82_C1", "vector": [8, 2, 0.6641, 0.0076, 2, 0.56, 0.6667, 636, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "__unify", "arg_names": [], "import_names": [], "rhs_call_name": "__unify", "annotation": ""}, "snippet": "\t\tself.__unify(abs_words)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L88_C2", "label": "for comment", "type": "for", "loc": [88, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L82_C1", "vector": [6, 2, 0.7137, 0.0916, 2, 0.56, 1.0, 34, 2, 0, 0, 0, 0, 0, 6], "semantic": {"name": "comment", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor comment in comment_list:\n\t\t\tcomment_words = comment.split()\n\t\t\tself.__unify(comment_words)\n\t\t\tfor aw in abs_words:\n\t\t\t\taw_id = self.lexicon.getIdByTerm(aw)\n\t\t\t\tfor cw in comment_words:\n\t\t\t\t\tcw_id = self.lexicon.getIdByTerm(cw)\n\t\t\t\t\tif self.tm[aw_id].has_key(cw_id):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L89_C3", "label": "comment_words = split()", "type": "assigned_variable", "loc": [89, 89], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L88_C2", "vector": [14, 3, 0.6794, 0.0076, 3, 0.58, 0.0, 304, 3, 0, 0, 0, 908, 10, 1], "semantic": {"name": "comment_words", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": "\t\t\tcomment_words = comment.split()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:Expr_L90_C3", "label": "__unify()", "type": "expression", "loc": [90, 90], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L88_C2", "vector": [8, 3, 0.687, 0.0076, 3, 0.58, 0.5, 636, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "__unify", "arg_names": [], "import_names": [], "rhs_call_name": "__unify", "annotation": ""}, "snippet": "\t\t\tself.__unify(comment_words)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L91_C3", "label": "for aw", "type": "for", "loc": [91, 99], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L88_C2", "vector": [6, 3, 0.7252, 0.0687, 3, 0.58, 1.0, 884, 2, 0, 0, 0, 0, 0, 4], "semantic": {"name": "aw", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tfor aw in abs_words:\n\t\t\t\taw_id = self.lexicon.getIdByTerm(aw)\n\t\t\t\tfor cw in comment_words:\n\t\t\t\t\tcw_id = self.lexicon.getIdByTerm(cw)\n\t\t\t\t\tif self.tm[aw_id].has_key(cw_id):\n\t\t\t\t\t\tself.tm[aw_id][cw_id] = self.tm[aw_id][cw_id] + 1\n\t\t\t\t\telse:\n\t\t\t\t\t\tself.tm[aw_id][cw_id] = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L92_C4", "label": "aw_id = getIdByTerm()", "type": "assigned_variable", "loc": [92, 92], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L91_C3", "vector": [14, 4, 0.7023, 0.0076, 4, 0.91, 0.0, 499, 3, 1, 0, 0, 805, 10, 1], "semantic": {"name": "aw_id", "arg_names": [], "import_names": [], "rhs_call_name": "getIdByTerm", "annotation": ""}, "snippet": "\t\t\t\taw_id = self.lexicon.getIdByTerm(aw)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L93_C4", "label": "for cw", "type": "for", "loc": [93, 98], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L91_C3", "vector": [6, 4, 0.729, 0.0458, 4, 0.91, 0.5, 827, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "cw", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tfor cw in comment_words:\n\t\t\t\t\tcw_id = self.lexicon.getIdByTerm(cw)\n\t\t\t\t\tif self.tm[aw_id].has_key(cw_id):\n\t\t\t\t\t\tself.tm[aw_id][cw_id] = self.tm[aw_id][cw_id] + 1\n\t\t\t\t\telse:\n\t\t\t\t\t\tself.tm[aw_id][cw_id] = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L94_C5", "label": "cw_id = getIdByTerm()", "type": "assigned_variable", "loc": [94, 94], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L93_C4", "vector": [14, 5, 0.7176, 0.0076, 5, 0.7, 0.0, 767, 3, 1, 0, 0, 805, 10, 1], "semantic": {"name": "cw_id", "arg_names": [], "import_names": [], "rhs_call_name": "getIdByTerm", "annotation": ""}, "snippet": "\t\t\t\t\tcw_id = self.lexicon.getIdByTerm(cw)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:If_L95_C5", "label": "if", "type": "if", "loc": [95, 98], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L93_C4", "vector": [4, 5, 0.7366, 0.0305, 5, 0.7, 1.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\t\tif self.tm[aw_id].has_key(cw_id):\n\t\t\t\t\t\tself.tm[aw_id][cw_id] = self.tm[aw_id][cw_id] + 1\n\t\t\t\t\telse:\n\t\t\t\t\t\tself.tm[aw_id][cw_id] = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L96_C6", "label": "assign", "type": "assigned_variable", "loc": [96, 96], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:If_L95_C5", "vector": [14, 6, 0.7328, 0.0076, 6, 0.66, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\t\t\tself.tm[aw_id][cw_id] = self.tm[aw_id][cw_id] + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L98_C6", "label": "assign", "type": "assigned_variable", "loc": [98, 98], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:If_L95_C5", "vector": [14, 6, 0.7481, 0.0076, 6, 0.66, 1.0, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\t\t\tself.tm[aw_id][cw_id] = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L99_C4", "label": "assign", "type": "assigned_variable", "loc": [99, 99], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L91_C3", "vector": [14, 4, 0.7557, 0.0076, 4, 0.91, 1.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tself.tm[aw_id][0] = self.tm[aw_id][0] + len(comment_words)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L101_C1", "label": "__MultiCalculate", "type": "function", "loc": [101, 120], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:ClassDef_L6_C0", "vector": [2, 1, 0.8435, 0.1527, 1, 0.95, 0.5714, 525, 0, 3, 0, 0, 0, 0, 10], "semantic": {"name": "__MultiCalculate", "arg_names": ["self", "abstract", "comment_list"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __MultiCalculate(self, abstract, comment_list):\n\t\t'''\n\t\tTreat different comments of a document as only one comment\n\t\t'''\n\t\tabs_words = abstract.split()\n\t\tcomment_words = []\n\t\tfor comment in comment_words():\n\t\t\tcomment_words.extend(comment.strip())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:Expr_L102_C2", "label": "expression", "type": "expression", "loc": [102, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L101_C1", "vector": [8, 2, 0.7863, 0.0229, 2, 0.92, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t'''\n\t\tTreat different comments of a document as only one comment\n\t\t'''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L105_C2", "label": "abs_words = split()", "type": "assigned_variable", "loc": [105, 105], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L101_C1", "vector": [14, 2, 0.8015, 0.0076, 2, 0.92, 0.1667, 174, 3, 0, 0, 0, 908, 10, 1], "semantic": {"name": "abs_words", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": "\t\tabs_words = abstract.split()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L106_C2", "label": "comment_words =", "type": "assigned_variable", "loc": [106, 106], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L101_C1", "vector": [14, 2, 0.8092, 0.0076, 2, 0.92, 0.3333, 304, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "comment_words", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tcomment_words = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L107_C2", "label": "for comment", "type": "for", "loc": [107, 108], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L101_C1", "vector": [6, 2, 0.8206, 0.0153, 2, 0.92, 0.5, 34, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "comment", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor comment in comment_words():\n\t\t\tcomment_words.extend(comment.strip())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:Expr_L108_C3", "label": "extend()", "type": "expression", "loc": [108, 108], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L107_C2", "vector": [8, 3, 0.8244, 0.0076, 3, 0.63, 0.0, 660, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "extend", "arg_names": [], "import_names": [], "rhs_call_name": "extend", "annotation": ""}, "snippet": "\t\t\tcomment_words.extend(comment.strip())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:Expr_L109_C2", "label": "__unify()", "type": "expression", "loc": [109, 109], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L101_C1", "vector": [8, 2, 0.8321, 0.0076, 2, 0.92, 0.6667, 636, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "__unify", "arg_names": [], "import_names": [], "rhs_call_name": "__unify", "annotation": ""}, "snippet": "\t\tself.__unify(abs_words)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:Expr_L110_C2", "label": "__unify()", "type": "expression", "loc": [110, 110], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L101_C1", "vector": [8, 2, 0.8397, 0.0076, 2, 0.92, 0.8333, 636, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "__unify", "arg_names": [], "import_names": [], "rhs_call_name": "__unify", "annotation": ""}, "snippet": "\t\tself.__unify(comment_words)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L112_C2", "label": "for aw", "type": "for", "loc": [112, 120], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L101_C1", "vector": [6, 2, 0.8855, 0.0687, 2, 0.92, 1.0, 884, 2, 0, 0, 0, 0, 0, 4], "semantic": {"name": "aw", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor aw in abs_words:\n\t\t\taw_id = self.lexicon.getIdByTerm(aw)\n\t\t\tfor cw in comment_words:\n\t\t\t\tcw_id = self.lexicon.getIdByTerm(cw)\n\t\t\t\tif self.tm[aw_id].has_key(cw_id):\n\t\t\t\t\tself.tm[aw_id][cw_id] = self.tm[aw_id][cw_id] + 1\n\t\t\t\telse:\n\t\t\t\t\tself.tm[aw_id][cw_id] = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L113_C3", "label": "aw_id = getIdByTerm()", "type": "assigned_variable", "loc": [113, 113], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L112_C2", "vector": [14, 3, 0.8626, 0.0076, 3, 0.27, 0.0, 499, 3, 1, 0, 0, 805, 10, 1], "semantic": {"name": "aw_id", "arg_names": [], "import_names": [], "rhs_call_name": "getIdByTerm", "annotation": ""}, "snippet": "\t\t\taw_id = self.lexicon.getIdByTerm(aw)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L114_C3", "label": "for cw", "type": "for", "loc": [114, 119], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L112_C2", "vector": [6, 3, 0.8893, 0.0458, 3, 0.27, 0.5, 827, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "cw", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tfor cw in comment_words:\n\t\t\t\tcw_id = self.lexicon.getIdByTerm(cw)\n\t\t\t\tif self.tm[aw_id].has_key(cw_id):\n\t\t\t\t\tself.tm[aw_id][cw_id] = self.tm[aw_id][cw_id] + 1\n\t\t\t\telse:\n\t\t\t\t\tself.tm[aw_id][cw_id] = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L115_C4", "label": "cw_id = getIdByTerm()", "type": "assigned_variable", "loc": [115, 115], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L114_C3", "vector": [14, 4, 0.8779, 0.0076, 4, 0.4, 0.0, 767, 3, 1, 0, 0, 805, 10, 1], "semantic": {"name": "cw_id", "arg_names": [], "import_names": [], "rhs_call_name": "getIdByTerm", "annotation": ""}, "snippet": "\t\t\t\tcw_id = self.lexicon.getIdByTerm(cw)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:If_L116_C4", "label": "if", "type": "if", "loc": [116, 119], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L114_C3", "vector": [4, 4, 0.8969, 0.0305, 4, 0.4, 1.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tif self.tm[aw_id].has_key(cw_id):\n\t\t\t\t\tself.tm[aw_id][cw_id] = self.tm[aw_id][cw_id] + 1\n\t\t\t\telse:\n\t\t\t\t\tself.tm[aw_id][cw_id] = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L117_C5", "label": "assign", "type": "assigned_variable", "loc": [117, 117], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:If_L116_C4", "vector": [14, 5, 0.8931, 0.0076, 5, 0.33, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\t\tself.tm[aw_id][cw_id] = self.tm[aw_id][cw_id] + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L119_C5", "label": "assign", "type": "assigned_variable", "loc": [119, 119], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:If_L116_C4", "vector": [14, 5, 0.9084, 0.0076, 5, 0.33, 1.0, 0, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\t\tself.tm[aw_id][cw_id] = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L120_C3", "label": "assign", "type": "assigned_variable", "loc": [120, 120], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L112_C2", "vector": [14, 3, 0.916, 0.0076, 3, 0.27, 1.0, 0, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tself.tm[aw_id][0] = self.tm[aw_id][0] + len(comment_words)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L122_C1", "label": "__unify", "type": "function", "loc": [122, 123], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:ClassDef_L6_C0", "vector": [2, 1, 0.9351, 0.0153, 1, 0.95, 0.7143, 636, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "__unify", "arg_names": ["self", "word_list"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __unify(self, word_list):\n\t\treturn list(set(word_list))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:Return_L123_C2", "label": "return", "type": "return", "loc": [123, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L122_C1", "vector": [13, 2, 0.9389, 0.0076, 2, 0.86, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn list(set(word_list))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L125_C1", "label": "getProb", "type": "function", "loc": [125, 128], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:ClassDef_L6_C0", "vector": [2, 1, 0.9656, 0.0305, 1, 0.95, 0.8571, 528, 0, 3, 1, 0, 0, 0, 1], "semantic": {"name": "getProb", "arg_names": ["self", "orig_id", "dest_id"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef getProb(self, orig_id, dest_id):\n\t\tif self.tm[orig_id].has_key(dest_id):\n\t\t\treturn 1.0 * self.tm[orig_id][dest_id] / self.tm[orig_id][0]\n\t\treturn 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:If_L126_C2", "label": "if", "type": "if", "loc": [126, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L125_C1", "vector": [4, 2, 0.9656, 0.0153, 2, 0.54, 0.0, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif self.tm[orig_id].has_key(dest_id):\n\t\t\treturn 1.0 * self.tm[orig_id][dest_id] / self.tm[orig_id][0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:Return_L127_C3", "label": "return", "type": "return", "loc": [127, 127], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:If_L126_C2", "vector": [13, 3, 0.9695, 0.0076, 3, 0.37, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn 1.0 * self.tm[orig_id][dest_id] / self.tm[orig_id][0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:Return_L128_C2", "label": "return", "type": "return", "loc": [128, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L125_C1", "vector": [13, 2, 0.9771, 0.0076, 2, 0.54, 1.0, 0, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L129_C1", "label": "getExtensionList", "type": "function", "loc": [129, 130], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:ClassDef_L6_C0", "vector": [2, 1, 0.9885, 0.0153, 1, 0.95, 1.0, 302, 0, 2, 1, 0, 0, 0, 2], "semantic": {"name": "getExtensionList", "arg_names": ["self", "word_id"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef getExtensionList(self, word_id):\n\t\treturn sorted(self.tm[word_id].keys())[1:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99977:Return_L130_C2", "label": "return", "type": "return", "loc": [130, 130], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L129_C1", "vector": [13, 2, 0.9924, 0.0076, 2, 0.44, 0.0, 0, 6, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn sorted(self.tm[word_id].keys())[1:]"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99977:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L8_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L8_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L9_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L8_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L10_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L10_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:Expr_L11_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L8_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L12_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L8_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L13_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L8_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:Expr_L14_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L8_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L16_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L16_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L17_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L16_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L18_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L16_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L20_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L16_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:If_L21_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:If_L21_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L16_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L23_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L23_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L24_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L23_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L23_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L23_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L28_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L28_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L29_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L28_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L30_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L28_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L31_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L28_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:Expr_L32_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L28_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L34_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L34_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L35_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L34_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:If_L36_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L34_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L38_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L34_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L39_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L34_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L40_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L34_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L41_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L34_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:If_L42_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:If_L42_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L43_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L34_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L44_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L44_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L44_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L44_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L44_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L28_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:Return_L49_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L51_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L51_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L52_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L51_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L53_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L51_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L54_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L54_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L55_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L54_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:Expr_L56_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L54_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:Expr_L57_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L51_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L59_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L51_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:Expr_L60_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L51_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L62_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L51_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L63_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L63_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:Expr_L64_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L63_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L65_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L51_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L67_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L67_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:Expr_L68_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L67_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:If_L69_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:If_L69_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:Expr_L70_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L51_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L72_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L51_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L73_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L73_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L74_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L73_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L75_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L75_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L77_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L73_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L78_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L73_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:Expr_L79_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L51_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:Expr_L80_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L82_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L82_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:Expr_L83_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L82_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L86_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L82_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:Expr_L87_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L82_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L88_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L88_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L89_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L88_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:Expr_L90_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L88_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L91_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L91_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L92_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L91_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L93_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L93_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L94_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L93_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:If_L95_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:If_L95_C5", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L96_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:If_L95_C5", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L98_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L91_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L99_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L101_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L101_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:Expr_L102_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L101_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L105_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L101_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L106_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L101_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L107_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L107_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:Expr_L108_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L101_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:Expr_L109_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L101_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:Expr_L110_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L101_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L112_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L112_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L113_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L112_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L114_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L114_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L115_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L114_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:If_L116_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:If_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L117_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:If_L116_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L119_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:For_L112_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:Assign_L120_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L122_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L122_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:Return_L123_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L125_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L125_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:If_L126_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:If_L126_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:Return_L127_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L125_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:Return_L128_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:ClassDef_L6_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L129_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99977:FunctionDef_L129_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99977:Return_L130_C2"}] |
'''
prerequisite:
1) allocate the term-id and doc-id;
2) build a language model for each passage (fixed window)
3) get an initialed translation model
'''
from ML import ML
from QueryManager import QueryManager
from Query import Query
from Lexicon import Lexicon
from TranslationModel import TranslationModel
from time import clock
from DictUtils import *
def printModel(dic):
for key in dic.keys():
line = str(key) + ' '
for k2 in dic[key].keys():
line = line + str(k2) + ':' + str(dic[key][k2])
print line
class ATM: # aligned translation model
'''
EM algorithm for training:
qd_reader: a reader for query-doc pair;
init_tm:
'''
def train(self, init_tm, iterate_num, model_diff):
prev_global_translation = init_tm
qm = QueryManager()
qm.load()
query_count = 100 #test for 1000 queries
lexicon = Lexicon()
lexicon.load()
for i in xrange(iterate_num):
t1 = clock()
print 'Iterate %d model :' % (i+1)
# printModel(prev_global_translation)
global_translation = {}
for query_index in xrange(query_count):
query = qm.getQuery(query_index)
q = []
for term in query.getQuery().split():
q.append(lexicon.getIdByTerm(term))
doc = ML(str(query.getAnsdoc()))
passage_models = doc.getPassageModels()
passage_scores = []
passage_translations = []
for lm in passage_models:
# t3 = clock()
passage_score, passage_translation = self.passage_score(q, lm, prev_global_translation)
passage_scores.append(passage_score)
passage_translations.append(passage_translation)
# t4 = clock()
# print 'Query pair cost %f s' % (t4-t3)
self.passage_norm(passage_scores)
doc_translation = self.doc_translation_norm(passage_translations, passage_scores)
self.update_translation(global_translation, doc_translation)
self.translation_norm(global_translation)
error = self.compare(prev_global_translation, global_translation)
print 'Iterate %d error %f .' % (i+1, error)
if(error < model_diff):
break;
prev_global_translation = global_translation;
t2 = clock()
print 'Iterate %d cost %f s' % (i+1, t2-t1)
self.model = global_translation
def writeModel(self):
f = open('EM_TM_path', 'w')#test path
for td in self.model.keys():
line = str(td) + ' '
for tq in self.model[td].keys():
line = line + str(tq) + ':' + str(self.model[td][tq]) + ' '
line = line + '\n'
f.write(line)
f.close()
def load(self):
f = open(EM_TM_path, 'r')
self.model = {}
lines = f.readlines()
f.close()
for line in lines:
items = line.split()
td = int(items[0])
for item in items[1:]:
tq = int(item.split(':')[0])
value = float(item.split(':')[1])
addElement_twolevel(self.model, td, tq ,value)
def getProb(self, td, tq):
return getElement_twolevel(self.model, td, tq)
def passage_score(self, q, lm, ptm):
score = 1.0
translation = {}
for td in lm.keys():
translation[td] = {}
for tq in q:
k_score = 0.0
for td in lm.keys():
if td == 0:
continue
p1 = getElement_twolevel(ptm, td, tq)
p2 = getElement_onelevel(lm, td)
if p1 * p2 == 0:
continue
translation[td][tq] = p1 * p2
k_score = k_score + p1 * p2
score = score * k_score
return (score, translation)
def passage_norm(self, passage_scores):
denominator = 0.0
for score in passage_scores:
denominator = denominator + score
if denominator == 0:
return
for i in xrange(len(passage_scores)):
passage_scores[i] = passage_scores[i] / denominator
def doc_translation_norm(self, passage_translations, passage_scores):
doc_translation = {}
for k in xrange(len(passage_scores)):
if passage_scores[k] == 0:
continue
for td in passage_translations[k].keys():
for tq in passage_translations[k][td].keys():
addElement_twolevel(doc_translation, tq, td, passage_scores[k] * passage_translations[k][td][tq])
for tq in doc_translation.keys():
for td in doc_translation[tq].keys():
if td == 0:
continue #Remember not do normalization to 0th element
doc_translation[tq][td] = doc_translation[tq][td] / doc_translation[tq][0]
doc_translation[tq][0] = 1.0
return doc_translation
def update_translation(self, global_translation, doc_translation):
for tq in doc_translation.keys():
for td in doc_translation[tq].keys():
if td == 0:
continue
addElement_twolevel(global_translation, td, tq, doc_translation[tq][td])
def translation_norm(self, global_translation):
for td in global_translation.keys():
for tq in global_translation[td].keys():
if tq == 0:
continue
global_translation[td][tq] = global_translation[td][tq] / global_translation[td][0]
global_translation[td][0] = 1.0
def compare(self, pt, gt):
diff = 0.0
td_list = set(pt.keys()) | set(gt.keys()) - set([0])
row = len(td_list)
col = 0
for td in td_list:
tq_list = set()
if pt.has_key(td):
tq_list = tq_list | set(pt[td].keys())
if gt.has_key(td):
tq_list = tq_list | set(gt[td].keys())
col += len(tq_list)
tq_list = tq_list - set([0])
for tq in tq_list:
diff = diff + abs(getElement_twolevel(pt, td, tq) - getElement_twolevel(gt, td, tq))
print 'row: %d col: %d' % (row, col/row)
return diff
if __name__ == '__main__':
atm = ATM()
tm_model = TranslationModel()
i_tm = tm_model.getTM_dict()
atm.train(i_tm, 500, 1e-5)
atm.writeModel()
| ajibawa-2023/Python-Code-Large/train/row_99978 | 144 | 175 | 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_99978:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 6], "level": 0, "parent": null, "vector": [8, 0, 0.02, 0.0343, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "'''\nprerequisite:\n1) allocate the term-id and doc-id;\n2) build a language model for each passage (fixed window)\n3) get an initialed translation model\n'''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:ImportFrom_L7_C0", "label": "from ML import ML", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.04, 0.0057, 0, 0.66, 0.1, 455, 0, 1, 0, 0, 455, 0, 0], "semantic": {"name": "ML", "arg_names": [], "import_names": ["ML"], "rhs_call_name": "", "annotation": ""}, "snippet": "from ML import ML"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:ImportFrom_L8_C0", "label": "from QueryManager import QueryManager", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0457, 0.0057, 0, 0.66, 0.2, 95, 0, 1, 0, 0, 95, 0, 0], "semantic": {"name": "QueryManager", "arg_names": [], "import_names": ["QueryManager"], "rhs_call_name": "", "annotation": ""}, "snippet": "from QueryManager import QueryManager"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:ImportFrom_L9_C0", "label": "from Query import Query", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0514, 0.0057, 0, 0.66, 0.3, 279, 0, 1, 0, 0, 279, 0, 0], "semantic": {"name": "Query", "arg_names": [], "import_names": ["Query"], "rhs_call_name": "", "annotation": ""}, "snippet": "from Query import Query"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:ImportFrom_L10_C0", "label": "from Lexicon import Lexicon", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0571, 0.0057, 0, 0.66, 0.4, 16, 0, 1, 0, 0, 16, 0, 0], "semantic": {"name": "Lexicon", "arg_names": [], "import_names": ["Lexicon"], "rhs_call_name": "", "annotation": ""}, "snippet": "from Lexicon import Lexicon"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:ImportFrom_L11_C0", "label": "from TranslationModel import TranslationModel", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0629, 0.0057, 0, 0.66, 0.5, 753, 0, 1, 0, 0, 753, 0, 0], "semantic": {"name": "TranslationModel", "arg_names": [], "import_names": ["TranslationModel"], "rhs_call_name": "", "annotation": ""}, "snippet": "from TranslationModel import TranslationModel"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:ImportFrom_L12_C0", "label": "from time import clock", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.0686, 0.0057, 0, 0.66, 0.6, 654, 0, 1, 0, 0, 654, 0, 0], "semantic": {"name": "time", "arg_names": [], "import_names": ["clock"], "rhs_call_name": "", "annotation": ""}, "snippet": "from time import clock"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:ImportFrom_L13_C0", "label": "from DictUtils import *", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.0743, 0.0057, 0, 0.66, 0.7, 355, 0, 1, 0, 0, 355, 0, 0], "semantic": {"name": "DictUtils", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from DictUtils import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L15_C0", "label": "printModel", "type": "function", "loc": [15, 20], "level": 0, "parent": null, "vector": [2, 0, 0.1, 0.0343, 0, 0.66, 0.8, 133, 0, 1, 0, 0, 0, 0, 6], "semantic": {"name": "printModel", "arg_names": ["dic"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def printModel(dic):\n\tfor key in dic.keys():\n\t\tline = str(key) + ' '\n\t\tfor k2 in dic[key].keys():\n\t\t\tline = line + str(k2) + ':' + str(dic[key][k2])\n\t\t\tprint(line)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L16_C1", "label": "for key", "type": "for", "loc": [16, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L15_C0", "vector": [6, 1, 0.1029, 0.0286, 1, 0.95, 0.0, 230, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "key", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tfor key in dic.keys():\n\t\tline = str(key) + ' '\n\t\tfor k2 in dic[key].keys():\n\t\t\tline = line + str(k2) + ':' + str(dic[key][k2])\n\t\t\tprint(line)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L17_C2", "label": "line =", "type": "assigned_variable", "loc": [17, 17], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L16_C1", "vector": [14, 2, 0.0971, 0.0057, 2, 0.71, 0.0, 373, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "line", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tline = str(key) + ' '"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L18_C2", "label": "for k2", "type": "for", "loc": [18, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L16_C1", "vector": [6, 2, 0.1086, 0.0171, 2, 0.71, 1.0, 482, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "k2", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor k2 in dic[key].keys():\n\t\t\tline = line + str(k2) + ':' + str(dic[key][k2])\n\t\t\tprint(line)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L19_C3", "label": "line =", "type": "assigned_variable", "loc": [19, 19], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L18_C2", "vector": [14, 3, 0.1086, 0.0057, 3, 0.91, 0.0, 373, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "line", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tline = line + str(k2) + ':' + str(dic[key][k2])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Expr_L20_C3", "label": "print()", "type": "expression", "loc": [20, 20], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L18_C2", "vector": [8, 3, 0.1143, 0.0057, 3, 0.91, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\t\t\tprint(line)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:ClassDef_L21_C0", "label": "ATM", "type": "class", "loc": [21, 168], "level": 0, "parent": null, "vector": [3, 0, 0.54, 0.8457, 0, 0.66, 0.9, 532, 0, 10, 0, 0, 0, 0, 84], "semantic": {"name": "ATM", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ATM: # aligned translation model\n\t'''\n\tEM algorithm for training:\n\tqd_reader: a reader for query-doc pair;\n\tinit_tm:\n\t'''\n\tdef train(self, init_tm, iterate_num, model_diff):\n\t\tprev_global_translation = init_tm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Expr_L22_C1", "label": "expression", "type": "expression", "loc": [22, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:ClassDef_L21_C0", "vector": [8, 1, 0.1371, 0.0286, 1, 0.98, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t'''\n\tEM algorithm for training:\n\tqd_reader: a reader for query-doc pair;\n\tinit_tm:\n\t'''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L27_C1", "label": "train", "type": "function", "loc": [27, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:ClassDef_L21_C0", "vector": [2, 1, 0.2657, 0.2286, 1, 0.98, 0.1, 371, 0, 4, 0, 0, 0, 0, 28], "semantic": {"name": "train", "arg_names": ["self", "init_tm", "iterate_num", "model_diff"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef train(self, init_tm, iterate_num, model_diff):\n\t\tprev_global_translation = init_tm\n\t\tqm = QueryManager()\n\t\tqm.load()\n\t\tquery_count = 100 #test for 1000 queries\n\t\tlexicon = Lexicon()\n\t\tlexicon.load()\n\t\tfor i in xrange(iterate_num):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L28_C2", "label": "prev_global_translation =", "type": "assigned_variable", "loc": [28, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L27_C1", "vector": [14, 2, 0.16, 0.0057, 2, 0.5, 0.0, 892, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "prev_global_translation", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tprev_global_translation = init_tm"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L29_C2", "label": "qm = QueryManager()", "type": "assigned_variable", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L27_C1", "vector": [14, 2, 0.1657, 0.0057, 2, 0.5, 0.1429, 861, 3, 0, 0, 0, 95, 10, 1], "semantic": {"name": "qm", "arg_names": [], "import_names": [], "rhs_call_name": "QueryManager", "annotation": ""}, "snippet": "\t\tqm = QueryManager()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Expr_L30_C2", "label": "load()", "type": "expression", "loc": [30, 30], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L27_C1", "vector": [8, 2, 0.1714, 0.0057, 2, 0.5, 0.2857, 37, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "load", "arg_names": [], "import_names": [], "rhs_call_name": "load", "annotation": ""}, "snippet": "\t\tqm.load()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L31_C2", "label": "query_count =", "type": "assigned_variable", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L27_C1", "vector": [14, 2, 0.1771, 0.0057, 2, 0.5, 0.4286, 435, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "query_count", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tquery_count = 100 #test for 1000 queries"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L32_C2", "label": "lexicon = Lexicon()", "type": "assigned_variable", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L27_C1", "vector": [14, 2, 0.1829, 0.0057, 2, 0.5, 0.5714, 675, 3, 0, 0, 0, 16, 10, 1], "semantic": {"name": "lexicon", "arg_names": [], "import_names": [], "rhs_call_name": "Lexicon", "annotation": ""}, "snippet": "\t\tlexicon = Lexicon()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Expr_L33_C2", "label": "load()", "type": "expression", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L27_C1", "vector": [8, 2, 0.1886, 0.0057, 2, 0.5, 0.7143, 37, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "load", "arg_names": [], "import_names": [], "rhs_call_name": "load", "annotation": ""}, "snippet": "\t\tlexicon.load()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L34_C2", "label": "for i", "type": "for", "loc": [34, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L27_C1", "vector": [6, 2, 0.2829, 0.1829, 2, 0.5, 0.8571, 826, 3, 0, 0, 0, 0, 0, 24], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor i in xrange(iterate_num):\n\t\t\tt1 = clock()\n\t\t\tprint('Iterate %d model :' % (i+1))\n#\t\t\tprintModel(prev_global_translation)\n\t\t\tglobal_translation = {}\n\t\t\tfor query_index in xrange(query_count):\n\t\t\t\tquery = qm.getQuery(query_index)\n\t\t\t\tq = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L35_C3", "label": "t1 = clock()", "type": "assigned_variable", "loc": [35, 35], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L34_C2", "vector": [14, 3, 0.2, 0.0057, 3, 0.52, 0.0, 329, 3, 0, 0, 0, 937, 10, 1], "semantic": {"name": "t1", "arg_names": [], "import_names": [], "rhs_call_name": "clock", "annotation": ""}, "snippet": "\t\t\tt1 = clock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Expr_L36_C3", "label": "print()", "type": "expression", "loc": [36, 36], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L34_C2", "vector": [8, 3, 0.2057, 0.0057, 3, 0.52, 0.1, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\t\t\tprint('Iterate %d model :' % (i+1))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L38_C3", "label": "global_translation =", "type": "assigned_variable", "loc": [38, 38], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L34_C2", "vector": [14, 3, 0.2171, 0.0057, 3, 0.52, 0.2, 645, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "global_translation", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tglobal_translation = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L39_C3", "label": "for query_index", "type": "for", "loc": [39, 57], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L34_C2", "vector": [6, 3, 0.2743, 0.1086, 3, 0.52, 0.3, 790, 3, 0, 0, 0, 0, 0, 16], "semantic": {"name": "query_index", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tfor query_index in xrange(query_count):\n\t\t\t\tquery = qm.getQuery(query_index)\n\t\t\t\tq = []\n\t\t\t\tfor term in query.getQuery().split():\n\t\t\t\t\tq.append(lexicon.getIdByTerm(term))\n\t\t\t\tdoc = ML(str(query.getAnsdoc()))\n\t\t\t\tpassage_models = doc.getPassageModels()\n\t\t\t\tpassage_scores = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L40_C4", "label": "query = getQuery()", "type": "assigned_variable", "loc": [40, 40], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L39_C3", "vector": [14, 4, 0.2286, 0.0057, 4, 0.95, 0.0, 546, 3, 1, 0, 0, 369, 10, 1], "semantic": {"name": "query", "arg_names": [], "import_names": [], "rhs_call_name": "getQuery", "annotation": ""}, "snippet": "\t\t\t\tquery = qm.getQuery(query_index)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L41_C4", "label": "q =", "type": "assigned_variable", "loc": [41, 41], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L39_C3", "vector": [14, 4, 0.2343, 0.0057, 4, 0.95, 0.1, 516, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "q", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tq = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L42_C4", "label": "for term", "type": "for", "loc": [42, 43], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L39_C3", "vector": [6, 4, 0.2429, 0.0114, 4, 0.95, 0.2, 645, 3, 0, 0, 0, 0, 0, 4], "semantic": {"name": "term", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tfor term in query.getQuery().split():\n\t\t\t\t\tq.append(lexicon.getIdByTerm(term))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Expr_L43_C5", "label": "append()", "type": "expression", "loc": [43, 43], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L42_C4", "vector": [8, 5, 0.2457, 0.0057, 5, 0.39, 0.0, 243, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": "\t\t\t\t\tq.append(lexicon.getIdByTerm(term))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L44_C4", "label": "doc = ML()", "type": "assigned_variable", "loc": [44, 44], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L39_C3", "vector": [14, 4, 0.2514, 0.0057, 4, 0.95, 0.3, 555, 3, 1, 0, 0, 455, 10, 3], "semantic": {"name": "doc", "arg_names": [], "import_names": [], "rhs_call_name": "ML", "annotation": ""}, "snippet": "\t\t\t\tdoc = ML(str(query.getAnsdoc()))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L45_C4", "label": "passage_models = getPassageModels()", "type": "assigned_variable", "loc": [45, 45], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L39_C3", "vector": [14, 4, 0.2571, 0.0057, 4, 0.95, 0.4, 838, 3, 0, 0, 0, 974, 10, 1], "semantic": {"name": "passage_models", "arg_names": [], "import_names": [], "rhs_call_name": "getPassageModels", "annotation": ""}, "snippet": "\t\t\t\tpassage_models = doc.getPassageModels()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L46_C4", "label": "passage_scores =", "type": "assigned_variable", "loc": [46, 46], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L39_C3", "vector": [14, 4, 0.2629, 0.0057, 4, 0.95, 0.5, 900, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "passage_scores", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tpassage_scores = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L47_C4", "label": "passage_translations =", "type": "assigned_variable", "loc": [47, 47], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L39_C3", "vector": [14, 4, 0.2686, 0.0057, 4, 0.95, 0.6, 637, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "passage_translations", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tpassage_translations = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L48_C4", "label": "for lm", "type": "for", "loc": [48, 52], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L39_C3", "vector": [6, 4, 0.2857, 0.0286, 4, 0.95, 0.7, 376, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "lm", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tfor lm in passage_models:\n#\t\t\t\t\tt3 = clock()\n\t\t\t\t\tpassage_score, passage_translation = self.passage_score(q, lm, prev_global_translation)\n\t\t\t\t\tpassage_scores.append(passage_score)\n\t\t\t\t\tpassage_translations.append(passage_translation)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L50_C5", "label": "passage_score, passage_translation = passage_score()", "type": "assigned_variable", "loc": [50, 50], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L48_C4", "vector": [14, 5, 0.2857, 0.0057, 5, 0.53, 0.0, 91, 3, 3, 0, 0, 805, 10, 1], "semantic": {"name": "passage_score, passage_translation", "arg_names": [], "import_names": [], "rhs_call_name": "passage_score", "annotation": ""}, "snippet": "\t\t\t\t\tpassage_score, passage_translation = self.passage_score(q, lm, prev_global_translation)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Expr_L51_C5", "label": "append()", "type": "expression", "loc": [51, 51], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L48_C4", "vector": [8, 5, 0.2914, 0.0057, 5, 0.53, 0.5, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": "\t\t\t\t\tpassage_scores.append(passage_score)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Expr_L52_C5", "label": "append()", "type": "expression", "loc": [52, 52], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L48_C4", "vector": [8, 5, 0.2971, 0.0057, 5, 0.53, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": "\t\t\t\t\tpassage_translations.append(passage_translation)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Expr_L55_C4", "label": "passage_norm()", "type": "expression", "loc": [55, 55], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L39_C3", "vector": [8, 4, 0.3143, 0.0057, 4, 0.95, 0.8, 426, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "passage_norm", "arg_names": [], "import_names": [], "rhs_call_name": "passage_norm", "annotation": ""}, "snippet": "\t\t\t\tself.passage_norm(passage_scores)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L56_C4", "label": "doc_translation = doc_translation_norm()", "type": "assigned_variable", "loc": [56, 56], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L39_C3", "vector": [14, 4, 0.32, 0.0057, 4, 0.95, 0.9, 860, 3, 2, 0, 0, 560, 10, 1], "semantic": {"name": "doc_translation", "arg_names": [], "import_names": [], "rhs_call_name": "doc_translation_norm", "annotation": ""}, "snippet": "\t\t\t\tdoc_translation = self.doc_translation_norm(passage_translations, passage_scores)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Expr_L57_C4", "label": "update_translation()", "type": "expression", "loc": [57, 57], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L39_C3", "vector": [8, 4, 0.3257, 0.0057, 4, 0.95, 1.0, 337, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "update_translation", "arg_names": [], "import_names": [], "rhs_call_name": "update_translation", "annotation": ""}, "snippet": "\t\t\t\tself.update_translation(global_translation, doc_translation)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Expr_L58_C3", "label": "translation_norm()", "type": "expression", "loc": [58, 58], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L34_C2", "vector": [8, 3, 0.3314, 0.0057, 3, 0.52, 0.4, 447, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "translation_norm", "arg_names": [], "import_names": [], "rhs_call_name": "translation_norm", "annotation": ""}, "snippet": "\t\t\tself.translation_norm(global_translation)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L59_C3", "label": "error = compare()", "type": "assigned_variable", "loc": [59, 59], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L34_C2", "vector": [14, 3, 0.3371, 0.0057, 3, 0.52, 0.5, 771, 3, 2, 0, 0, 383, 10, 1], "semantic": {"name": "error", "arg_names": [], "import_names": [], "rhs_call_name": "compare", "annotation": ""}, "snippet": "\t\t\terror = self.compare(prev_global_translation, global_translation)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Expr_L60_C3", "label": "print()", "type": "expression", "loc": [60, 60], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L34_C2", "vector": [8, 3, 0.3429, 0.0057, 3, 0.52, 0.6, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\t\t\tprint('Iterate %d error %f .' % (i+1, error))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:If_L61_C3", "label": "if", "type": "if", "loc": [61, 62], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L34_C2", "vector": [4, 3, 0.3514, 0.0114, 3, 0.52, 0.7, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif(error < model_diff):\n\t\t\t\tbreak;"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L63_C3", "label": "prev_global_translation =", "type": "assigned_variable", "loc": [63, 63], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L34_C2", "vector": [14, 3, 0.36, 0.0057, 3, 0.52, 0.8, 892, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "prev_global_translation", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tprev_global_translation = global_translation;"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L64_C3", "label": "t2 = clock()", "type": "assigned_variable", "loc": [64, 64], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L34_C2", "vector": [14, 3, 0.3657, 0.0057, 3, 0.52, 0.9, 469, 3, 0, 0, 0, 937, 10, 1], "semantic": {"name": "t2", "arg_names": [], "import_names": [], "rhs_call_name": "clock", "annotation": ""}, "snippet": "\t\t\tt2 = clock()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Expr_L65_C3", "label": "print()", "type": "expression", "loc": [65, 65], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L34_C2", "vector": [8, 3, 0.3714, 0.0057, 3, 0.52, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\t\t\tprint('Iterate %d cost %f s' % (i+1, t2-t1))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L66_C2", "label": "self.model =", "type": "assigned_variable", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L27_C1", "vector": [14, 2, 0.3771, 0.0057, 2, 0.5, 1.0, 81, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.model", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.model = global_translation"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L68_C1", "label": "writeModel", "type": "function", "loc": [68, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:ClassDef_L21_C0", "vector": [2, 1, 0.4114, 0.0514, 1, 0.98, 0.2, 319, 0, 1, 0, 0, 0, 0, 8], "semantic": {"name": "writeModel", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef writeModel(self):\n\t\tf = open('EM_TM_path', 'w')#test path\n\t\tfor td in self.model.keys():\n\t\t\tline = str(td) + ' '\n\t\t\tfor tq in self.model[td].keys():\n\t\t\t\tline = line + str(tq) + ':' + str(self.model[td][tq]) + ' '\n\t\t\tline = line + '\\n'\n\t\t\tf.write(line)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L69_C2", "label": "f = open()", "type": "assigned_variable", "loc": [69, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L68_C1", "vector": [14, 2, 0.3943, 0.0057, 2, 0.26, 0.0, 899, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": "\t\tf = open('EM_TM_path', 'w')#test path"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L70_C2", "label": "for td", "type": "for", "loc": [70, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L68_C1", "vector": [6, 2, 0.4143, 0.0343, 2, 0.26, 0.5, 102, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "td", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor td in self.model.keys():\n\t\t\tline = str(td) + ' '\n\t\t\tfor tq in self.model[td].keys():\n\t\t\t\tline = line + str(tq) + ':' + str(self.model[td][tq]) + ' '\n\t\t\tline = line + '\\n'\n\t\t\tf.write(line)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L71_C3", "label": "line =", "type": "assigned_variable", "loc": [71, 71], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L70_C2", "vector": [14, 3, 0.4057, 0.0057, 3, 0.36, 0.0, 373, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "line", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tline = str(td) + ' '"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L72_C3", "label": "for tq", "type": "for", "loc": [72, 73], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L70_C2", "vector": [6, 3, 0.4143, 0.0114, 3, 0.36, 0.3333, 470, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "tq", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tfor tq in self.model[td].keys():\n\t\t\t\tline = line + str(tq) + ':' + str(self.model[td][tq]) + ' '"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L73_C4", "label": "line =", "type": "assigned_variable", "loc": [73, 73], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L72_C3", "vector": [14, 4, 0.4171, 0.0057, 4, 0.57, 0.0, 373, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "line", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tline = line + str(tq) + ':' + str(self.model[td][tq]) + ' '"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L74_C3", "label": "line =", "type": "assigned_variable", "loc": [74, 74], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L70_C2", "vector": [14, 3, 0.4229, 0.0057, 3, 0.36, 0.6667, 373, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "line", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tline = line + '\\n'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Expr_L75_C3", "label": "write()", "type": "expression", "loc": [75, 75], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L70_C2", "vector": [8, 3, 0.4286, 0.0057, 3, 0.36, 1.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": "\t\t\tf.write(line)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Expr_L76_C2", "label": "close()", "type": "expression", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L68_C1", "vector": [8, 2, 0.4343, 0.0057, 2, 0.26, 1.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": "\t\tf.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L78_C1", "label": "load", "type": "function", "loc": [78, 89], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:ClassDef_L21_C0", "vector": [2, 1, 0.4771, 0.0686, 1, 0.98, 0.3, 37, 0, 1, 0, 0, 0, 0, 10], "semantic": {"name": "load", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef load(self):\n\t\tf = open(EM_TM_path, 'r')\n\t\tself.model = {}\n\t\tlines = f.readlines()\n\t\tf.close()\n\t\tfor line in lines:\n\t\t\titems = line.split()\n\t\t\ttd = int(items[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L79_C2", "label": "f = open()", "type": "assigned_variable", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L78_C1", "vector": [14, 2, 0.4514, 0.0057, 2, 0.72, 0.0, 899, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": "\t\tf = open(EM_TM_path, 'r')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L80_C2", "label": "self.model =", "type": "assigned_variable", "loc": [80, 80], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L78_C1", "vector": [14, 2, 0.4571, 0.0057, 2, 0.72, 0.25, 81, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.model", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.model = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L81_C2", "label": "lines = readlines()", "type": "assigned_variable", "loc": [81, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L78_C1", "vector": [14, 2, 0.4629, 0.0057, 2, 0.72, 0.5, 73, 3, 0, 0, 0, 841, 10, 1], "semantic": {"name": "lines", "arg_names": [], "import_names": [], "rhs_call_name": "readlines", "annotation": ""}, "snippet": "\t\tlines = f.readlines()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Expr_L82_C2", "label": "close()", "type": "expression", "loc": [82, 82], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L78_C1", "vector": [8, 2, 0.4686, 0.0057, 2, 0.72, 0.75, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": "\t\tf.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L83_C2", "label": "for line", "type": "for", "loc": [83, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L78_C1", "vector": [6, 2, 0.4914, 0.04, 2, 0.72, 1.0, 373, 2, 0, 0, 0, 0, 0, 7], "semantic": {"name": "line", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor line in lines:\n\t\t\titems = line.split()\n\t\t\ttd = int(items[0])\n\t\t\tfor item in items[1:]:\n\t\t\t\ttq = int(item.split(':')[0])\n\t\t\t\tvalue = float(item.split(':')[1])\n\t\t\t\taddElement_twolevel(self.model, td, tq ,value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L84_C3", "label": "items = split()", "type": "assigned_variable", "loc": [84, 84], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L83_C2", "vector": [14, 3, 0.48, 0.0057, 3, 0.47, 0.0, 339, 3, 0, 0, 0, 908, 10, 1], "semantic": {"name": "items", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": "\t\t\titems = line.split()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L85_C3", "label": "td = int()", "type": "assigned_variable", "loc": [85, 85], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L83_C2", "vector": [14, 3, 0.4857, 0.0057, 3, 0.47, 0.5, 102, 3, 1, 0, 0, 901, 10, 1], "semantic": {"name": "td", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": "\t\t\ttd = int(items[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L86_C3", "label": "for item", "type": "for", "loc": [86, 89], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L83_C2", "vector": [6, 3, 0.5, 0.0229, 3, 0.47, 1.0, 434, 6, 0, 0, 0, 0, 0, 5], "semantic": {"name": "item", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tfor item in items[1:]:\n\t\t\t\ttq = int(item.split(':')[0])\n\t\t\t\tvalue = float(item.split(':')[1])\n\t\t\t\taddElement_twolevel(self.model, td, tq ,value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L87_C4", "label": "tq = int()", "type": "assigned_variable", "loc": [87, 87], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L86_C3", "vector": [14, 4, 0.4971, 0.0057, 4, 0.27, 0.0, 470, 3, 1, 0, 0, 901, 10, 2], "semantic": {"name": "tq", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": "\t\t\t\ttq = int(item.split(':')[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L88_C4", "label": "value = float()", "type": "assigned_variable", "loc": [88, 88], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L86_C3", "vector": [14, 4, 0.5029, 0.0057, 4, 0.27, 0.5, 441, 3, 1, 0, 0, 639, 10, 2], "semantic": {"name": "value", "arg_names": [], "import_names": [], "rhs_call_name": "float", "annotation": ""}, "snippet": "\t\t\t\tvalue = float(item.split(':')[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Expr_L89_C4", "label": "addElement_twolevel()", "type": "expression", "loc": [89, 89], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L86_C3", "vector": [8, 4, 0.5086, 0.0057, 4, 0.27, 1.0, 619, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "addElement_twolevel", "arg_names": [], "import_names": [], "rhs_call_name": "addElement_twolevel", "annotation": ""}, "snippet": "\t\t\t\taddElement_twolevel(self.model, td, tq ,value)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L90_C1", "label": "getProb", "type": "function", "loc": [90, 91], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:ClassDef_L21_C0", "vector": [2, 1, 0.5171, 0.0114, 1, 0.98, 0.4, 528, 0, 3, 1, 0, 0, 0, 1], "semantic": {"name": "getProb", "arg_names": ["self", "td", "tq"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef getProb(self, td, tq):\n\t\treturn getElement_twolevel(self.model, td, tq)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Return_L91_C2", "label": "return", "type": "return", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L90_C1", "vector": [13, 2, 0.52, 0.0057, 2, 0.7, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn getElement_twolevel(self.model, td, tq)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L93_C1", "label": "passage_score", "type": "function", "loc": [93, 110], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:ClassDef_L21_C0", "vector": [2, 1, 0.58, 0.1029, 1, 0.98, 0.5, 805, 0, 4, 1, 0, 0, 0, 4], "semantic": {"name": "passage_score", "arg_names": ["self", "q", "lm", "ptm"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef passage_score(self, q, lm, ptm):\n\t\tscore = 1.0\n\t\ttranslation = {}\n\t\tfor td in lm.keys():\n\t\t\ttranslation[td] = {}\n\t\tfor tq in q:\n\t\t\tk_score = 0.0\n\t\t\tfor td in lm.keys():"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L94_C2", "label": "score =", "type": "assigned_variable", "loc": [94, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L93_C1", "vector": [14, 2, 0.5371, 0.0057, 2, 0.61, 0.0, 34, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "score", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tscore = 1.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L95_C2", "label": "translation =", "type": "assigned_variable", "loc": [95, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L93_C1", "vector": [14, 2, 0.5429, 0.0057, 2, 0.61, 0.25, 50, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "translation", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\ttranslation = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L96_C2", "label": "for td", "type": "for", "loc": [96, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L93_C1", "vector": [6, 2, 0.5514, 0.0114, 2, 0.61, 0.5, 102, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "td", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor td in lm.keys():\n\t\t\ttranslation[td] = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L97_C3", "label": "assign", "type": "assigned_variable", "loc": [97, 97], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L96_C2", "vector": [14, 3, 0.5543, 0.0057, 3, 0.19, 0.0, 0, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\ttranslation[td] = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L98_C2", "label": "for tq", "type": "for", "loc": [98, 109], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L93_C1", "vector": [6, 2, 0.5914, 0.0686, 2, 0.61, 0.75, 470, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "tq", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor tq in q:\n\t\t\tk_score = 0.0\n\t\t\tfor td in lm.keys():\n\t\t\t\tif td == 0:\n\t\t\t\t\tcontinue\n\t\t\t\tp1 = getElement_twolevel(ptm, td, tq)\n\t\t\t\tp2 = getElement_onelevel(lm, td)\n\t\t\t\tif p1 * p2 == 0:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L99_C3", "label": "k_score =", "type": "assigned_variable", "loc": [99, 99], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L98_C2", "vector": [14, 3, 0.5657, 0.0057, 3, 0.7, 0.0, 413, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "k_score", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tk_score = 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L100_C3", "label": "for td", "type": "for", "loc": [100, 108], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L98_C2", "vector": [6, 3, 0.5943, 0.0514, 3, 0.7, 0.5, 102, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "td", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tfor td in lm.keys():\n\t\t\t\tif td == 0:\n\t\t\t\t\tcontinue\n\t\t\t\tp1 = getElement_twolevel(ptm, td, tq)\n\t\t\t\tp2 = getElement_onelevel(lm, td)\n\t\t\t\tif p1 * p2 == 0:\n\t\t\t\t\tcontinue\n\t\t\t\ttranslation[td][tq] = p1 * p2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:If_L101_C4", "label": "if", "type": "if", "loc": [101, 102], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L100_C3", "vector": [4, 4, 0.58, 0.0114, 4, 0.82, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tif td == 0:\n\t\t\t\t\tcontinue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L103_C4", "label": "p1 = getElement_twolevel()", "type": "assigned_variable", "loc": [103, 103], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L100_C3", "vector": [14, 4, 0.5886, 0.0057, 4, 0.82, 0.2, 87, 3, 3, 0, 0, 516, 10, 1], "semantic": {"name": "p1", "arg_names": [], "import_names": [], "rhs_call_name": "getElement_twolevel", "annotation": ""}, "snippet": "\t\t\t\tp1 = getElement_twolevel(ptm, td, tq)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L104_C4", "label": "p2 = getElement_onelevel()", "type": "assigned_variable", "loc": [104, 104], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L100_C3", "vector": [14, 4, 0.5943, 0.0057, 4, 0.82, 0.4, 843, 3, 2, 0, 0, 369, 10, 1], "semantic": {"name": "p2", "arg_names": [], "import_names": [], "rhs_call_name": "getElement_onelevel", "annotation": ""}, "snippet": "\t\t\t\tp2 = getElement_onelevel(lm, td)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:If_L105_C4", "label": "if", "type": "if", "loc": [105, 106], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L100_C3", "vector": [4, 4, 0.6029, 0.0114, 4, 0.82, 0.6, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tif p1 * p2 == 0:\n\t\t\t\t\tcontinue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L107_C4", "label": "assign", "type": "assigned_variable", "loc": [107, 107], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L100_C3", "vector": [14, 4, 0.6114, 0.0057, 4, 0.82, 0.8, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\ttranslation[td][tq] = p1 * p2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L108_C4", "label": "k_score =", "type": "assigned_variable", "loc": [108, 108], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L100_C3", "vector": [14, 4, 0.6171, 0.0057, 4, 0.82, 1.0, 413, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "k_score", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tk_score = k_score + p1 * p2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L109_C3", "label": "score =", "type": "assigned_variable", "loc": [109, 109], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L98_C2", "vector": [14, 3, 0.6229, 0.0057, 3, 0.7, 1.0, 34, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "score", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tscore = score * k_score"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Return_L110_C2", "label": "return", "type": "return", "loc": [110, 110], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L93_C1", "vector": [13, 2, 0.6286, 0.0057, 2, 0.61, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn (score, translation)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L112_C1", "label": "passage_norm", "type": "function", "loc": [112, 119], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:ClassDef_L21_C0", "vector": [2, 1, 0.66, 0.0457, 1, 0.98, 0.6, 426, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "passage_norm", "arg_names": ["self", "passage_scores"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef passage_norm(self, passage_scores):\n\t\tdenominator = 0.0\n\t\tfor score in passage_scores:\n\t\t\tdenominator = denominator + score\n\t\tif denominator == 0:\n\t\t\treturn\n\t\tfor i in xrange(len(passage_scores)):\n\t\t\tpassage_scores[i] = passage_scores[i] / denominator"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L113_C2", "label": "denominator =", "type": "assigned_variable", "loc": [113, 113], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L112_C1", "vector": [14, 2, 0.6457, 0.0057, 2, 0.7, 0.0, 108, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "denominator", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tdenominator = 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L114_C2", "label": "for score", "type": "for", "loc": [114, 115], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L112_C1", "vector": [6, 2, 0.6543, 0.0114, 2, 0.7, 0.3333, 34, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "score", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor score in passage_scores:\n\t\t\tdenominator = denominator + score"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L115_C3", "label": "denominator =", "type": "assigned_variable", "loc": [115, 115], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L114_C2", "vector": [14, 3, 0.6571, 0.0057, 3, 0.09, 0.0, 108, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "denominator", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tdenominator = denominator + score"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:If_L116_C2", "label": "if", "type": "if", "loc": [116, 117], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L112_C1", "vector": [4, 2, 0.6657, 0.0114, 2, 0.7, 0.6667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif denominator == 0:\n\t\t\treturn"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Return_L117_C3", "label": "return", "type": "return", "loc": [117, 117], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:If_L116_C2", "vector": [13, 3, 0.6686, 0.0057, 3, 0.22, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\treturn"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L118_C2", "label": "for i", "type": "for", "loc": [118, 119], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L112_C1", "vector": [6, 2, 0.6771, 0.0114, 2, 0.7, 1.0, 826, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "i", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor i in xrange(len(passage_scores)):\n\t\t\tpassage_scores[i] = passage_scores[i] / denominator"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L119_C3", "label": "assign", "type": "assigned_variable", "loc": [119, 119], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L118_C2", "vector": [14, 3, 0.68, 0.0057, 3, 0.01, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tpassage_scores[i] = passage_scores[i] / denominator"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L121_C1", "label": "doc_translation_norm", "type": "function", "loc": [121, 135], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:ClassDef_L21_C0", "vector": [2, 1, 0.7314, 0.0857, 1, 0.98, 0.7, 560, 0, 3, 1, 0, 0, 0, 7], "semantic": {"name": "doc_translation_norm", "arg_names": ["self", "passage_translations", "passage_scores"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef doc_translation_norm(self, passage_translations, passage_scores):\n\t\tdoc_translation = {}\n\t\tfor k in xrange(len(passage_scores)):\n\t\t\tif passage_scores[k] == 0:\n\t\t\t\tcontinue\n\t\t\tfor td in passage_translations[k].keys():\n\t\t\t\tfor tq in passage_translations[k][td].keys():\n\t\t\t\t\taddElement_twolevel(doc_translation, tq, td, passage_scores[k] * passage_translations[k][td][tq])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L122_C2", "label": "doc_translation =", "type": "assigned_variable", "loc": [122, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L121_C1", "vector": [14, 2, 0.6971, 0.0057, 2, 0.15, 0.0, 860, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "doc_translation", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tdoc_translation = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L123_C2", "label": "for k", "type": "for", "loc": [123, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L121_C1", "vector": [6, 2, 0.7171, 0.0343, 2, 0.15, 0.3333, 954, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor k in xrange(len(passage_scores)):\n\t\t\tif passage_scores[k] == 0:\n\t\t\t\tcontinue\n\t\t\tfor td in passage_translations[k].keys():\n\t\t\t\tfor tq in passage_translations[k][td].keys():\n\t\t\t\t\taddElement_twolevel(doc_translation, tq, td, passage_scores[k] * passage_translations[k][td][tq])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:If_L124_C3", "label": "if", "type": "if", "loc": [124, 125], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L123_C2", "vector": [4, 3, 0.7114, 0.0114, 3, 0.01, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif passage_scores[k] == 0:\n\t\t\t\tcontinue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L126_C3", "label": "for td", "type": "for", "loc": [126, 128], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L123_C2", "vector": [6, 3, 0.7257, 0.0171, 3, 0.01, 1.0, 102, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "td", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tfor td in passage_translations[k].keys():\n\t\t\t\tfor tq in passage_translations[k][td].keys():\n\t\t\t\t\taddElement_twolevel(doc_translation, tq, td, passage_scores[k] * passage_translations[k][td][tq])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L127_C4", "label": "for tq", "type": "for", "loc": [127, 128], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L126_C3", "vector": [6, 4, 0.7286, 0.0114, 4, 0.07, 0.0, 470, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "tq", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tfor tq in passage_translations[k][td].keys():\n\t\t\t\t\taddElement_twolevel(doc_translation, tq, td, passage_scores[k] * passage_translations[k][td][tq])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Expr_L128_C5", "label": "addElement_twolevel()", "type": "expression", "loc": [128, 128], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L127_C4", "vector": [8, 5, 0.7314, 0.0057, 5, 0.8, 0.0, 619, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "addElement_twolevel", "arg_names": [], "import_names": [], "rhs_call_name": "addElement_twolevel", "annotation": ""}, "snippet": "\t\t\t\t\taddElement_twolevel(doc_translation, tq, td, passage_scores[k] * passage_translations[k][td][tq])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L129_C2", "label": "for tq", "type": "for", "loc": [129, 134], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L121_C1", "vector": [6, 2, 0.7514, 0.0343, 2, 0.15, 0.6667, 470, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "tq", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor tq in doc_translation.keys():\n\t\t\tfor td in doc_translation[tq].keys():\n\t\t\t\tif td == 0:\n\t\t\t\t\tcontinue #Remember not do normalization to 0th element\n\t\t\t\tdoc_translation[tq][td] = doc_translation[tq][td] / doc_translation[tq][0]\n\t\t\tdoc_translation[tq][0] = 1.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L130_C3", "label": "for td", "type": "for", "loc": [130, 133], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L129_C2", "vector": [6, 3, 0.7514, 0.0229, 3, 0.67, 0.0, 102, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "td", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tfor td in doc_translation[tq].keys():\n\t\t\t\tif td == 0:\n\t\t\t\t\tcontinue #Remember not do normalization to 0th element\n\t\t\t\tdoc_translation[tq][td] = doc_translation[tq][td] / doc_translation[tq][0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:If_L131_C4", "label": "if", "type": "if", "loc": [131, 132], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L130_C3", "vector": [4, 4, 0.7514, 0.0114, 4, 0.02, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tif td == 0:\n\t\t\t\t\tcontinue #Remember not do normalization to 0th element"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L133_C4", "label": "assign", "type": "assigned_variable", "loc": [133, 133], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L130_C3", "vector": [14, 4, 0.76, 0.0057, 4, 0.02, 1.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tdoc_translation[tq][td] = doc_translation[tq][td] / doc_translation[tq][0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L134_C3", "label": "assign", "type": "assigned_variable", "loc": [134, 134], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L129_C2", "vector": [14, 3, 0.7657, 0.0057, 3, 0.67, 1.0, 0, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tdoc_translation[tq][0] = 1.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Return_L135_C2", "label": "return", "type": "return", "loc": [135, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L121_C1", "vector": [13, 2, 0.7714, 0.0057, 2, 0.15, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn doc_translation"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L137_C1", "label": "update_translation", "type": "function", "loc": [137, 142], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:ClassDef_L21_C0", "vector": [2, 1, 0.7971, 0.0343, 1, 0.98, 0.8, 337, 0, 3, 0, 0, 0, 0, 3], "semantic": {"name": "update_translation", "arg_names": ["self", "global_translation", "doc_translation"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef update_translation(self, global_translation, doc_translation):\n\t\tfor tq in doc_translation.keys():\n\t\t\tfor td in doc_translation[tq].keys():\n\t\t\t\tif td == 0:\n\t\t\t\t\tcontinue\n\t\t\t\taddElement_twolevel(global_translation, td, tq, doc_translation[tq][td])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L138_C2", "label": "for tq", "type": "for", "loc": [138, 142], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L137_C1", "vector": [6, 2, 0.8, 0.0286, 2, 0.68, 0.0, 470, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "tq", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor tq in doc_translation.keys():\n\t\t\tfor td in doc_translation[tq].keys():\n\t\t\t\tif td == 0:\n\t\t\t\t\tcontinue\n\t\t\t\taddElement_twolevel(global_translation, td, tq, doc_translation[tq][td])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L139_C3", "label": "for td", "type": "for", "loc": [139, 142], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L138_C2", "vector": [6, 3, 0.8029, 0.0229, 3, 0.51, 0.0, 102, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "td", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tfor td in doc_translation[tq].keys():\n\t\t\t\tif td == 0:\n\t\t\t\t\tcontinue\n\t\t\t\taddElement_twolevel(global_translation, td, tq, doc_translation[tq][td])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:If_L140_C4", "label": "if", "type": "if", "loc": [140, 141], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L139_C3", "vector": [4, 4, 0.8029, 0.0114, 4, 0.24, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tif td == 0:\n\t\t\t\t\tcontinue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Expr_L142_C4", "label": "addElement_twolevel()", "type": "expression", "loc": [142, 142], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L139_C3", "vector": [8, 4, 0.8114, 0.0057, 4, 0.24, 1.0, 619, 3, 4, 0, 0, 0, 0, 1], "semantic": {"name": "addElement_twolevel", "arg_names": [], "import_names": [], "rhs_call_name": "addElement_twolevel", "annotation": ""}, "snippet": "\t\t\t\taddElement_twolevel(global_translation, td, tq, doc_translation[tq][td])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L144_C1", "label": "translation_norm", "type": "function", "loc": [144, 150], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:ClassDef_L21_C0", "vector": [2, 1, 0.84, 0.04, 1, 0.98, 0.9, 447, 0, 2, 0, 0, 0, 0, 2], "semantic": {"name": "translation_norm", "arg_names": ["self", "global_translation"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef translation_norm(self, global_translation):\n\t\tfor td in global_translation.keys():\n\t\t\tfor tq in global_translation[td].keys():\n\t\t\t\tif tq == 0:\n\t\t\t\t\tcontinue\n\t\t\t\tglobal_translation[td][tq] = global_translation[td][tq] / global_translation[td][0]\n\t\t\tglobal_translation[td][0] = 1.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L145_C2", "label": "for td", "type": "for", "loc": [145, 150], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L144_C1", "vector": [6, 2, 0.8429, 0.0343, 2, 0.18, 0.0, 102, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "td", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor td in global_translation.keys():\n\t\t\tfor tq in global_translation[td].keys():\n\t\t\t\tif tq == 0:\n\t\t\t\t\tcontinue\n\t\t\t\tglobal_translation[td][tq] = global_translation[td][tq] / global_translation[td][0]\n\t\t\tglobal_translation[td][0] = 1.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L146_C3", "label": "for tq", "type": "for", "loc": [146, 149], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L145_C2", "vector": [6, 3, 0.8429, 0.0229, 3, 0.13, 0.0, 470, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "tq", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tfor tq in global_translation[td].keys():\n\t\t\t\tif tq == 0:\n\t\t\t\t\tcontinue\n\t\t\t\tglobal_translation[td][tq] = global_translation[td][tq] / global_translation[td][0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:If_L147_C4", "label": "if", "type": "if", "loc": [147, 148], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L146_C3", "vector": [4, 4, 0.8429, 0.0114, 4, 0.97, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tif tq == 0:\n\t\t\t\t\tcontinue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L149_C4", "label": "assign", "type": "assigned_variable", "loc": [149, 149], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L146_C3", "vector": [14, 4, 0.8514, 0.0057, 4, 0.97, 1.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tglobal_translation[td][tq] = global_translation[td][tq] / global_translation[td][0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L150_C3", "label": "assign", "type": "assigned_variable", "loc": [150, 150], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L145_C2", "vector": [14, 3, 0.8571, 0.0057, 3, 0.13, 1.0, 0, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tglobal_translation[td][0] = 1.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L152_C1", "label": "compare", "type": "function", "loc": [152, 168], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:ClassDef_L21_C0", "vector": [2, 1, 0.9143, 0.0971, 1, 0.98, 1.0, 383, 0, 3, 1, 0, 0, 0, 19], "semantic": {"name": "compare", "arg_names": ["self", "pt", "gt"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef\tcompare(self, pt, gt):\n\t\tdiff = 0.0\n\t\ttd_list = set(pt.keys()) | set(gt.keys()) - set([0])\n\t\trow = len(td_list)\n\t\tcol = 0 \n\t\tfor td in td_list:\n\t\t\ttq_list = set()\n\t\t\tif pt.has_key(td):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L153_C2", "label": "diff =", "type": "assigned_variable", "loc": [153, 153], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L152_C1", "vector": [14, 2, 0.8743, 0.0057, 2, 0.01, 0.0, 833, 1, 0, 0, 0, 0, 2, 0], "semantic": {"name": "diff", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tdiff = 0.0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L154_C2", "label": "td_list =", "type": "assigned_variable", "loc": [154, 154], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L152_C1", "vector": [14, 2, 0.88, 0.0057, 2, 0.01, 0.1667, 524, 4, 0, 0, 0, 0, 0, 5], "semantic": {"name": "td_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\ttd_list = set(pt.keys()) | set(gt.keys()) - set([0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L155_C2", "label": "row = len()", "type": "assigned_variable", "loc": [155, 155], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L152_C1", "vector": [14, 2, 0.8857, 0.0057, 2, 0.01, 0.3333, 767, 3, 1, 0, 0, 890, 10, 1], "semantic": {"name": "row", "arg_names": [], "import_names": [], "rhs_call_name": "len", "annotation": ""}, "snippet": "\t\trow = len(td_list)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L156_C2", "label": "col =", "type": "assigned_variable", "loc": [156, 156], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L152_C1", "vector": [14, 2, 0.8914, 0.0057, 2, 0.01, 0.5, 157, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "col", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tcol = 0 "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L157_C2", "label": "for td", "type": "for", "loc": [157, 166], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L152_C1", "vector": [6, 2, 0.9229, 0.0571, 2, 0.01, 0.6667, 102, 2, 0, 0, 0, 0, 0, 12], "semantic": {"name": "td", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor td in td_list:\n\t\t\ttq_list = set()\n\t\t\tif pt.has_key(td):\n\t\t\t\ttq_list = tq_list | set(pt[td].keys())\n\t\t\tif gt.has_key(td):\n\t\t\t\ttq_list = tq_list | set(gt[td].keys())\n\t\t\tcol += len(tq_list)\n\t\t\ttq_list = tq_list - set([0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L158_C3", "label": "tq_list = set()", "type": "assigned_variable", "loc": [158, 158], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L157_C2", "vector": [14, 3, 0.9029, 0.0057, 3, 0.72, 0.0, 932, 3, 0, 0, 0, 21, 10, 1], "semantic": {"name": "tq_list", "arg_names": [], "import_names": [], "rhs_call_name": "set", "annotation": ""}, "snippet": "\t\t\ttq_list = set()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:If_L159_C3", "label": "if", "type": "if", "loc": [159, 160], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L157_C2", "vector": [4, 3, 0.9114, 0.0114, 3, 0.72, 0.25, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif pt.has_key(td):\n\t\t\t\ttq_list = tq_list | set(pt[td].keys())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L160_C4", "label": "tq_list =", "type": "assigned_variable", "loc": [160, 160], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:If_L159_C3", "vector": [14, 4, 0.9143, 0.0057, 4, 0.97, 0.0, 932, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "tq_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\ttq_list = tq_list | set(pt[td].keys())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:If_L161_C3", "label": "if", "type": "if", "loc": [161, 162], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L157_C2", "vector": [4, 3, 0.9229, 0.0114, 3, 0.72, 0.5, 0, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif gt.has_key(td):\n\t\t\t\ttq_list = tq_list | set(gt[td].keys())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L162_C4", "label": "tq_list =", "type": "assigned_variable", "loc": [162, 162], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:If_L161_C3", "vector": [14, 4, 0.9257, 0.0057, 4, 0.35, 0.0, 932, 4, 0, 0, 0, 0, 0, 2], "semantic": {"name": "tq_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\ttq_list = tq_list | set(gt[td].keys())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L164_C3", "label": "tq_list =", "type": "assigned_variable", "loc": [164, 164], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L157_C2", "vector": [14, 3, 0.9371, 0.0057, 3, 0.72, 0.75, 932, 4, 0, 0, 0, 0, 0, 1], "semantic": {"name": "tq_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\ttq_list = tq_list - set([0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L165_C3", "label": "for tq", "type": "for", "loc": [165, 166], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L157_C2", "vector": [6, 3, 0.9457, 0.0114, 3, 0.72, 1.0, 470, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "tq", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tfor tq in tq_list:\n\t\t\t\tdiff = diff + abs(getElement_twolevel(pt, td, tq) - getElement_twolevel(gt, td, tq))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L166_C4", "label": "diff =", "type": "assigned_variable", "loc": [166, 166], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L165_C3", "vector": [14, 4, 0.9486, 0.0057, 4, 0.69, 0.0, 833, 4, 0, 0, 0, 0, 0, 3], "semantic": {"name": "diff", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tdiff = diff + abs(getElement_twolevel(pt, td, tq) - getElement_twolevel(gt, td, tq))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Expr_L167_C2", "label": "print()", "type": "expression", "loc": [167, 167], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L152_C1", "vector": [8, 2, 0.9543, 0.0057, 2, 0.01, 0.8333, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\t\tprint('row: %d col: %d' % (row, col/row))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Return_L168_C2", "label": "return", "type": "return", "loc": [168, 168], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L152_C1", "vector": [13, 2, 0.96, 0.0057, 2, 0.01, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn diff"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:If_L170_C0", "label": "if", "type": "if", "loc": [170, 175], "level": 0, "parent": null, "vector": [4, 0, 0.9857, 0.0343, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n\tatm = ATM()\n\ttm_model = TranslationModel()\n\ti_tm = tm_model.getTM_dict()\n\tatm.train(i_tm, 500, 1e-5)\n\tatm.writeModel()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L171_C1", "label": "atm = ATM()", "type": "assigned_variable", "loc": [171, 171], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:If_L170_C0", "vector": [14, 1, 0.9771, 0.0057, 1, 0.71, 0.0, 267, 3, 0, 0, 0, 532, 10, 1], "semantic": {"name": "atm", "arg_names": [], "import_names": [], "rhs_call_name": "ATM", "annotation": ""}, "snippet": "\tatm = ATM()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L172_C1", "label": "tm_model = TranslationModel()", "type": "assigned_variable", "loc": [172, 172], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:If_L170_C0", "vector": [14, 1, 0.9829, 0.0057, 1, 0.71, 0.25, 477, 3, 0, 0, 0, 753, 10, 1], "semantic": {"name": "tm_model", "arg_names": [], "import_names": [], "rhs_call_name": "TranslationModel", "annotation": ""}, "snippet": "\ttm_model = TranslationModel()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L173_C1", "label": "i_tm = getTM_dict()", "type": "assigned_variable", "loc": [173, 173], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:If_L170_C0", "vector": [14, 1, 0.9886, 0.0057, 1, 0.71, 0.5, 650, 3, 0, 0, 0, 968, 10, 1], "semantic": {"name": "i_tm", "arg_names": [], "import_names": [], "rhs_call_name": "getTM_dict", "annotation": ""}, "snippet": "\ti_tm = tm_model.getTM_dict()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Expr_L174_C1", "label": "train()", "type": "expression", "loc": [174, 174], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:If_L170_C0", "vector": [8, 1, 0.9943, 0.0057, 1, 0.71, 0.75, 371, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "train", "arg_names": [], "import_names": [], "rhs_call_name": "train", "annotation": ""}, "snippet": "\tatm.train(i_tm, 500, 1e-5)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99978:Expr_L175_C1", "label": "writeModel()", "type": "expression", "loc": [175, 175], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99978:If_L170_C0", "vector": [8, 1, 1.0, 0.0057, 1, 0.71, 1.0, 319, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "writeModel", "arg_names": [], "import_names": [], "rhs_call_name": "writeModel", "annotation": ""}, "snippet": "\tatm.writeModel()"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L16_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L16_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L17_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L16_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L18_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L18_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L19_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L18_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Expr_L20_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Expr_L22_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L27_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L27_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L28_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L27_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L29_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L27_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Expr_L30_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L27_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L31_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L27_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L32_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L27_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Expr_L33_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L27_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L34_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L34_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L35_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L34_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Expr_L36_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L34_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L38_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L34_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L39_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L39_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L39_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L41_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L39_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Expr_L43_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L39_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L39_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L39_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L39_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L47_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L39_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L50_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Expr_L51_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Expr_L52_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L39_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Expr_L55_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L39_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L39_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Expr_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L34_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Expr_L58_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L34_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L59_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L34_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Expr_L60_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L34_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:If_L61_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L34_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L63_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L34_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L64_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L34_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Expr_L65_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L27_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L66_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L68_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L68_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L69_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L68_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L70_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L70_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L71_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L70_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L72_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L72_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L70_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L74_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L70_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Expr_L75_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L68_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Expr_L76_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L78_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L78_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L79_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L78_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L80_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L78_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L81_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L78_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Expr_L82_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L78_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L83_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L83_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L84_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L83_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L85_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L83_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L86_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L86_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L87_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L86_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L88_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L86_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Expr_L89_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L90_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L90_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Return_L91_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L93_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L93_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L94_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L93_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L95_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L93_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L96_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L96_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L97_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L93_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L98_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L98_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L99_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L98_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L100_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L100_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:If_L101_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L100_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L103_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L100_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L104_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L100_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:If_L105_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L100_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L107_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L100_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L108_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L98_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L109_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L93_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Return_L110_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L112_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L112_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L113_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L112_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L114_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L114_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L115_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L112_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:If_L116_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:If_L116_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Return_L117_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L112_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L118_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L118_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L119_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L121_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L121_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L122_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L121_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L123_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L123_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:If_L124_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L123_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L126_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L126_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L127_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L127_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Expr_L128_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L121_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L129_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L129_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L130_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L130_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:If_L131_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L130_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L133_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L129_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L134_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L121_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Return_L135_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L137_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L137_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L138_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L138_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L139_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L139_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:If_L140_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L139_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Expr_L142_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L144_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L144_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L145_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L145_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L146_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L146_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:If_L147_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L146_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L149_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L145_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L150_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:ClassDef_L21_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L152_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L152_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L153_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L152_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L154_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L152_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L155_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L152_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L156_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L152_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L157_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L157_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L158_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L157_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:If_L159_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:If_L159_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L160_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L157_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:If_L161_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:If_L161_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L162_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L157_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L164_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L157_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L165_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:For_L165_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L166_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L152_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Expr_L167_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:FunctionDef_L152_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Return_L168_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:If_L170_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L171_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:If_L170_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L172_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:If_L170_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Assign_L173_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:If_L170_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Expr_L174_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99978:If_L170_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99978:Expr_L175_C1"}] |
from os.path import join, exists
from config import *
from Document import Document
class Lexicon:
'''
整个数据集的词典表示
words are 1-indexed.
'''
def create(self):
word_dict = {}
for doc in xrange(doccount):
print 'Processing %d' % doc
paper = Document(doc)
comments = ''
for com in paper.getComments():
comments = comments + com + ' '
content = ' '.join([paper.getTitle(), paper.getAbstract(), paper.getBody(), comments])
words = content.split()
for word in words:
if not word_dict.has_key(word):
word_dict[word] = True
f = open(lexicon_path, 'w')
for word in word_dict.keys():
f.write(word + '\n')
f.close()
def load(self):
self.term2id = {}
self.id2term = {}
word_id = 1
f = open(lexicon_path, 'r')
words = f.readlines()
f.close()
for word in words:
word = word.strip()
self.term2id[word] = word_id
self.id2term[word_id] = word
word_id = word_id + 1
#通过词找编号
def getIdByTerm(self, term):
return self.term2id[term]
#通过编号找词
def getTermById(self, wordid):
return self.id2term[wordid]
#得到词典的大小
def getSize(self):
return len(self.term2id)
if __name__ == '__main__':
lexicon = Lexicon()
#lexicon.create()
lexicon.load()
print lexicon.getIdByTerm('music')
print lexicon.getTermById(2563)
print lexicon.getSize()
| ajibawa-2023/Python-Code-Large/train/row_99979 | 46 | 63 | 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_99979:ImportFrom_L1_C0", "label": "from os.path import join, exists", "type": "import", "loc": [1, 1], "level": 0, "parent": null, "vector": [1, 0, 0.0159, 0.0159, 0, 0.66, 0.0, 79, 0, 2, 0, 0, 79, 0, 0], "semantic": {"name": "os.path", "arg_names": [], "import_names": ["join", "exists"], "rhs_call_name": "", "annotation": ""}, "snippet": "from os.path import join, exists"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99979:ImportFrom_L2_C0", "label": "from config import *", "type": "import", "loc": [2, 2], "level": 0, "parent": null, "vector": [1, 0, 0.0317, 0.0159, 0, 0.66, 0.25, 308, 0, 1, 0, 0, 308, 0, 0], "semantic": {"name": "config", "arg_names": [], "import_names": ["*"], "rhs_call_name": "", "annotation": ""}, "snippet": "from config import *"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99979:ImportFrom_L3_C0", "label": "from Document import Document", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0476, 0.0159, 0, 0.66, 0.5, 920, 0, 1, 0, 0, 920, 0, 0], "semantic": {"name": "Document", "arg_names": [], "import_names": ["Document"], "rhs_call_name": "", "annotation": ""}, "snippet": "from Document import Document"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99979:ClassDef_L5_C0", "label": "Lexicon", "type": "class", "loc": [5, 53], "level": 0, "parent": null, "vector": [3, 0, 0.4603, 0.7778, 0, 0.66, 0.75, 16, 0, 5, 0, 0, 0, 0, 19], "semantic": {"name": "Lexicon", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class Lexicon:\n\n\t'''\n\t\u6574\u4e2a\u6570\u636e\u96c6\u7684\u8bcd\u5178\u8868\u793a\n\twords are 1-indexed.\n\t'''\n\n\tdef create(self):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99979:Expr_L7_C1", "label": "expression", "type": "expression", "loc": [7, 10], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99979:ClassDef_L5_C0", "vector": [8, 1, 0.1349, 0.0635, 1, 0.75, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t'''\n\t\u6574\u4e2a\u6570\u636e\u96c6\u7684\u8bcd\u5178\u8868\u793a\n\twords are 1-indexed.\n\t'''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99979:FunctionDef_L12_C1", "label": "create", "type": "function", "loc": [12, 28], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99979:ClassDef_L5_C0", "vector": [2, 1, 0.3175, 0.2698, 1, 0.75, 0.2, 316, 0, 1, 0, 0, 0, 0, 14], "semantic": {"name": "create", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef create(self):\n\t\tword_dict = {}\n\t\tfor doc in xrange(doccount):\n\t\t\tprint('Processing %d' % doc)\n\t\t\tpaper = Document(doc)\n\t\t\tcomments = ''\n\t\t\tfor com in paper.getComments():\n\t\t\t\tcomments = comments + com + ' '"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99979:Assign_L13_C2", "label": "word_dict =", "type": "assigned_variable", "loc": [13, 13], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99979:FunctionDef_L12_C1", "vector": [14, 2, 0.2063, 0.0159, 2, 0.5, 0.0, 594, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "word_dict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tword_dict = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99979:For_L14_C2", "label": "for doc", "type": "for", "loc": [14, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99979:FunctionDef_L12_C1", "vector": [6, 2, 0.3333, 0.2381, 2, 0.5, 1.0, 555, 3, 0, 0, 0, 0, 0, 14], "semantic": {"name": "doc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor doc in xrange(doccount):\n\t\t\tprint('Processing %d' % doc)\n\t\t\tpaper = Document(doc)\n\t\t\tcomments = ''\n\t\t\tfor com in paper.getComments():\n\t\t\t\tcomments = comments + com + ' '\n\t\t\tcontent = ' '.join([paper.getTitle(), paper.getAbstract(), paper.getBody(), comments])\n\t\t\twords = content.split()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99979:Expr_L15_C3", "label": "print()", "type": "expression", "loc": [15, 15], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99979:For_L14_C2", "vector": [8, 3, 0.2381, 0.0159, 3, 0.49, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\t\t\tprint('Processing %d' % doc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99979:Assign_L16_C3", "label": "paper = Document()", "type": "assigned_variable", "loc": [16, 16], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99979:For_L14_C2", "vector": [14, 3, 0.254, 0.0159, 3, 0.49, 0.1111, 446, 3, 1, 0, 0, 920, 10, 1], "semantic": {"name": "paper", "arg_names": [], "import_names": [], "rhs_call_name": "Document", "annotation": ""}, "snippet": "\t\t\tpaper = Document(doc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99979:Assign_L17_C3", "label": "comments =", "type": "assigned_variable", "loc": [17, 17], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99979:For_L14_C2", "vector": [14, 3, 0.2698, 0.0159, 3, 0.49, 0.2222, 122, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "comments", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tcomments = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99979:For_L18_C3", "label": "for com", "type": "for", "loc": [18, 19], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99979:For_L14_C2", "vector": [6, 3, 0.2937, 0.0317, 3, 0.49, 0.3333, 531, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "com", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tfor com in paper.getComments():\n\t\t\t\tcomments = comments + com + ' '"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99979:Assign_L19_C4", "label": "comments =", "type": "assigned_variable", "loc": [19, 19], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99979:For_L18_C3", "vector": [14, 4, 0.3016, 0.0159, 4, 0.19, 0.0, 122, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "comments", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tcomments = comments + com + ' '"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99979:Assign_L20_C3", "label": "content = join()", "type": "assigned_variable", "loc": [20, 20], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99979:For_L14_C2", "vector": [14, 3, 0.3175, 0.0159, 3, 0.49, 0.4444, 273, 3, 1, 0, 0, 933, 10, 4], "semantic": {"name": "content", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": "\t\t\tcontent = ' '.join([paper.getTitle(), paper.getAbstract(), paper.getBody(), comments])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99979:Assign_L21_C3", "label": "words = split()", "type": "assigned_variable", "loc": [21, 21], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99979:For_L14_C2", "vector": [14, 3, 0.3333, 0.0159, 3, 0.49, 0.5556, 376, 3, 0, 0, 0, 908, 10, 1], "semantic": {"name": "words", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": "\t\t\twords = content.split()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99979:For_L22_C3", "label": "for word", "type": "for", "loc": [22, 24], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99979:For_L14_C2", "vector": [6, 3, 0.3651, 0.0476, 3, 0.49, 0.6667, 107, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "word", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tfor word in words:\n\t\t\t\tif not word_dict.has_key(word):\n\t\t\t\t\tword_dict[word] = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99979:If_L23_C4", "label": "if", "type": "if", "loc": [23, 24], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99979:For_L22_C3", "vector": [4, 4, 0.373, 0.0317, 4, 0.86, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tif not word_dict.has_key(word):\n\t\t\t\t\tword_dict[word] = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99979:Assign_L24_C5", "label": "assign", "type": "assigned_variable", "loc": [24, 24], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99979:If_L23_C4", "vector": [14, 5, 0.381, 0.0159, 5, 0.69, 0.0, 0, 1, 0, 0, 0, 0, 4, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\t\tword_dict[word] = True"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99979:Assign_L25_C3", "label": "f = open()", "type": "assigned_variable", "loc": [25, 25], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99979:For_L14_C2", "vector": [14, 3, 0.3968, 0.0159, 3, 0.49, 0.7778, 899, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": "\t\t\tf = open(lexicon_path, 'w')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99979:For_L26_C3", "label": "for word", "type": "for", "loc": [26, 27], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99979:For_L14_C2", "vector": [6, 3, 0.4206, 0.0317, 3, 0.49, 0.8889, 107, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "word", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tfor word in word_dict.keys():\n\t\t\t\tf.write(word + '\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99979:Expr_L27_C4", "label": "write()", "type": "expression", "loc": [27, 27], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99979:For_L26_C3", "vector": [8, 4, 0.4286, 0.0159, 4, 0.22, 0.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": "\t\t\t\tf.write(word + '\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99979:Expr_L28_C3", "label": "close()", "type": "expression", "loc": [28, 28], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99979:For_L14_C2", "vector": [8, 3, 0.4444, 0.0159, 3, 0.49, 1.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": "\t\t\tf.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99979:FunctionDef_L30_C1", "label": "load", "type": "function", "loc": [30, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99979:ClassDef_L5_C0", "vector": [2, 1, 0.5794, 0.2222, 1, 0.75, 0.4, 37, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "load", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef load(self):\n\t\tself.term2id = {}\n\t\tself.id2term = {}\n\t\tword_id = 1\n\n\t\tf = open(lexicon_path, 'r')\n\t\twords = f.readlines()\n\t\tf.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99979:Assign_L31_C2", "label": "self.term2id =", "type": "assigned_variable", "loc": [31, 31], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99979:FunctionDef_L30_C1", "vector": [14, 2, 0.4921, 0.0159, 2, 0.95, 0.0, 760, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.term2id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.term2id = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99979:Assign_L32_C2", "label": "self.id2term =", "type": "assigned_variable", "loc": [32, 32], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99979:FunctionDef_L30_C1", "vector": [14, 2, 0.5079, 0.0159, 2, 0.95, 0.1667, 604, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "self.id2term", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.id2term = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99979:Assign_L33_C2", "label": "word_id =", "type": "assigned_variable", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99979:FunctionDef_L30_C1", "vector": [14, 2, 0.5238, 0.0159, 2, 0.95, 0.3333, 160, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "word_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tword_id = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99979:Assign_L35_C2", "label": "f = open()", "type": "assigned_variable", "loc": [35, 35], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99979:FunctionDef_L30_C1", "vector": [14, 2, 0.5556, 0.0159, 2, 0.95, 0.5, 899, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": "\t\tf = open(lexicon_path, 'r')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99979:Assign_L36_C2", "label": "words = readlines()", "type": "assigned_variable", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99979:FunctionDef_L30_C1", "vector": [14, 2, 0.5714, 0.0159, 2, 0.95, 0.6667, 376, 3, 0, 0, 0, 841, 10, 1], "semantic": {"name": "words", "arg_names": [], "import_names": [], "rhs_call_name": "readlines", "annotation": ""}, "snippet": "\t\twords = f.readlines()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99979:Expr_L37_C2", "label": "close()", "type": "expression", "loc": [37, 37], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99979:FunctionDef_L30_C1", "vector": [8, 2, 0.5873, 0.0159, 2, 0.95, 0.8333, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": "\t\tf.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99979:For_L39_C2", "label": "for word", "type": "for", "loc": [39, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99979:FunctionDef_L30_C1", "vector": [6, 2, 0.6508, 0.0794, 2, 0.95, 1.0, 107, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "word", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor word in words:\n\t\t\tword = word.strip()\n\t\t\tself.term2id[word] = word_id\n\t\t\tself.id2term[word_id] = word\n\t\t\tword_id = word_id + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99979:Assign_L40_C3", "label": "word = strip()", "type": "assigned_variable", "loc": [40, 40], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99979:For_L39_C2", "vector": [14, 3, 0.6349, 0.0159, 3, 0.6, 0.0, 107, 3, 0, 0, 0, 973, 10, 1], "semantic": {"name": "word", "arg_names": [], "import_names": [], "rhs_call_name": "strip", "annotation": ""}, "snippet": "\t\t\tword = word.strip()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99979:Assign_L41_C3", "label": "assign", "type": "assigned_variable", "loc": [41, 41], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99979:For_L39_C2", "vector": [14, 3, 0.6508, 0.0159, 3, 0.6, 0.3333, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tself.term2id[word] = word_id"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99979:Assign_L42_C3", "label": "assign", "type": "assigned_variable", "loc": [42, 42], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99979:For_L39_C2", "vector": [14, 3, 0.6667, 0.0159, 3, 0.6, 0.6667, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tself.id2term[word_id] = word"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99979:Assign_L43_C3", "label": "word_id =", "type": "assigned_variable", "loc": [43, 43], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99979:For_L39_C2", "vector": [14, 3, 0.6825, 0.0159, 3, 0.6, 1.0, 160, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "word_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tword_id = word_id + 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99979:FunctionDef_L46_C1", "label": "getIdByTerm", "type": "function", "loc": [46, 47], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99979:ClassDef_L5_C0", "vector": [2, 1, 0.7381, 0.0317, 1, 0.75, 0.6, 805, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "getIdByTerm", "arg_names": ["self", "term"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef getIdByTerm(self, term):\n\t\treturn self.term2id[term]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99979:Return_L47_C2", "label": "return", "type": "return", "loc": [47, 47], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99979:FunctionDef_L46_C1", "vector": [13, 2, 0.746, 0.0159, 2, 0.2, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn self.term2id[term]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99979:FunctionDef_L49_C1", "label": "getTermById", "type": "function", "loc": [49, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99979:ClassDef_L5_C0", "vector": [2, 1, 0.7857, 0.0317, 1, 0.75, 0.8, 822, 0, 2, 1, 0, 0, 0, 0], "semantic": {"name": "getTermById", "arg_names": ["self", "wordid"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef getTermById(self, wordid):\n\t\treturn self.id2term[wordid]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99979:Return_L50_C2", "label": "return", "type": "return", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99979:FunctionDef_L49_C1", "vector": [13, 2, 0.7937, 0.0159, 2, 0.07, 0.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn self.id2term[wordid]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99979:FunctionDef_L52_C1", "label": "getSize", "type": "function", "loc": [52, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99979:ClassDef_L5_C0", "vector": [2, 1, 0.8333, 0.0317, 1, 0.75, 1.0, 517, 0, 1, 1, 0, 0, 0, 1], "semantic": {"name": "getSize", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef getSize(self):\n\t\treturn len(self.term2id)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99979:Return_L53_C2", "label": "return", "type": "return", "loc": [53, 53], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99979:FunctionDef_L52_C1", "vector": [13, 2, 0.8413, 0.0159, 2, 0.63, 0.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn len(self.term2id)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99979:If_L55_C0", "label": "if", "type": "if", "loc": [55, 63], "level": 0, "parent": null, "vector": [4, 0, 0.9365, 0.1429, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 8], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n\tlexicon = Lexicon()\n\n\t#lexicon.create()\n\tlexicon.load()\n\n\tprint(lexicon.getIdByTerm('music'))\n\tprint(lexicon.getTermById(2563))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99979:Assign_L56_C1", "label": "lexicon = Lexicon()", "type": "assigned_variable", "loc": [56, 56], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99979:If_L55_C0", "vector": [14, 1, 0.8889, 0.0159, 1, 0.64, 0.0, 675, 3, 0, 0, 0, 16, 10, 1], "semantic": {"name": "lexicon", "arg_names": [], "import_names": [], "rhs_call_name": "Lexicon", "annotation": ""}, "snippet": "\tlexicon = Lexicon()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99979:Expr_L59_C1", "label": "load()", "type": "expression", "loc": [59, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99979:If_L55_C0", "vector": [8, 1, 0.9365, 0.0159, 1, 0.64, 0.25, 37, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "load", "arg_names": [], "import_names": [], "rhs_call_name": "load", "annotation": ""}, "snippet": "\tlexicon.load()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99979:Expr_L61_C1", "label": "print()", "type": "expression", "loc": [61, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99979:If_L55_C0", "vector": [8, 1, 0.9683, 0.0159, 1, 0.64, 0.5, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\tprint(lexicon.getIdByTerm('music'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99979:Expr_L62_C1", "label": "print()", "type": "expression", "loc": [62, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99979:If_L55_C0", "vector": [8, 1, 0.9841, 0.0159, 1, 0.64, 0.75, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\tprint(lexicon.getTermById(2563))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99979:Expr_L63_C1", "label": "print()", "type": "expression", "loc": [63, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99979:If_L55_C0", "vector": [8, 1, 1.0, 0.0159, 1, 0.64, 1.0, 535, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\tprint(lexicon.getSize())"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99979:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99979:Expr_L7_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99979:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99979:FunctionDef_L12_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99979:FunctionDef_L12_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99979:Assign_L13_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99979:FunctionDef_L12_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99979:For_L14_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99979:For_L14_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99979:Expr_L15_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99979:For_L14_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99979:Assign_L16_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99979:For_L14_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99979:Assign_L17_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99979:For_L14_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99979:For_L18_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99979:For_L18_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99979:Assign_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99979:For_L14_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99979:Assign_L20_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99979:For_L14_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99979:Assign_L21_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99979:For_L14_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99979:For_L22_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99979:For_L22_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99979:If_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99979:If_L23_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99979:Assign_L24_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99979:For_L14_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99979:Assign_L25_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99979:For_L14_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99979:For_L26_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99979:For_L26_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99979:Expr_L27_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99979:For_L14_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99979:Expr_L28_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99979:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99979:FunctionDef_L30_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99979:FunctionDef_L30_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99979:Assign_L31_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99979:FunctionDef_L30_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99979:Assign_L32_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99979:FunctionDef_L30_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99979:Assign_L33_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99979:FunctionDef_L30_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99979:Assign_L35_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99979:FunctionDef_L30_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99979:Assign_L36_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99979:FunctionDef_L30_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99979:Expr_L37_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99979:FunctionDef_L30_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99979:For_L39_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99979:For_L39_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99979:Assign_L40_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99979:For_L39_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99979:Assign_L41_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99979:For_L39_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99979:Assign_L42_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99979:For_L39_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99979:Assign_L43_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99979:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99979:FunctionDef_L46_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99979:FunctionDef_L46_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99979:Return_L47_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99979:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99979:FunctionDef_L49_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99979:FunctionDef_L49_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99979:Return_L50_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99979:ClassDef_L5_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99979:FunctionDef_L52_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99979:FunctionDef_L52_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99979:Return_L53_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99979:If_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99979:Assign_L56_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99979:If_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99979:Expr_L59_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99979:If_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99979:Expr_L61_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99979:If_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99979:Expr_L62_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99979:If_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99979:Expr_L63_C1"}] |
#预处理之后的原始数据路径
datapath='/mnt/disk1/luyang/paper_new/prunned_data/'
#文档个数
doccount=29353
#alpha=0.2
#beta=0.3
#translation model的截断数,即1个词最多翻译到filter_num个词
filter_num=1000
#词典的路径
lexicon_path='/mnt/disk1/luyang/paper_new/prunned_data/lexicon'
#collection model的路径
collection_path='/mnt/disk1/luyang/paper_new/ML_data/collection'
#生成的每篇文档的最大似然估计的路径
ML_path='/mnt/disk1/luyang/paper_new/ML_data/'
#所有的Query的路径
query_path='/mnt/disk1/luyang/paper_new/ML_data/Querys'
#global translation model文件的路径
TM_path='/mnt/disk1/luyang/paper_new/ML_data/TM'
#每篇文档的Offline translation model文件的路径
Offline_TM_path='/mnt/disk1/luyang/paper_new/ML_data/OfflineTM_500'
#临时路径,测试截断数的Offline Translation model,其中每个文件是一个文档的offline translation model
tmp_path='/mnt/disk1/luyang/paper_new/tmp_500/'
#决定使用的截断数之后,将tmp_path更新为OfflineTMSingle_path,原因是在计算每篇文档的分数时,只载入这篇文档的model,否则内存耗费非常大,尤其在多进程的时候
OfflineTMSingle_path='/mnt/disk1/luyang/paper_new/OfflineTMSingle'
#Aligned Translation Model 中一个passage的词的个数
passage_length=100
#使用Aligned Translation Model检索时,先用Language model检索,然后排在在前reranking_num的文档用ATM重排序
reranking_num=200
#词典中的词的个数
lexicon_size=78404
#Aligned Translation Model文件的位置
EM_TM_path='/mnt/disk1/luyang/paper_new/src/EM_TM_path'
| ajibawa-2023/Python-Code-Large/train/row_99980 | 15 | 32 | 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_99980:Assign_L2_C0", "label": "datapath =", "type": "assigned_variable", "loc": [2, 2], "level": 0, "parent": null, "vector": [14, 0, 0.0625, 0.0312, 0, 0.66, 0.0, 716, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "datapath", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "datapath='/mnt/disk1/luyang/paper_new/prunned_data/'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99980:Assign_L4_C0", "label": "doccount =", "type": "assigned_variable", "loc": [4, 4], "level": 0, "parent": null, "vector": [14, 0, 0.125, 0.0312, 0, 0.66, 0.0714, 878, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "doccount", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "doccount=29353"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99980:Assign_L8_C0", "label": "filter_num =", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.25, 0.0312, 0, 0.66, 0.1429, 144, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "filter_num", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "filter_num=1000"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99980:Assign_L10_C0", "label": "lexicon_path =", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.3125, 0.0312, 0, 0.66, 0.2143, 886, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "lexicon_path", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "lexicon_path='/mnt/disk1/luyang/paper_new/prunned_data/lexicon'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99980:Assign_L12_C0", "label": "collection_path =", "type": "assigned_variable", "loc": [12, 12], "level": 0, "parent": null, "vector": [14, 0, 0.375, 0.0312, 0, 0.66, 0.2857, 183, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "collection_path", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "collection_path='/mnt/disk1/luyang/paper_new/ML_data/collection'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99980:Assign_L14_C0", "label": "ML_path =", "type": "assigned_variable", "loc": [14, 14], "level": 0, "parent": null, "vector": [14, 0, 0.4375, 0.0312, 0, 0.66, 0.3571, 488, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "ML_path", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "ML_path='/mnt/disk1/luyang/paper_new/ML_data/'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99980:Assign_L16_C0", "label": "query_path =", "type": "assigned_variable", "loc": [16, 16], "level": 0, "parent": null, "vector": [14, 0, 0.5, 0.0312, 0, 0.66, 0.4286, 92, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "query_path", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "query_path='/mnt/disk1/luyang/paper_new/ML_data/Querys'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99980:Assign_L18_C0", "label": "TM_path =", "type": "assigned_variable", "loc": [18, 18], "level": 0, "parent": null, "vector": [14, 0, 0.5625, 0.0312, 0, 0.66, 0.5, 394, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "TM_path", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TM_path='/mnt/disk1/luyang/paper_new/ML_data/TM'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99980:Assign_L20_C0", "label": "Offline_TM_path =", "type": "assigned_variable", "loc": [20, 20], "level": 0, "parent": null, "vector": [14, 0, 0.625, 0.0312, 0, 0.66, 0.5714, 165, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "Offline_TM_path", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "Offline_TM_path='/mnt/disk1/luyang/paper_new/ML_data/OfflineTM_500'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99980:Assign_L22_C0", "label": "tmp_path =", "type": "assigned_variable", "loc": [22, 22], "level": 0, "parent": null, "vector": [14, 0, 0.6875, 0.0312, 0, 0.66, 0.6429, 313, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "tmp_path", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "tmp_path='/mnt/disk1/luyang/paper_new/tmp_500/'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99980:Assign_L24_C0", "label": "OfflineTMSingle_path =", "type": "assigned_variable", "loc": [24, 24], "level": 0, "parent": null, "vector": [14, 0, 0.75, 0.0312, 0, 0.66, 0.7143, 841, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "OfflineTMSingle_path", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "OfflineTMSingle_path='/mnt/disk1/luyang/paper_new/OfflineTMSingle'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99980:Assign_L26_C0", "label": "passage_length =", "type": "assigned_variable", "loc": [26, 26], "level": 0, "parent": null, "vector": [14, 0, 0.8125, 0.0312, 0, 0.66, 0.7857, 250, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "passage_length", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "passage_length=100"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99980:Assign_L28_C0", "label": "reranking_num =", "type": "assigned_variable", "loc": [28, 28], "level": 0, "parent": null, "vector": [14, 0, 0.875, 0.0312, 0, 0.66, 0.8571, 422, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "reranking_num", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "reranking_num=200"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99980:Assign_L30_C0", "label": "lexicon_size =", "type": "assigned_variable", "loc": [30, 30], "level": 0, "parent": null, "vector": [14, 0, 0.9375, 0.0312, 0, 0.66, 0.9286, 863, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "lexicon_size", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "lexicon_size=78404"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99980:Assign_L32_C0", "label": "EM_TM_path =", "type": "assigned_variable", "loc": [32, 32], "level": 0, "parent": null, "vector": [14, 0, 1.0, 0.0312, 0, 0.66, 1.0, 178, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "EM_TM_path", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "EM_TM_path='/mnt/disk1/luyang/paper_new/src/EM_TM_path'"}] | [] |
#!/usr/bin/python2.6
#
# Simple http server to emulate api.playfoursquare.com
import logging
import shutil
import sys
import urlparse
import SimpleHTTPServer
import BaseHTTPServer
class RequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
"""Handle playfoursquare.com requests, for testing."""
def do_GET(self):
logging.warn('do_GET: %s, %s', self.command, self.path)
url = urlparse.urlparse(self.path)
logging.warn('do_GET: %s', url)
query = urlparse.parse_qs(url.query)
query_keys = [pair[0] for pair in query]
response = self.handle_url(url)
if response != None:
self.send_200()
shutil.copyfileobj(response, self.wfile)
self.wfile.close()
do_POST = do_GET
def handle_url(self, url):
path = None
if url.path == '/v1/venue':
path = '../captures/api/v1/venue.xml'
elif url.path == '/v1/addvenue':
path = '../captures/api/v1/venue.xml'
elif url.path == '/v1/venues':
path = '../captures/api/v1/venues.xml'
elif url.path == '/v1/user':
path = '../captures/api/v1/user.xml'
elif url.path == '/v1/checkcity':
path = '../captures/api/v1/checkcity.xml'
elif url.path == '/v1/checkins':
path = '../captures/api/v1/checkins.xml'
elif url.path == '/v1/cities':
path = '../captures/api/v1/cities.xml'
elif url.path == '/v1/switchcity':
path = '../captures/api/v1/switchcity.xml'
elif url.path == '/v1/tips':
path = '../captures/api/v1/tips.xml'
elif url.path == '/v1/checkin':
path = '../captures/api/v1/checkin.xml'
elif url.path == '/history/12345.rss':
path = '../captures/api/v1/feed.xml'
if path is None:
self.send_error(404)
else:
logging.warn('Using: %s' % path)
return open(path)
def send_200(self):
self.send_response(200)
self.send_header('Content-type', 'text/xml')
self.end_headers()
def main():
if len(sys.argv) > 1:
port = int(sys.argv[1])
else:
port = 8080
server_address = ('0.0.0.0', port)
httpd = BaseHTTPServer.HTTPServer(server_address, RequestHandler)
sa = httpd.socket.getsockname()
print "Serving HTTP on", sa[0], "port", sa[1], "..."
httpd.serve_forever()
if __name__ == '__main__':
main()
| ajibawa-2023/Python-Code-Large/train/row_99981 | 63 | 85 | 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_99981:Import_L5_C0", "label": "logging import logging", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0588, 0.0118, 0, 0.66, 0.0, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "logging", "arg_names": [], "import_names": ["logging"], "rhs_call_name": "", "annotation": ""}, "snippet": "import logging"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99981:Import_L6_C0", "label": "shutil import shutil", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0706, 0.0118, 0, 0.66, 0.125, 614, 0, 1, 0, 0, 614, 0, 0], "semantic": {"name": "shutil", "arg_names": [], "import_names": ["shutil"], "rhs_call_name": "", "annotation": ""}, "snippet": "import shutil"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99981:Import_L7_C0", "label": "sys import sys", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.0824, 0.0118, 0, 0.66, 0.25, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99981:Import_L8_C0", "label": "urlparse import urlparse", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0941, 0.0118, 0, 0.66, 0.375, 857, 0, 1, 0, 0, 857, 0, 0], "semantic": {"name": "urlparse", "arg_names": [], "import_names": ["urlparse"], "rhs_call_name": "", "annotation": ""}, "snippet": "import urlparse"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99981:Import_L10_C0", "label": "SimpleHTTPServer import SimpleHTTPServer", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.1176, 0.0118, 0, 0.66, 0.5, 643, 0, 1, 0, 0, 643, 0, 0], "semantic": {"name": "SimpleHTTPServer", "arg_names": [], "import_names": ["SimpleHTTPServer"], "rhs_call_name": "", "annotation": ""}, "snippet": "import SimpleHTTPServer"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99981:Import_L11_C0", "label": "BaseHTTPServer import BaseHTTPServer", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.1294, 0.0118, 0, 0.66, 0.625, 801, 0, 1, 0, 0, 801, 0, 0], "semantic": {"name": "BaseHTTPServer", "arg_names": [], "import_names": ["BaseHTTPServer"], "rhs_call_name": "", "annotation": ""}, "snippet": "import BaseHTTPServer"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99981:ClassDef_L14_C0", "label": "RequestHandler", "type": "class", "loc": [14, 68], "level": 0, "parent": null, "vector": [3, 0, 0.4824, 0.6471, 0, 0.66, 0.75, 200, 0, 3, 0, 0, 814, 0, 14], "semantic": {"name": "RequestHandler", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class RequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):\n \"\"\"Handle playfoursquare.com requests, for testing.\"\"\"\n\n def do_GET(self):\n logging.warn('do_GET: %s, %s', self.command, self.path)\n\n url = urlparse.urlparse(self.path)\n logging.warn('do_GET: %s', url)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99981:Expr_L15_C2", "label": "expression", "type": "expression", "loc": [15, 15], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99981:ClassDef_L14_C0", "vector": [8, 1, 0.1765, 0.0118, 1, 0.46, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Handle playfoursquare.com requests, for testing.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99981:FunctionDef_L17_C2", "label": "do_GET", "type": "function", "loc": [17, 29], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99981:ClassDef_L14_C0", "vector": [2, 1, 0.2706, 0.1529, 1, 0.46, 0.25, 269, 0, 1, 0, 0, 0, 0, 8], "semantic": {"name": "do_GET", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def do_GET(self):\n logging.warn('do_GET: %s, %s', self.command, self.path)\n\n url = urlparse.urlparse(self.path)\n logging.warn('do_GET: %s', url)\n query = urlparse.parse_qs(url.query)\n query_keys = [pair[0] for pair in query]\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99981:Expr_L18_C4", "label": "warn()", "type": "expression", "loc": [18, 18], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99981:FunctionDef_L17_C2", "vector": [8, 2, 0.2118, 0.0118, 2, 0.09, 0.0, 960, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "warn", "arg_names": [], "import_names": [], "rhs_call_name": "warn", "annotation": ""}, "snippet": " logging.warn('do_GET: %s, %s', self.command, self.path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99981:Assign_L20_C4", "label": "url = urlparse()", "type": "assigned_variable", "loc": [20, 20], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99981:FunctionDef_L17_C2", "vector": [14, 2, 0.2353, 0.0118, 2, 0.09, 0.1429, 789, 3, 1, 0, 0, 857, 10, 1], "semantic": {"name": "url", "arg_names": [], "import_names": [], "rhs_call_name": "urlparse", "annotation": ""}, "snippet": " url = urlparse.urlparse(self.path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99981:Expr_L21_C4", "label": "warn()", "type": "expression", "loc": [21, 21], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99981:FunctionDef_L17_C2", "vector": [8, 2, 0.2471, 0.0118, 2, 0.09, 0.2857, 960, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "warn", "arg_names": [], "import_names": [], "rhs_call_name": "warn", "annotation": ""}, "snippet": " logging.warn('do_GET: %s', url)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99981:Assign_L22_C4", "label": "query = parse_qs()", "type": "assigned_variable", "loc": [22, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99981:FunctionDef_L17_C2", "vector": [14, 2, 0.2588, 0.0118, 2, 0.09, 0.4286, 546, 3, 1, 0, 0, 709, 10, 1], "semantic": {"name": "query", "arg_names": [], "import_names": [], "rhs_call_name": "parse_qs", "annotation": ""}, "snippet": " query = urlparse.parse_qs(url.query)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99981:Assign_L23_C4", "label": "query_keys =", "type": "assigned_variable", "loc": [23, 23], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99981:FunctionDef_L17_C2", "vector": [14, 2, 0.2706, 0.0118, 2, 0.09, 0.5714, 890, 5, 0, 0, 0, 0, 0, 0], "semantic": {"name": "query_keys", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " query_keys = [pair[0] for pair in query]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99981:Assign_L25_C4", "label": "response = handle_url()", "type": "assigned_variable", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99981:FunctionDef_L17_C2", "vector": [14, 2, 0.2941, 0.0118, 2, 0.09, 0.7143, 511, 3, 1, 0, 0, 906, 10, 1], "semantic": {"name": "response", "arg_names": [], "import_names": [], "rhs_call_name": "handle_url", "annotation": ""}, "snippet": " response = self.handle_url(url)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L26_C4", "label": "if", "type": "if", "loc": [26, 28], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99981:FunctionDef_L17_C2", "vector": [4, 2, 0.3176, 0.0353, 2, 0.09, 0.8571, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if response != None:\n self.send_200()\n shutil.copyfileobj(response, self.wfile)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99981:Expr_L27_C6", "label": "send_200()", "type": "expression", "loc": [27, 27], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L26_C4", "vector": [8, 3, 0.3176, 0.0118, 3, 0.56, 0.0, 966, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "send_200", "arg_names": [], "import_names": [], "rhs_call_name": "send_200", "annotation": ""}, "snippet": " self.send_200()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99981:Expr_L28_C6", "label": "copyfileobj()", "type": "expression", "loc": [28, 28], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L26_C4", "vector": [8, 3, 0.3294, 0.0118, 3, 0.56, 1.0, 462, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "copyfileobj", "arg_names": [], "import_names": [], "rhs_call_name": "copyfileobj", "annotation": ""}, "snippet": " shutil.copyfileobj(response, self.wfile)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99981:Expr_L29_C4", "label": "close()", "type": "expression", "loc": [29, 29], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99981:FunctionDef_L17_C2", "vector": [8, 2, 0.3412, 0.0118, 2, 0.09, 1.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": " self.wfile.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99981:Assign_L31_C2", "label": "do_POST =", "type": "assigned_variable", "loc": [31, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99981:ClassDef_L14_C0", "vector": [14, 1, 0.3647, 0.0118, 1, 0.46, 0.5, 67, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "do_POST", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " do_POST = do_GET"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99981:FunctionDef_L33_C2", "label": "handle_url", "type": "function", "loc": [33, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99981:ClassDef_L14_C0", "vector": [2, 1, 0.5647, 0.3647, 1, 0.46, 0.75, 906, 0, 2, 1, 0, 0, 0, 3], "semantic": {"name": "handle_url", "arg_names": ["self", "url"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def handle_url(self, url):\n path = None\n\n if url.path == '/v1/venue':\n path = '../captures/api/v1/venue.xml'\n elif url.path == '/v1/addvenue':\n path = '../captures/api/v1/venue.xml'\n elif url.path == '/v1/venues':"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99981:Assign_L34_C4", "label": "path =", "type": "assigned_variable", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99981:FunctionDef_L33_C2", "vector": [14, 2, 0.4, 0.0118, 2, 0.28, 0.0, 358, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "path", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " path = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L36_C4", "label": "if", "type": "if", "loc": [36, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99981:FunctionDef_L33_C2", "vector": [4, 2, 0.5471, 0.2588, 2, 0.28, 0.5, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if url.path == '/v1/venue':\n path = '../captures/api/v1/venue.xml'\n elif url.path == '/v1/addvenue':\n path = '../captures/api/v1/venue.xml'\n elif url.path == '/v1/venues':\n path = '../captures/api/v1/venues.xml'\n elif url.path == '/v1/user':\n path = '../captures/api/v1/user.xml'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99981:Assign_L37_C6", "label": "path =", "type": "assigned_variable", "loc": [37, 37], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L36_C4", "vector": [14, 3, 0.4353, 0.0118, 3, 0.33, 0.0, 358, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "path", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " path = '../captures/api/v1/venue.xml'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L38_C4", "label": "if", "type": "if", "loc": [38, 57], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L36_C4", "vector": [4, 3, 0.5588, 0.2353, 3, 0.33, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif url.path == '/v1/addvenue':\n path = '../captures/api/v1/venue.xml'\n elif url.path == '/v1/venues':\n path = '../captures/api/v1/venues.xml'\n elif url.path == '/v1/user':\n path = '../captures/api/v1/user.xml'\n elif url.path == '/v1/checkcity':\n path = '../captures/api/v1/checkcity.xml'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99981:Assign_L39_C6", "label": "path =", "type": "assigned_variable", "loc": [39, 39], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L38_C4", "vector": [14, 4, 0.4588, 0.0118, 4, 0.19, 0.0, 358, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "path", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " path = '../captures/api/v1/venue.xml'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L40_C4", "label": "if", "type": "if", "loc": [40, 57], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L38_C4", "vector": [4, 4, 0.5706, 0.2118, 4, 0.19, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif url.path == '/v1/venues':\n path = '../captures/api/v1/venues.xml'\n elif url.path == '/v1/user':\n path = '../captures/api/v1/user.xml'\n elif url.path == '/v1/checkcity':\n path = '../captures/api/v1/checkcity.xml'\n elif url.path == '/v1/checkins':\n path = '../captures/api/v1/checkins.xml'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99981:Assign_L41_C6", "label": "path =", "type": "assigned_variable", "loc": [41, 41], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L40_C4", "vector": [14, 5, 0.4824, 0.0118, 5, 0.8, 0.0, 358, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "path", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " path = '../captures/api/v1/venues.xml'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L42_C4", "label": "if", "type": "if", "loc": [42, 57], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L40_C4", "vector": [4, 5, 0.5824, 0.1882, 5, 0.8, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif url.path == '/v1/user':\n path = '../captures/api/v1/user.xml'\n elif url.path == '/v1/checkcity':\n path = '../captures/api/v1/checkcity.xml'\n elif url.path == '/v1/checkins':\n path = '../captures/api/v1/checkins.xml'\n elif url.path == '/v1/cities':\n path = '../captures/api/v1/cities.xml'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99981:Assign_L43_C6", "label": "path =", "type": "assigned_variable", "loc": [43, 43], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L42_C4", "vector": [14, 6, 0.5059, 0.0118, 6, 0.84, 0.0, 358, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "path", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " path = '../captures/api/v1/user.xml'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L44_C4", "label": "if", "type": "if", "loc": [44, 57], "level": 6, "parent": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L42_C4", "vector": [4, 6, 0.5941, 0.1647, 6, 0.84, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif url.path == '/v1/checkcity':\n path = '../captures/api/v1/checkcity.xml'\n elif url.path == '/v1/checkins':\n path = '../captures/api/v1/checkins.xml'\n elif url.path == '/v1/cities':\n path = '../captures/api/v1/cities.xml'\n elif url.path == '/v1/switchcity':\n path = '../captures/api/v1/switchcity.xml'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99981:Assign_L45_C6", "label": "path =", "type": "assigned_variable", "loc": [45, 45], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L44_C4", "vector": [14, 7, 0.5294, 0.0118, 7, 0.09, 0.0, 358, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "path", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " path = '../captures/api/v1/checkcity.xml'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L46_C4", "label": "if", "type": "if", "loc": [46, 57], "level": 7, "parent": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L44_C4", "vector": [4, 7, 0.6059, 0.1412, 7, 0.09, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif url.path == '/v1/checkins':\n path = '../captures/api/v1/checkins.xml'\n elif url.path == '/v1/cities':\n path = '../captures/api/v1/cities.xml'\n elif url.path == '/v1/switchcity':\n path = '../captures/api/v1/switchcity.xml'\n elif url.path == '/v1/tips':\n path = '../captures/api/v1/tips.xml'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99981:Assign_L47_C6", "label": "path =", "type": "assigned_variable", "loc": [47, 47], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L46_C4", "vector": [14, 8, 0.5529, 0.0118, 8, 0.35, 0.0, 358, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "path", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " path = '../captures/api/v1/checkins.xml'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L48_C4", "label": "if", "type": "if", "loc": [48, 57], "level": 8, "parent": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L46_C4", "vector": [4, 8, 0.6176, 0.1176, 8, 0.35, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif url.path == '/v1/cities':\n path = '../captures/api/v1/cities.xml'\n elif url.path == '/v1/switchcity':\n path = '../captures/api/v1/switchcity.xml'\n elif url.path == '/v1/tips':\n path = '../captures/api/v1/tips.xml'\n elif url.path == '/v1/checkin':\n path = '../captures/api/v1/checkin.xml'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99981:Assign_L49_C6", "label": "path =", "type": "assigned_variable", "loc": [49, 49], "level": 9, "parent": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L48_C4", "vector": [14, 9, 0.5765, 0.0118, 9, 0.2, 0.0, 358, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "path", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " path = '../captures/api/v1/cities.xml'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L50_C4", "label": "if", "type": "if", "loc": [50, 57], "level": 9, "parent": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L48_C4", "vector": [4, 9, 0.6294, 0.0941, 9, 0.2, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif url.path == '/v1/switchcity':\n path = '../captures/api/v1/switchcity.xml'\n elif url.path == '/v1/tips':\n path = '../captures/api/v1/tips.xml'\n elif url.path == '/v1/checkin':\n path = '../captures/api/v1/checkin.xml'\n elif url.path == '/history/12345.rss':\n path = '../captures/api/v1/feed.xml'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99981:Assign_L51_C6", "label": "path =", "type": "assigned_variable", "loc": [51, 51], "level": 10, "parent": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L50_C4", "vector": [14, 10, 0.6, 0.0118, 10, 0.93, 0.0, 358, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "path", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " path = '../captures/api/v1/switchcity.xml'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L52_C4", "label": "if", "type": "if", "loc": [52, 57], "level": 10, "parent": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L50_C4", "vector": [4, 10, 0.6412, 0.0706, 10, 0.93, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif url.path == '/v1/tips':\n path = '../captures/api/v1/tips.xml'\n elif url.path == '/v1/checkin':\n path = '../captures/api/v1/checkin.xml'\n elif url.path == '/history/12345.rss':\n path = '../captures/api/v1/feed.xml'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99981:Assign_L53_C6", "label": "path =", "type": "assigned_variable", "loc": [53, 53], "level": 11, "parent": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L52_C4", "vector": [14, 11, 0.6235, 0.0118, 11, 0.1, 0.0, 358, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "path", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " path = '../captures/api/v1/tips.xml'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L54_C4", "label": "if", "type": "if", "loc": [54, 57], "level": 11, "parent": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L52_C4", "vector": [4, 11, 0.6529, 0.0471, 11, 0.1, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif url.path == '/v1/checkin':\n path = '../captures/api/v1/checkin.xml'\n elif url.path == '/history/12345.rss':\n path = '../captures/api/v1/feed.xml'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99981:Assign_L55_C6", "label": "path =", "type": "assigned_variable", "loc": [55, 55], "level": 12, "parent": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L54_C4", "vector": [14, 12, 0.6471, 0.0118, 12, 0.25, 0.0, 358, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "path", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " path = '../captures/api/v1/checkin.xml'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L56_C4", "label": "if", "type": "if", "loc": [56, 57], "level": 12, "parent": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L54_C4", "vector": [4, 12, 0.6647, 0.0235, 12, 0.25, 1.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif url.path == '/history/12345.rss':\n path = '../captures/api/v1/feed.xml'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99981:Assign_L57_C6", "label": "path =", "type": "assigned_variable", "loc": [57, 57], "level": 13, "parent": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L56_C4", "vector": [14, 13, 0.6706, 0.0118, 13, 0.02, 0.0, 358, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "path", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " path = '../captures/api/v1/feed.xml'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L59_C4", "label": "if", "type": "if", "loc": [59, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99981:FunctionDef_L33_C2", "vector": [4, 2, 0.7176, 0.0588, 2, 0.28, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if path is None:\n self.send_error(404)\n else:\n logging.warn('Using: %s' % path)\n return open(path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99981:Expr_L60_C6", "label": "send_error()", "type": "expression", "loc": [60, 60], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L59_C4", "vector": [8, 3, 0.7059, 0.0118, 3, 0.88, 0.0, 886, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "send_error", "arg_names": [], "import_names": [], "rhs_call_name": "send_error", "annotation": ""}, "snippet": " self.send_error(404)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99981:Expr_L62_C6", "label": "warn()", "type": "expression", "loc": [62, 62], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L59_C4", "vector": [8, 3, 0.7294, 0.0118, 3, 0.88, 0.5, 960, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "warn", "arg_names": [], "import_names": [], "rhs_call_name": "warn", "annotation": ""}, "snippet": " logging.warn('Using: %s' % path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99981:Return_L63_C6", "label": "return", "type": "return", "loc": [63, 63], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L59_C4", "vector": [13, 3, 0.7412, 0.0118, 3, 0.88, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return open(path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99981:FunctionDef_L65_C2", "label": "send_200", "type": "function", "loc": [65, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99981:ClassDef_L14_C0", "vector": [2, 1, 0.7824, 0.0471, 1, 0.46, 1.0, 966, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "send_200", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def send_200(self):\n self.send_response(200)\n self.send_header('Content-type', 'text/xml')\n self.end_headers()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99981:Expr_L66_C4", "label": "send_response()", "type": "expression", "loc": [66, 66], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99981:FunctionDef_L65_C2", "vector": [8, 2, 0.7765, 0.0118, 2, 0.27, 0.0, 844, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "send_response", "arg_names": [], "import_names": [], "rhs_call_name": "send_response", "annotation": ""}, "snippet": " self.send_response(200)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99981:Expr_L67_C4", "label": "send_header()", "type": "expression", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99981:FunctionDef_L65_C2", "vector": [8, 2, 0.7882, 0.0118, 2, 0.27, 0.5, 81, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "send_header", "arg_names": [], "import_names": [], "rhs_call_name": "send_header", "annotation": ""}, "snippet": " self.send_header('Content-type', 'text/xml')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99981:Expr_L68_C4", "label": "end_headers()", "type": "expression", "loc": [68, 68], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99981:FunctionDef_L65_C2", "vector": [8, 2, 0.8, 0.0118, 2, 0.27, 1.0, 683, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "end_headers", "arg_names": [], "import_names": [], "rhs_call_name": "end_headers", "annotation": ""}, "snippet": " self.end_headers()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99981:FunctionDef_L71_C0", "label": "main", "type": "function", "loc": [71, 81], "level": 0, "parent": null, "vector": [2, 0, 0.8941, 0.1294, 0, 0.66, 0.875, 624, 0, 0, 0, 0, 0, 0, 6], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def main():\n if len(sys.argv) > 1:\n port = int(sys.argv[1])\n else:\n port = 8080\n server_address = ('0.0.0.0', port)\n httpd = BaseHTTPServer.HTTPServer(server_address, RequestHandler)\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L72_C2", "label": "if", "type": "if", "loc": [72, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99981:FunctionDef_L71_C0", "vector": [4, 1, 0.8647, 0.0471, 1, 0.04, 0.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(sys.argv) > 1:\n port = int(sys.argv[1])\n else:\n port = 8080"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99981:Assign_L73_C4", "label": "port = int()", "type": "assigned_variable", "loc": [73, 73], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L72_C2", "vector": [14, 2, 0.8588, 0.0118, 2, 0.21, 0.0, 308, 3, 1, 0, 0, 901, 10, 1], "semantic": {"name": "port", "arg_names": [], "import_names": [], "rhs_call_name": "int", "annotation": ""}, "snippet": " port = int(sys.argv[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99981:Assign_L75_C4", "label": "port =", "type": "assigned_variable", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L72_C2", "vector": [14, 2, 0.8824, 0.0118, 2, 0.21, 1.0, 308, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "port", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " port = 8080"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99981:Assign_L76_C2", "label": "server_address =", "type": "assigned_variable", "loc": [76, 76], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99981:FunctionDef_L71_C0", "vector": [14, 1, 0.8941, 0.0118, 1, 0.04, 0.2, 816, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "server_address", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " server_address = ('0.0.0.0', port)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99981:Assign_L77_C2", "label": "httpd = HTTPServer()", "type": "assigned_variable", "loc": [77, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99981:FunctionDef_L71_C0", "vector": [14, 1, 0.9059, 0.0118, 1, 0.04, 0.4, 471, 3, 2, 0, 0, 258, 10, 1], "semantic": {"name": "httpd", "arg_names": [], "import_names": [], "rhs_call_name": "HTTPServer", "annotation": ""}, "snippet": " httpd = BaseHTTPServer.HTTPServer(server_address, RequestHandler)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99981:Assign_L79_C2", "label": "sa = getsockname()", "type": "assigned_variable", "loc": [79, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99981:FunctionDef_L71_C0", "vector": [14, 1, 0.9294, 0.0118, 1, 0.04, 0.6, 756, 3, 0, 0, 0, 994, 10, 1], "semantic": {"name": "sa", "arg_names": [], "import_names": [], "rhs_call_name": "getsockname", "annotation": ""}, "snippet": " sa = httpd.socket.getsockname()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99981:Expr_L80_C2", "label": "print()", "type": "expression", "loc": [80, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99981:FunctionDef_L71_C0", "vector": [8, 1, 0.9412, 0.0118, 1, 0.04, 0.8, 535, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"Serving HTTP on\", sa[0], \"port\", sa[1], \"...\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99981:Expr_L81_C2", "label": "serve_forever()", "type": "expression", "loc": [81, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99981:FunctionDef_L71_C0", "vector": [8, 1, 0.9529, 0.0118, 1, 0.04, 1.0, 993, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "serve_forever", "arg_names": [], "import_names": [], "rhs_call_name": "serve_forever", "annotation": ""}, "snippet": " httpd.serve_forever()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L84_C0", "label": "if", "type": "if", "loc": [84, 85], "level": 0, "parent": null, "vector": [4, 0, 0.9941, 0.0235, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n main()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99981:Expr_L85_C2", "label": "main()", "type": "expression", "loc": [85, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L84_C0", "vector": [8, 1, 1.0, 0.0118, 1, 0.8, 0.0, 624, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "main", "annotation": ""}, "snippet": " main()"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99981:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99981:Expr_L15_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99981:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99981:FunctionDef_L17_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99981:FunctionDef_L17_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99981:Expr_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99981:FunctionDef_L17_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99981:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99981:FunctionDef_L17_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99981:Expr_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99981:FunctionDef_L17_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99981:Assign_L22_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99981:FunctionDef_L17_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99981:Assign_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99981:FunctionDef_L17_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99981:Assign_L25_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99981:FunctionDef_L17_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L26_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99981:Expr_L27_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L26_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99981:Expr_L28_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99981:FunctionDef_L17_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99981:Expr_L29_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99981:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99981:Assign_L31_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99981:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99981:FunctionDef_L33_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99981:FunctionDef_L33_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99981:Assign_L34_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99981:FunctionDef_L33_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L36_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99981:Assign_L37_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L36_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L38_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99981:Assign_L39_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L38_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L40_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99981:Assign_L41_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L40_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L42_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99981:Assign_L43_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L42_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L44_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99981:Assign_L45_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L44_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L46_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99981:Assign_L47_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L46_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99981:Assign_L49_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L48_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L50_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99981:Assign_L51_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L50_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99981:Assign_L53_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L54_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99981:Assign_L55_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L54_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L56_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L56_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99981:Assign_L57_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99981:FunctionDef_L33_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L59_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99981:Expr_L60_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99981:Expr_L62_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L59_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99981:Return_L63_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99981:ClassDef_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99981:FunctionDef_L65_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99981:FunctionDef_L65_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99981:Expr_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99981:FunctionDef_L65_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99981:Expr_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99981:FunctionDef_L65_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99981:Expr_L68_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99981:FunctionDef_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L72_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L72_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99981:Assign_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L72_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99981:Assign_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99981:FunctionDef_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99981:Assign_L76_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99981:FunctionDef_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99981:Assign_L77_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99981:FunctionDef_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99981:Assign_L79_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99981:FunctionDef_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99981:Expr_L80_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99981:FunctionDef_L71_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99981:Expr_L81_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99981:If_L84_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99981:Expr_L85_C2"}] |
#!/usr/bin/python
import os
import subprocess
import sys
BASEDIR = '../main/src/com/joelapenna/foursquare'
TYPESDIR = '../captures/types/v1'
captures = sys.argv[1:]
if not captures:
captures = os.listdir(TYPESDIR)
for f in captures:
basename = f.split('.')[0]
javaname = ''.join([c.capitalize() for c in basename.split('_')])
fullpath = os.path.join(TYPESDIR, f)
typepath = os.path.join(BASEDIR, 'types', javaname + '.java')
parserpath = os.path.join(BASEDIR, 'parsers', javaname + 'Parser.java')
cmd = 'python gen_class.py %s > %s' % (fullpath, typepath)
print cmd
subprocess.call(cmd, stdout=sys.stdout, shell=True)
cmd = 'python gen_parser.py %s > %s' % (fullpath, parserpath)
print cmd
subprocess.call(cmd, stdout=sys.stdout, shell=True)
| ajibawa-2023/Python-Code-Large/train/row_99982 | 20 | 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_99982:Import_L3_C0", "label": "os import os", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.1111, 0.037, 0, 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_99982:Import_L4_C0", "label": "subprocess import subprocess", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.1481, 0.037, 0, 0.66, 0.1429, 394, 0, 1, 0, 0, 394, 0, 0], "semantic": {"name": "subprocess", "arg_names": [], "import_names": ["subprocess"], "rhs_call_name": "", "annotation": ""}, "snippet": "import subprocess"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99982:Import_L5_C0", "label": "sys import sys", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.1852, 0.037, 0, 0.66, 0.2857, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99982:Assign_L7_C0", "label": "BASEDIR =", "type": "assigned_variable", "loc": [7, 7], "level": 0, "parent": null, "vector": [14, 0, 0.2593, 0.037, 0, 0.66, 0.4286, 914, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "BASEDIR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "BASEDIR = '../main/src/com/joelapenna/foursquare'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99982:Assign_L8_C0", "label": "TYPESDIR =", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.2963, 0.037, 0, 0.66, 0.5714, 369, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "TYPESDIR", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TYPESDIR = '../captures/types/v1'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99982:Assign_L10_C0", "label": "captures =", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.3704, 0.037, 0, 0.66, 0.7143, 890, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "captures", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "captures = sys.argv[1:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99982:If_L11_C0", "label": "if", "type": "if", "loc": [11, 12], "level": 0, "parent": null, "vector": [4, 0, 0.4259, 0.0741, 0, 0.66, 0.8571, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if not captures:\n captures = os.listdir(TYPESDIR)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99982:Assign_L12_C2", "label": "captures = listdir()", "type": "assigned_variable", "loc": [12, 12], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99982:If_L11_C0", "vector": [14, 1, 0.4444, 0.037, 1, 0.24, 0.0, 890, 3, 1, 0, 0, 551, 10, 1], "semantic": {"name": "captures", "arg_names": [], "import_names": [], "rhs_call_name": "listdir", "annotation": ""}, "snippet": " captures = os.listdir(TYPESDIR)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99982:For_L14_C0", "label": "for f", "type": "for", "loc": [14, 27], "level": 0, "parent": null, "vector": [6, 0, 0.7593, 0.5185, 0, 0.66, 1.0, 899, 2, 0, 0, 0, 0, 0, 11], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "for f in captures:\n basename = f.split('.')[0]\n javaname = ''.join([c.capitalize() for c in basename.split('_')])\n fullpath = os.path.join(TYPESDIR, f)\n typepath = os.path.join(BASEDIR, 'types', javaname + '.java')\n parserpath = os.path.join(BASEDIR, 'parsers', javaname + 'Parser.java')\n\n cmd = 'python gen_class.py %s > %s' % (fullpath, typepath)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99982:Assign_L15_C2", "label": "basename =", "type": "assigned_variable", "loc": [15, 15], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99982:For_L14_C0", "vector": [14, 1, 0.5556, 0.037, 1, 0.42, 0.0, 164, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "basename", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " basename = f.split('.')[0]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99982:Assign_L16_C2", "label": "javaname = join()", "type": "assigned_variable", "loc": [16, 16], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99982:For_L14_C0", "vector": [14, 1, 0.5926, 0.037, 1, 0.42, 0.1, 554, 3, 1, 0, 0, 933, 10, 3], "semantic": {"name": "javaname", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " javaname = ''.join([c.capitalize() for c in basename.split('_')])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99982:Assign_L17_C2", "label": "fullpath = join()", "type": "assigned_variable", "loc": [17, 17], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99982:For_L14_C0", "vector": [14, 1, 0.6296, 0.037, 1, 0.42, 0.2, 858, 3, 2, 0, 0, 933, 10, 1], "semantic": {"name": "fullpath", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " fullpath = os.path.join(TYPESDIR, f)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99982:Assign_L18_C2", "label": "typepath = join()", "type": "assigned_variable", "loc": [18, 18], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99982:For_L14_C0", "vector": [14, 1, 0.6667, 0.037, 1, 0.42, 0.3, 428, 3, 3, 0, 0, 933, 10, 1], "semantic": {"name": "typepath", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " typepath = os.path.join(BASEDIR, 'types', javaname + '.java')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99982:Assign_L19_C2", "label": "parserpath = join()", "type": "assigned_variable", "loc": [19, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99982:For_L14_C0", "vector": [14, 1, 0.7037, 0.037, 1, 0.42, 0.4, 114, 3, 3, 0, 0, 933, 10, 1], "semantic": {"name": "parserpath", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " parserpath = os.path.join(BASEDIR, 'parsers', javaname + 'Parser.java')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99982:Assign_L21_C2", "label": "cmd =", "type": "assigned_variable", "loc": [21, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99982:For_L14_C0", "vector": [14, 1, 0.7778, 0.037, 1, 0.42, 0.5, 604, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cmd", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cmd = 'python gen_class.py %s > %s' % (fullpath, typepath)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99982:Expr_L22_C2", "label": "print()", "type": "expression", "loc": [22, 22], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99982:For_L14_C0", "vector": [8, 1, 0.8148, 0.037, 1, 0.42, 0.6, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(cmd)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99982:Expr_L23_C2", "label": "call()", "type": "expression", "loc": [23, 23], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99982:For_L14_C0", "vector": [8, 1, 0.8519, 0.037, 1, 0.42, 0.7, 832, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "call", "arg_names": [], "import_names": [], "rhs_call_name": "call", "annotation": ""}, "snippet": " subprocess.call(cmd, stdout=sys.stdout, shell=True)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99982:Assign_L25_C2", "label": "cmd =", "type": "assigned_variable", "loc": [25, 25], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99982:For_L14_C0", "vector": [14, 1, 0.9259, 0.037, 1, 0.42, 0.8, 604, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cmd", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cmd = 'python gen_parser.py %s > %s' % (fullpath, parserpath)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99982:Expr_L26_C2", "label": "print()", "type": "expression", "loc": [26, 26], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99982:For_L14_C0", "vector": [8, 1, 0.963, 0.037, 1, 0.42, 0.9, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(cmd)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99982:Expr_L27_C2", "label": "call()", "type": "expression", "loc": [27, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99982:For_L14_C0", "vector": [8, 1, 1.0, 0.037, 1, 0.42, 1.0, 832, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "call", "arg_names": [], "import_names": [], "rhs_call_name": "call", "annotation": ""}, "snippet": " subprocess.call(cmd, stdout=sys.stdout, shell=True)"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99982:If_L11_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99982:Assign_L12_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99982:For_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99982:Assign_L15_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99982:For_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99982:Assign_L16_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99982:For_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99982:Assign_L17_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99982:For_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99982:Assign_L18_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99982:For_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99982:Assign_L19_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99982:For_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99982:Assign_L21_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99982:For_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99982:Expr_L22_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99982:For_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99982:Expr_L23_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99982:For_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99982:Assign_L25_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99982:For_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99982:Expr_L26_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99982:For_L14_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99982:Expr_L27_C2"}] |
#!/usr/bin/python
"""
Pull a oAuth protected page from foursquare.
Expects ~/.oget to contain (one on each line):
CONSUMER_KEY
CONSUMER_KEY_SECRET
USERNAME
PASSWORD
Don't forget to chmod 600 the file!
"""
import httplib
import os
import re
import sys
import urllib
import urllib2
import urlparse
import user
from xml.dom import pulldom
from xml.dom import minidom
import oauth
"""From: http://groups.google.com/group/foursquare-api/web/oauth
@consumer = OAuth::Consumer.new("consumer_token","consumer_secret", {
:site => "http://foursquare.com",
:scheme => :header,
:http_method => :post,
:request_token_path => "/oauth/request_token",
:access_token_path => "/oauth/access_token",
:authorize_path => "/oauth/authorize"
})
"""
SERVER = 'api.foursquare.com:80'
CONTENT_TYPE_HEADER = {'Content-Type' :'application/x-www-form-urlencoded'}
SIGNATURE_METHOD = oauth.OAuthSignatureMethod_HMAC_SHA1()
AUTHEXCHANGE_URL = 'http://api.foursquare.com/v1/authexchange'
def parse_auth_response(auth_response):
return (
re.search('<oauth_token>(.*)</oauth_token>', auth_response).groups()[0],
re.search('<oauth_token_secret>(.*)</oauth_token_secret>',
auth_response).groups()[0]
)
def create_signed_oauth_request(username, password, consumer):
oauth_request = oauth.OAuthRequest.from_consumer_and_token(
consumer, http_method='POST', http_url=AUTHEXCHANGE_URL,
parameters=dict(fs_username=username, fs_password=password))
oauth_request.sign_request(SIGNATURE_METHOD, consumer, None)
return oauth_request
def main():
url = urlparse.urlparse(sys.argv[1])
# Nevermind that the query can have repeated keys.
parameters = dict(urlparse.parse_qsl(url.query))
password_file = open(os.path.join(user.home, '.oget'))
lines = [line.strip() for line in password_file.readlines()]
if len(lines) == 4:
cons_key, cons_key_secret, username, password = lines
access_token = None
else:
cons_key, cons_key_secret, username, password, token, secret = lines
access_token = oauth.OAuthToken(token, secret)
consumer = oauth.OAuthConsumer(cons_key, cons_key_secret)
if not access_token:
oauth_request = create_signed_oauth_request(username, password, consumer)
connection = httplib.HTTPConnection(SERVER)
headers = {'Content-Type' :'application/x-www-form-urlencoded'}
connection.request(oauth_request.http_method, AUTHEXCHANGE_URL,
body=oauth_request.to_postdata(), headers=headers)
auth_response = connection.getresponse().read()
token = parse_auth_response(auth_response)
access_token = oauth.OAuthToken(*token)
open(os.path.join(user.home, '.oget'), 'w').write('\n'.join((
cons_key, cons_key_secret, username, password, token[0], token[1])))
oauth_request = oauth.OAuthRequest.from_consumer_and_token(consumer,
access_token, http_method='POST', http_url=url.geturl(),
parameters=parameters)
oauth_request.sign_request(SIGNATURE_METHOD, consumer, access_token)
connection = httplib.HTTPConnection(SERVER)
connection.request(oauth_request.http_method, oauth_request.to_url(),
body=oauth_request.to_postdata(), headers=CONTENT_TYPE_HEADER)
print connection.getresponse().read()
#print minidom.parse(connection.getresponse()).toprettyxml(indent=' ')
if __name__ == '__main__':
main()
| ajibawa-2023/Python-Code-Large/train/row_99983 | 50 | 111 | 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_99983:Expr_L2_C0", "label": "expression", "type": "expression", "loc": [2, 12], "level": 0, "parent": null, "vector": [8, 0, 0.0631, 0.0991, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"\nPull a oAuth protected page from foursquare.\n\nExpects ~/.oget to contain (one on each line):\nCONSUMER_KEY\nCONSUMER_KEY_SECRET\nUSERNAME\nPASSWORD"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99983:Import_L14_C0", "label": "httplib import httplib", "type": "import", "loc": [14, 14], "level": 0, "parent": null, "vector": [1, 0, 0.1261, 0.009, 0, 0.66, 0.05, 2, 0, 1, 0, 0, 2, 0, 0], "semantic": {"name": "httplib", "arg_names": [], "import_names": ["httplib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import httplib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99983:Import_L15_C0", "label": "os import os", "type": "import", "loc": [15, 15], "level": 0, "parent": null, "vector": [1, 0, 0.1351, 0.009, 0, 0.66, 0.1, 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_99983:Import_L16_C0", "label": "re import re", "type": "import", "loc": [16, 16], "level": 0, "parent": null, "vector": [1, 0, 0.1441, 0.009, 0, 0.66, 0.15, 540, 0, 1, 0, 0, 540, 0, 0], "semantic": {"name": "re", "arg_names": [], "import_names": ["re"], "rhs_call_name": "", "annotation": ""}, "snippet": "import re"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99983:Import_L17_C0", "label": "sys import sys", "type": "import", "loc": [17, 17], "level": 0, "parent": null, "vector": [1, 0, 0.1532, 0.009, 0, 0.66, 0.2, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99983:Import_L18_C0", "label": "urllib import urllib", "type": "import", "loc": [18, 18], "level": 0, "parent": null, "vector": [1, 0, 0.1622, 0.009, 0, 0.66, 0.25, 614, 0, 1, 0, 0, 614, 0, 0], "semantic": {"name": "urllib", "arg_names": [], "import_names": ["urllib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import urllib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99983:Import_L19_C0", "label": "urllib2 import urllib2", "type": "import", "loc": [19, 19], "level": 0, "parent": null, "vector": [1, 0, 0.1712, 0.009, 0, 0.66, 0.3, 345, 0, 1, 0, 0, 345, 0, 0], "semantic": {"name": "urllib2", "arg_names": [], "import_names": ["urllib2"], "rhs_call_name": "", "annotation": ""}, "snippet": "import urllib2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99983:Import_L20_C0", "label": "urlparse import urlparse", "type": "import", "loc": [20, 20], "level": 0, "parent": null, "vector": [1, 0, 0.1802, 0.009, 0, 0.66, 0.35, 857, 0, 1, 0, 0, 857, 0, 0], "semantic": {"name": "urlparse", "arg_names": [], "import_names": ["urlparse"], "rhs_call_name": "", "annotation": ""}, "snippet": "import urlparse"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99983:Import_L21_C0", "label": "user import user", "type": "import", "loc": [21, 21], "level": 0, "parent": null, "vector": [1, 0, 0.1892, 0.009, 0, 0.66, 0.4, 503, 0, 1, 0, 0, 503, 0, 0], "semantic": {"name": "user", "arg_names": [], "import_names": ["user"], "rhs_call_name": "", "annotation": ""}, "snippet": "import user"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99983:ImportFrom_L22_C0", "label": "from xml.dom import pulldom", "type": "import", "loc": [22, 22], "level": 0, "parent": null, "vector": [1, 0, 0.1982, 0.009, 0, 0.66, 0.45, 290, 0, 1, 0, 0, 290, 0, 0], "semantic": {"name": "xml.dom", "arg_names": [], "import_names": ["pulldom"], "rhs_call_name": "", "annotation": ""}, "snippet": "from xml.dom import pulldom"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99983:ImportFrom_L23_C0", "label": "from xml.dom import minidom", "type": "import", "loc": [23, 23], "level": 0, "parent": null, "vector": [1, 0, 0.2072, 0.009, 0, 0.66, 0.5, 290, 0, 1, 0, 0, 290, 0, 0], "semantic": {"name": "xml.dom", "arg_names": [], "import_names": ["minidom"], "rhs_call_name": "", "annotation": ""}, "snippet": "from xml.dom import minidom"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99983:Import_L25_C0", "label": "oauth import oauth", "type": "import", "loc": [25, 25], "level": 0, "parent": null, "vector": [1, 0, 0.2252, 0.009, 0, 0.66, 0.55, 234, 0, 1, 0, 0, 234, 0, 0], "semantic": {"name": "oauth", "arg_names": [], "import_names": ["oauth"], "rhs_call_name": "", "annotation": ""}, "snippet": "import oauth"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99983:Expr_L27_C0", "label": "expression", "type": "expression", "loc": [27, 37], "level": 0, "parent": null, "vector": [8, 0, 0.2883, 0.0991, 0, 0.66, 0.6, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"From: http://groups.google.com/group/foursquare-api/web/oauth\n\n@consumer = OAuth::Consumer.new(\"consumer_token\",\"consumer_secret\", {\n :site => \"http://foursquare.com\",\n :scheme => :header,\n :http_method => :post,\n :request_token_path => \"/oauth/request_token\",\n :access_token_path => \"/oauth/access_token\","}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99983:Assign_L39_C0", "label": "SERVER =", "type": "assigned_variable", "loc": [39, 39], "level": 0, "parent": null, "vector": [14, 0, 0.3514, 0.009, 0, 0.66, 0.65, 784, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SERVER", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SERVER = 'api.foursquare.com:80'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99983:Assign_L41_C0", "label": "CONTENT_TYPE_HEADER =", "type": "assigned_variable", "loc": [41, 41], "level": 0, "parent": null, "vector": [14, 0, 0.3694, 0.009, 0, 0.66, 0.7, 415, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "CONTENT_TYPE_HEADER", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "CONTENT_TYPE_HEADER = {'Content-Type' :'application/x-www-form-urlencoded'}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99983:Assign_L43_C0", "label": "SIGNATURE_METHOD = OAuthSignatureMethod_HMAC_SHA1()", "type": "assigned_variable", "loc": [43, 43], "level": 0, "parent": null, "vector": [14, 0, 0.3874, 0.009, 0, 0.66, 0.75, 339, 3, 0, 0, 0, 605, 10, 1], "semantic": {"name": "SIGNATURE_METHOD", "arg_names": [], "import_names": [], "rhs_call_name": "OAuthSignatureMethod_HMAC_SHA1", "annotation": ""}, "snippet": "SIGNATURE_METHOD = oauth.OAuthSignatureMethod_HMAC_SHA1()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99983:Assign_L45_C0", "label": "AUTHEXCHANGE_URL =", "type": "assigned_variable", "loc": [45, 45], "level": 0, "parent": null, "vector": [14, 0, 0.4054, 0.009, 0, 0.66, 0.8, 898, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "AUTHEXCHANGE_URL", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "AUTHEXCHANGE_URL = 'http://api.foursquare.com/v1/authexchange'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99983:FunctionDef_L48_C0", "label": "parse_auth_response", "type": "function", "loc": [48, 53], "level": 0, "parent": null, "vector": [2, 0, 0.455, 0.0541, 0, 0.66, 0.85, 168, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "parse_auth_response", "arg_names": ["auth_response"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def parse_auth_response(auth_response):\n return (\n re.search('<oauth_token>(.*)</oauth_token>', auth_response).groups()[0],\n re.search('<oauth_token_secret>(.*)</oauth_token_secret>',\n auth_response).groups()[0]\n )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99983:Return_L49_C2", "label": "return", "type": "return", "loc": [49, 53], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99983:FunctionDef_L48_C0", "vector": [13, 1, 0.4595, 0.045, 1, 0.05, 0.0, 0, 0, 0, 0, 0, 0, 8, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return (\n re.search('<oauth_token>(.*)</oauth_token>', auth_response).groups()[0],\n re.search('<oauth_token_secret>(.*)</oauth_token_secret>',\n auth_response).groups()[0]\n )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99983:FunctionDef_L56_C0", "label": "create_signed_oauth_request", "type": "function", "loc": [56, 62], "level": 0, "parent": null, "vector": [2, 0, 0.5315, 0.0631, 0, 0.66, 0.9, 448, 0, 3, 1, 0, 0, 0, 3], "semantic": {"name": "create_signed_oauth_request", "arg_names": ["username", "password", "consumer"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def create_signed_oauth_request(username, password, consumer):\n oauth_request = oauth.OAuthRequest.from_consumer_and_token(\n consumer, http_method='POST', http_url=AUTHEXCHANGE_URL,\n parameters=dict(fs_username=username, fs_password=password))\n\n oauth_request.sign_request(SIGNATURE_METHOD, consumer, None)\n return oauth_request"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99983:Assign_L57_C2", "label": "oauth_request = from_consumer_and_token()", "type": "assigned_variable", "loc": [57, 59], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99983:FunctionDef_L56_C0", "vector": [14, 1, 0.5225, 0.027, 1, 0.31, 0.0, 1, 3, 4, 0, 0, 319, 10, 2], "semantic": {"name": "oauth_request", "arg_names": [], "import_names": [], "rhs_call_name": "from_consumer_and_token", "annotation": ""}, "snippet": " oauth_request = oauth.OAuthRequest.from_consumer_and_token(\n consumer, http_method='POST', http_url=AUTHEXCHANGE_URL,\n parameters=dict(fs_username=username, fs_password=password))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99983:Expr_L61_C2", "label": "sign_request()", "type": "expression", "loc": [61, 61], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99983:FunctionDef_L56_C0", "vector": [8, 1, 0.5495, 0.009, 1, 0.31, 0.5, 817, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "sign_request", "arg_names": [], "import_names": [], "rhs_call_name": "sign_request", "annotation": ""}, "snippet": " oauth_request.sign_request(SIGNATURE_METHOD, consumer, None)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99983:Return_L62_C2", "label": "return", "type": "return", "loc": [62, 62], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99983:FunctionDef_L56_C0", "vector": [13, 1, 0.5586, 0.009, 1, 0.31, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return oauth_request"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99983:FunctionDef_L65_C0", "label": "main", "type": "function", "loc": [65, 106], "level": 0, "parent": null, "vector": [2, 0, 0.7703, 0.3784, 0, 0.66, 0.95, 624, 0, 0, 0, 0, 0, 0, 32], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def main():\n url = urlparse.urlparse(sys.argv[1])\n # Nevermind that the query can have repeated keys.\n parameters = dict(urlparse.parse_qsl(url.query))\n\n password_file = open(os.path.join(user.home, '.oget'))\n lines = [line.strip() for line in password_file.readlines()]\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99983:Assign_L66_C2", "label": "url = urlparse()", "type": "assigned_variable", "loc": [66, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99983:FunctionDef_L65_C0", "vector": [14, 1, 0.5946, 0.009, 1, 0.3, 0.0, 789, 3, 1, 0, 0, 857, 10, 1], "semantic": {"name": "url", "arg_names": [], "import_names": [], "rhs_call_name": "urlparse", "annotation": ""}, "snippet": " url = urlparse.urlparse(sys.argv[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99983:Assign_L68_C2", "label": "parameters = dict()", "type": "assigned_variable", "loc": [68, 68], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99983:FunctionDef_L65_C0", "vector": [14, 1, 0.6126, 0.009, 1, 0.3, 0.0909, 29, 3, 1, 0, 0, 827, 10, 2], "semantic": {"name": "parameters", "arg_names": [], "import_names": [], "rhs_call_name": "dict", "annotation": ""}, "snippet": " parameters = dict(urlparse.parse_qsl(url.query))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99983:Assign_L70_C2", "label": "password_file = open()", "type": "assigned_variable", "loc": [70, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99983:FunctionDef_L65_C0", "vector": [14, 1, 0.6306, 0.009, 1, 0.3, 0.1818, 18, 3, 1, 0, 0, 693, 10, 2], "semantic": {"name": "password_file", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": " password_file = open(os.path.join(user.home, '.oget'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99983:Assign_L71_C2", "label": "lines =", "type": "assigned_variable", "loc": [71, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99983:FunctionDef_L65_C0", "vector": [14, 1, 0.6396, 0.009, 1, 0.3, 0.2727, 73, 5, 0, 0, 0, 0, 0, 2], "semantic": {"name": "lines", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " lines = [line.strip() for line in password_file.readlines()]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99983:If_L73_C2", "label": "if", "type": "if", "loc": [73, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99983:FunctionDef_L65_C0", "vector": [4, 1, 0.6802, 0.0541, 1, 0.3, 0.3636, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if len(lines) == 4:\n cons_key, cons_key_secret, username, password = lines\n access_token = None\n else:\n cons_key, cons_key_secret, username, password, token, secret = lines\n access_token = oauth.OAuthToken(token, secret)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99983:Assign_L74_C4", "label": "cons_key, cons_key_secret, username, password =", "type": "assigned_variable", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99983:If_L73_C2", "vector": [14, 2, 0.6667, 0.009, 2, 0.16, 0.0, 564, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cons_key, cons_key_secret, username, password", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cons_key, cons_key_secret, username, password = lines"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99983:Assign_L75_C4", "label": "access_token =", "type": "assigned_variable", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99983:If_L73_C2", "vector": [14, 2, 0.6757, 0.009, 2, 0.16, 0.3333, 797, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "access_token", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " access_token = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99983:Assign_L77_C4", "label": "cons_key, cons_key_secret, username, password, token, secret =", "type": "assigned_variable", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99983:If_L73_C2", "vector": [14, 2, 0.6937, 0.009, 2, 0.16, 0.6667, 616, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "cons_key, cons_key_secret, username, password, token, secret", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " cons_key, cons_key_secret, username, password, token, secret = lines"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99983:Assign_L78_C4", "label": "access_token = OAuthToken()", "type": "assigned_variable", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99983:If_L73_C2", "vector": [14, 2, 0.7027, 0.009, 2, 0.16, 1.0, 797, 3, 2, 0, 0, 512, 10, 1], "semantic": {"name": "access_token", "arg_names": [], "import_names": [], "rhs_call_name": "OAuthToken", "annotation": ""}, "snippet": " access_token = oauth.OAuthToken(token, secret)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99983:Assign_L80_C2", "label": "consumer = OAuthConsumer()", "type": "assigned_variable", "loc": [80, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99983:FunctionDef_L65_C0", "vector": [14, 1, 0.7207, 0.009, 1, 0.3, 0.4545, 352, 3, 2, 0, 0, 660, 10, 1], "semantic": {"name": "consumer", "arg_names": [], "import_names": [], "rhs_call_name": "OAuthConsumer", "annotation": ""}, "snippet": " consumer = oauth.OAuthConsumer(cons_key, cons_key_secret)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99983:If_L82_C2", "label": "if", "type": "if", "loc": [82, 95], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99983:FunctionDef_L65_C0", "vector": [4, 1, 0.7973, 0.1261, 1, 0.3, 0.5455, 0, 0, 0, 0, 0, 0, 0, 12], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not access_token:\n oauth_request = create_signed_oauth_request(username, password, consumer)\n\n connection = httplib.HTTPConnection(SERVER)\n\n headers = {'Content-Type' :'application/x-www-form-urlencoded'}\n connection.request(oauth_request.http_method, AUTHEXCHANGE_URL,\n body=oauth_request.to_postdata(), headers=headers)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99983:Assign_L83_C4", "label": "oauth_request = create_signed_oauth_request()", "type": "assigned_variable", "loc": [83, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99983:If_L82_C2", "vector": [14, 2, 0.7477, 0.009, 2, 0.76, 0.0, 1, 3, 3, 0, 0, 448, 10, 1], "semantic": {"name": "oauth_request", "arg_names": [], "import_names": [], "rhs_call_name": "create_signed_oauth_request", "annotation": ""}, "snippet": " oauth_request = create_signed_oauth_request(username, password, consumer)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99983:Assign_L85_C4", "label": "connection = HTTPConnection()", "type": "assigned_variable", "loc": [85, 85], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99983:If_L82_C2", "vector": [14, 2, 0.7658, 0.009, 2, 0.76, 0.1429, 351, 3, 1, 0, 0, 29, 10, 1], "semantic": {"name": "connection", "arg_names": [], "import_names": [], "rhs_call_name": "HTTPConnection", "annotation": ""}, "snippet": " connection = httplib.HTTPConnection(SERVER)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99983:Assign_L87_C4", "label": "headers =", "type": "assigned_variable", "loc": [87, 87], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99983:If_L82_C2", "vector": [14, 2, 0.7838, 0.009, 2, 0.76, 0.2857, 950, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "headers", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " headers = {'Content-Type' :'application/x-www-form-urlencoded'}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99983:Expr_L88_C4", "label": "request()", "type": "expression", "loc": [88, 89], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99983:If_L82_C2", "vector": [8, 2, 0.7973, 0.018, 2, 0.76, 0.4286, 50, 3, 4, 0, 0, 0, 0, 2], "semantic": {"name": "request", "arg_names": [], "import_names": [], "rhs_call_name": "request", "annotation": ""}, "snippet": " connection.request(oauth_request.http_method, AUTHEXCHANGE_URL,\n body=oauth_request.to_postdata(), headers=headers)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99983:Assign_L91_C4", "label": "auth_response = read()", "type": "assigned_variable", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99983:If_L82_C2", "vector": [14, 2, 0.8198, 0.009, 2, 0.76, 0.5714, 446, 3, 0, 0, 0, 453, 10, 2], "semantic": {"name": "auth_response", "arg_names": [], "import_names": [], "rhs_call_name": "read", "annotation": ""}, "snippet": " auth_response = connection.getresponse().read()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99983:Assign_L92_C4", "label": "token = parse_auth_response()", "type": "assigned_variable", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99983:If_L82_C2", "vector": [14, 2, 0.8288, 0.009, 2, 0.76, 0.7143, 129, 3, 1, 0, 0, 168, 10, 1], "semantic": {"name": "token", "arg_names": [], "import_names": [], "rhs_call_name": "parse_auth_response", "annotation": ""}, "snippet": " token = parse_auth_response(auth_response)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99983:Assign_L93_C4", "label": "access_token = OAuthToken()", "type": "assigned_variable", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99983:If_L82_C2", "vector": [14, 2, 0.8378, 0.009, 2, 0.76, 0.8571, 797, 3, 1, 0, 0, 512, 10, 1], "semantic": {"name": "access_token", "arg_names": [], "import_names": [], "rhs_call_name": "OAuthToken", "annotation": ""}, "snippet": " access_token = oauth.OAuthToken(*token)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99983:Expr_L94_C4", "label": "write()", "type": "expression", "loc": [94, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99983:If_L82_C2", "vector": [8, 2, 0.8514, 0.018, 2, 0.76, 1.0, 837, 3, 1, 0, 0, 0, 0, 4], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " open(os.path.join(user.home, '.oget'), 'w').write('\\n'.join((\n cons_key, cons_key_secret, username, password, token[0], token[1])))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99983:Assign_L97_C2", "label": "oauth_request = from_consumer_and_token()", "type": "assigned_variable", "loc": [97, 99], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99983:FunctionDef_L65_C0", "vector": [14, 1, 0.8829, 0.027, 1, 0.3, 0.6364, 1, 3, 5, 0, 0, 319, 10, 2], "semantic": {"name": "oauth_request", "arg_names": [], "import_names": [], "rhs_call_name": "from_consumer_and_token", "annotation": ""}, "snippet": " oauth_request = oauth.OAuthRequest.from_consumer_and_token(consumer,\n access_token, http_method='POST', http_url=url.geturl(),\n parameters=parameters)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99983:Expr_L100_C2", "label": "sign_request()", "type": "expression", "loc": [100, 100], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99983:FunctionDef_L65_C0", "vector": [8, 1, 0.9009, 0.009, 1, 0.3, 0.7273, 817, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "sign_request", "arg_names": [], "import_names": [], "rhs_call_name": "sign_request", "annotation": ""}, "snippet": " oauth_request.sign_request(SIGNATURE_METHOD, consumer, access_token)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99983:Assign_L102_C2", "label": "connection = HTTPConnection()", "type": "assigned_variable", "loc": [102, 102], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99983:FunctionDef_L65_C0", "vector": [14, 1, 0.9189, 0.009, 1, 0.3, 0.8182, 351, 3, 1, 0, 0, 29, 10, 1], "semantic": {"name": "connection", "arg_names": [], "import_names": [], "rhs_call_name": "HTTPConnection", "annotation": ""}, "snippet": " connection = httplib.HTTPConnection(SERVER)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99983:Expr_L103_C2", "label": "request()", "type": "expression", "loc": [103, 104], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99983:FunctionDef_L65_C0", "vector": [8, 1, 0.9324, 0.018, 1, 0.3, 0.9091, 50, 3, 4, 0, 0, 0, 0, 3], "semantic": {"name": "request", "arg_names": [], "import_names": [], "rhs_call_name": "request", "annotation": ""}, "snippet": " connection.request(oauth_request.http_method, oauth_request.to_url(),\n body=oauth_request.to_postdata(), headers=CONTENT_TYPE_HEADER)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99983:Expr_L106_C2", "label": "print()", "type": "expression", "loc": [106, 106], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99983:FunctionDef_L65_C0", "vector": [8, 1, 0.955, 0.009, 1, 0.3, 1.0, 535, 3, 1, 0, 0, 0, 0, 3], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(connection.getresponse().read())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99983:If_L110_C0", "label": "if", "type": "if", "loc": [110, 111], "level": 0, "parent": null, "vector": [4, 0, 0.9955, 0.018, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n main()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99983:Expr_L111_C2", "label": "main()", "type": "expression", "loc": [111, 111], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99983:If_L110_C0", "vector": [8, 1, 1.0, 0.009, 1, 0.16, 0.0, 624, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "main", "annotation": ""}, "snippet": " main()"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99983:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99983:Return_L49_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99983:FunctionDef_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99983:Assign_L57_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99983:FunctionDef_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99983:Expr_L61_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99983:FunctionDef_L56_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99983:Return_L62_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99983:FunctionDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99983:Assign_L66_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99983:FunctionDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99983:Assign_L68_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99983:FunctionDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99983:Assign_L70_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99983:FunctionDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99983:Assign_L71_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99983:FunctionDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99983:If_L73_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99983:If_L73_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99983:Assign_L74_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99983:If_L73_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99983:Assign_L75_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99983:If_L73_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99983:Assign_L77_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99983:If_L73_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99983:Assign_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99983:FunctionDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99983:Assign_L80_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99983:FunctionDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99983:If_L82_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99983:If_L82_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99983:Assign_L83_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99983:If_L82_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99983:Assign_L85_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99983:If_L82_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99983:Assign_L87_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99983:If_L82_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99983:Expr_L88_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99983:If_L82_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99983:Assign_L91_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99983:If_L82_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99983:Assign_L92_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99983:If_L82_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99983:Assign_L93_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99983:If_L82_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99983:Expr_L94_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99983:FunctionDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99983:Assign_L97_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99983:FunctionDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99983:Expr_L100_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99983:FunctionDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99983:Assign_L102_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99983:FunctionDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99983:Expr_L103_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99983:FunctionDef_L65_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99983:Expr_L106_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99983:If_L110_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99983:Expr_L111_C2"}] |
#!/usr/bin/python
import datetime
import sys
import textwrap
import common
from xml.dom import pulldom
PARSER = """\
/**
* Copyright 2009 Joe LaPenna
*/
package com.joelapenna.foursquare.parsers;
import com.joelapenna.foursquare.Foursquare;
import com.joelapenna.foursquare.error.FoursquareError;
import com.joelapenna.foursquare.error.FoursquareParseException;
import com.joelapenna.foursquare.types.%(type_name)s;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
* Auto-generated: %(timestamp)s
*
* @author Joe LaPenna (joe@joelapenna.com)
* @param <T>
*/
public class %(type_name)sParser extends AbstractParser<%(type_name)s> {
private static final Logger LOG = Logger.getLogger(%(type_name)sParser.class.getCanonicalName());
private static final boolean DEBUG = Foursquare.PARSER_DEBUG;
@Override
public %(type_name)s parseInner(XmlPullParser parser) throws XmlPullParserException, IOException,
FoursquareError, FoursquareParseException {
parser.require(XmlPullParser.START_TAG, null, null);
%(type_name)s %(top_node_name)s = new %(type_name)s();
while (parser.nextTag() == XmlPullParser.START_TAG) {
String name = parser.getName();
%(stanzas)s
} else {
// Consume something we don't understand.
if (DEBUG) LOG.log(Level.FINE, "Found tag that we don't recognize: " + name);
skipSubTree(parser);
}
}
return %(top_node_name)s;
}
}"""
BOOLEAN_STANZA = """\
} else if ("%(name)s".equals(name)) {
%(top_node_name)s.set%(camel_name)s(Boolean.valueOf(parser.nextText()));
"""
GROUP_STANZA = """\
} else if ("%(name)s".equals(name)) {
%(top_node_name)s.set%(camel_name)s(new GroupParser(new %(sub_parser_camel_case)s()).parse(parser));
"""
COMPLEX_STANZA = """\
} else if ("%(name)s".equals(name)) {
%(top_node_name)s.set%(camel_name)s(new %(parser_name)s().parse(parser));
"""
STANZA = """\
} else if ("%(name)s".equals(name)) {
%(top_node_name)s.set%(camel_name)s(parser.nextText());
"""
def main():
type_name, top_node_name, attributes = common.WalkNodesForAttributes(
sys.argv[1])
GenerateClass(type_name, top_node_name, attributes)
def GenerateClass(type_name, top_node_name, attributes):
"""generate it.
type_name: the type of object the parser returns
top_node_name: the name of the object the parser returns.
per common.WalkNodsForAttributes
"""
stanzas = []
for name in sorted(attributes):
typ, children = attributes[name]
replacements = Replacements(top_node_name, name, typ, children)
if typ == common.BOOLEAN:
stanzas.append(BOOLEAN_STANZA % replacements)
elif typ == common.GROUP:
stanzas.append(GROUP_STANZA % replacements)
elif typ in common.COMPLEX:
stanzas.append(COMPLEX_STANZA % replacements)
else:
stanzas.append(STANZA % replacements)
if stanzas:
# pop off the extranious } else for the first conditional stanza.
stanzas[0] = stanzas[0].replace('} else ', '', 1)
replacements = Replacements(top_node_name, name, typ, [None])
replacements['stanzas'] = '\n'.join(stanzas).strip()
print PARSER % replacements
def Replacements(top_node_name, name, typ, children):
# CameCaseClassName
type_name = ''.join([word.capitalize() for word in top_node_name.split('_')])
# CamelCaseClassName
camel_name = ''.join([word.capitalize() for word in name.split('_')])
# camelCaseLocalName
attribute_name = camel_name.lower().capitalize()
# mFieldName
field_name = 'm' + camel_name
if children[0]:
sub_parser_camel_case = children[0] + 'Parser'
else:
sub_parser_camel_case = (camel_name[:-1] + 'Parser')
return {
'type_name': type_name,
'name': name,
'top_node_name': top_node_name,
'camel_name': camel_name,
'parser_name': typ + 'Parser',
'attribute_name': attribute_name,
'field_name': field_name,
'typ': typ,
'timestamp': datetime.datetime.now(),
'sub_parser_camel_case': sub_parser_camel_case,
'sub_type': children[0]
}
if __name__ == '__main__':
main()
| ajibawa-2023/Python-Code-Large/train/row_99984 | 42 | 149 | 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_99984:Import_L3_C0", "label": "datetime import datetime", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0201, 0.0067, 0, 0.66, 0.0, 426, 0, 1, 0, 0, 426, 0, 0], "semantic": {"name": "datetime", "arg_names": [], "import_names": ["datetime"], "rhs_call_name": "", "annotation": ""}, "snippet": "import datetime"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99984:Import_L4_C0", "label": "sys import sys", "type": "import", "loc": [4, 4], "level": 0, "parent": null, "vector": [1, 0, 0.0268, 0.0067, 0, 0.66, 0.0769, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99984:Import_L5_C0", "label": "textwrap import textwrap", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0336, 0.0067, 0, 0.66, 0.1538, 641, 0, 1, 0, 0, 641, 0, 0], "semantic": {"name": "textwrap", "arg_names": [], "import_names": ["textwrap"], "rhs_call_name": "", "annotation": ""}, "snippet": "import textwrap"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99984:Import_L7_C0", "label": "common import common", "type": "import", "loc": [7, 7], "level": 0, "parent": null, "vector": [1, 0, 0.047, 0.0067, 0, 0.66, 0.2308, 718, 0, 1, 0, 0, 718, 0, 0], "semantic": {"name": "common", "arg_names": [], "import_names": ["common"], "rhs_call_name": "", "annotation": ""}, "snippet": "import common"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99984:ImportFrom_L9_C0", "label": "from xml.dom import pulldom", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0604, 0.0067, 0, 0.66, 0.3077, 290, 0, 1, 0, 0, 290, 0, 0], "semantic": {"name": "xml.dom", "arg_names": [], "import_names": ["pulldom"], "rhs_call_name": "", "annotation": ""}, "snippet": "from xml.dom import pulldom"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99984:Assign_L11_C0", "label": "PARSER =", "type": "assigned_variable", "loc": [11, 59], "level": 0, "parent": null, "vector": [14, 0, 0.2349, 0.3289, 0, 0.66, 0.3846, 92, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "PARSER", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "PARSER = \"\"\"\\\n/**\n * Copyright 2009 Joe LaPenna\n */\n\npackage com.joelapenna.foursquare.parsers;\n\nimport com.joelapenna.foursquare.Foursquare;"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99984:Assign_L61_C0", "label": "BOOLEAN_STANZA =", "type": "assigned_variable", "loc": [61, 64], "level": 0, "parent": null, "vector": [14, 0, 0.4195, 0.0268, 0, 0.66, 0.4615, 839, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "BOOLEAN_STANZA", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "BOOLEAN_STANZA = \"\"\"\\\n } else if (\"%(name)s\".equals(name)) {\n %(top_node_name)s.set%(camel_name)s(Boolean.valueOf(parser.nextText()));\n\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99984:Assign_L66_C0", "label": "GROUP_STANZA =", "type": "assigned_variable", "loc": [66, 69], "level": 0, "parent": null, "vector": [14, 0, 0.453, 0.0268, 0, 0.66, 0.5385, 306, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "GROUP_STANZA", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "GROUP_STANZA = \"\"\"\\\n } else if (\"%(name)s\".equals(name)) {\n %(top_node_name)s.set%(camel_name)s(new GroupParser(new %(sub_parser_camel_case)s()).parse(parser));\n\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99984:Assign_L71_C0", "label": "COMPLEX_STANZA =", "type": "assigned_variable", "loc": [71, 74], "level": 0, "parent": null, "vector": [14, 0, 0.4866, 0.0268, 0, 0.66, 0.6154, 61, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "COMPLEX_STANZA", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "COMPLEX_STANZA = \"\"\"\\\n } else if (\"%(name)s\".equals(name)) {\n %(top_node_name)s.set%(camel_name)s(new %(parser_name)s().parse(parser));\n\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99984:Assign_L76_C0", "label": "STANZA =", "type": "assigned_variable", "loc": [76, 79], "level": 0, "parent": null, "vector": [14, 0, 0.5201, 0.0268, 0, 0.66, 0.6923, 276, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "STANZA", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "STANZA = \"\"\"\\\n } else if (\"%(name)s\".equals(name)) {\n %(top_node_name)s.set%(camel_name)s(parser.nextText());\n\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99984:FunctionDef_L82_C0", "label": "main", "type": "function", "loc": [82, 85], "level": 0, "parent": null, "vector": [2, 0, 0.5604, 0.0268, 0, 0.66, 0.7692, 624, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def main():\n type_name, top_node_name, attributes = common.WalkNodesForAttributes(\n sys.argv[1])\n GenerateClass(type_name, top_node_name, attributes)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99984:Assign_L83_C2", "label": "type_name, top_node_name, attributes = WalkNodesForAttributes()", "type": "assigned_variable", "loc": [83, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99984:FunctionDef_L82_C0", "vector": [14, 1, 0.5604, 0.0134, 1, 0.93, 0.0, 244, 3, 1, 0, 0, 612, 10, 1], "semantic": {"name": "type_name, top_node_name, attributes", "arg_names": [], "import_names": [], "rhs_call_name": "WalkNodesForAttributes", "annotation": ""}, "snippet": " type_name, top_node_name, attributes = common.WalkNodesForAttributes(\n sys.argv[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99984:Expr_L85_C2", "label": "GenerateClass()", "type": "expression", "loc": [85, 85], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99984:FunctionDef_L82_C0", "vector": [8, 1, 0.5705, 0.0067, 1, 0.93, 1.0, 578, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "GenerateClass", "arg_names": [], "import_names": [], "rhs_call_name": "GenerateClass", "annotation": ""}, "snippet": " GenerateClass(type_name, top_node_name, attributes)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99984:FunctionDef_L88_C0", "label": "GenerateClass", "type": "function", "loc": [88, 115], "level": 0, "parent": null, "vector": [2, 0, 0.6812, 0.1879, 0, 0.66, 0.8462, 578, 0, 3, 0, 0, 0, 0, 11], "semantic": {"name": "GenerateClass", "arg_names": ["type_name", "top_node_name", "attributes"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def GenerateClass(type_name, top_node_name, attributes):\n \"\"\"generate it.\n type_name: the type of object the parser returns\n top_node_name: the name of the object the parser returns.\n per common.WalkNodsForAttributes\n \"\"\"\n stanzas = []\n for name in sorted(attributes):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99984:Expr_L89_C2", "label": "expression", "type": "expression", "loc": [89, 93], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99984:FunctionDef_L88_C0", "vector": [8, 1, 0.6107, 0.0336, 1, 0.45, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"generate it.\n type_name: the type of object the parser returns\n top_node_name: the name of the object the parser returns.\n per common.WalkNodsForAttributes\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99984:Assign_L94_C2", "label": "stanzas =", "type": "assigned_variable", "loc": [94, 94], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99984:FunctionDef_L88_C0", "vector": [14, 1, 0.6309, 0.0067, 1, 0.45, 0.1667, 232, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "stanzas", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " stanzas = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99984:For_L95_C2", "label": "for name", "type": "for", "loc": [95, 108], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99984:FunctionDef_L88_C0", "vector": [6, 1, 0.6812, 0.094, 1, 0.45, 0.3333, 57, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for name in sorted(attributes):\n typ, children = attributes[name]\n replacements = Replacements(top_node_name, name, typ, children)\n if typ == common.BOOLEAN:\n stanzas.append(BOOLEAN_STANZA % replacements)\n\n elif typ == common.GROUP:\n stanzas.append(GROUP_STANZA % replacements)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99984:Assign_L96_C4", "label": "typ, children =", "type": "assigned_variable", "loc": [96, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99984:For_L95_C2", "vector": [14, 2, 0.6443, 0.0067, 2, 0.78, 0.0, 844, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "typ, children", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " typ, children = attributes[name]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99984:Assign_L97_C4", "label": "replacements = Replacements()", "type": "assigned_variable", "loc": [97, 97], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99984:For_L95_C2", "vector": [14, 2, 0.651, 0.0067, 2, 0.78, 0.5, 403, 3, 4, 0, 0, 695, 10, 1], "semantic": {"name": "replacements", "arg_names": [], "import_names": [], "rhs_call_name": "Replacements", "annotation": ""}, "snippet": " replacements = Replacements(top_node_name, name, typ, children)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99984:If_L98_C4", "label": "if", "type": "if", "loc": [98, 108], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99984:For_L95_C2", "vector": [4, 2, 0.6913, 0.0738, 2, 0.78, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if typ == common.BOOLEAN:\n stanzas.append(BOOLEAN_STANZA % replacements)\n\n elif typ == common.GROUP:\n stanzas.append(GROUP_STANZA % replacements)\n\n elif typ in common.COMPLEX:\n stanzas.append(COMPLEX_STANZA % replacements)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99984:Expr_L99_C6", "label": "append()", "type": "expression", "loc": [99, 99], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99984:If_L98_C4", "vector": [8, 3, 0.6644, 0.0067, 3, 0.39, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " stanzas.append(BOOLEAN_STANZA % replacements)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99984:If_L101_C4", "label": "if", "type": "if", "loc": [101, 108], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99984:If_L98_C4", "vector": [4, 3, 0.7013, 0.0537, 3, 0.39, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif typ == common.GROUP:\n stanzas.append(GROUP_STANZA % replacements)\n\n elif typ in common.COMPLEX:\n stanzas.append(COMPLEX_STANZA % replacements)\n\n else:\n stanzas.append(STANZA % replacements)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99984:Expr_L102_C6", "label": "append()", "type": "expression", "loc": [102, 102], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99984:If_L101_C4", "vector": [8, 4, 0.6846, 0.0067, 4, 0.75, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " stanzas.append(GROUP_STANZA % replacements)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99984:If_L104_C4", "label": "if", "type": "if", "loc": [104, 108], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99984:If_L101_C4", "vector": [4, 4, 0.7114, 0.0336, 4, 0.75, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif typ in common.COMPLEX:\n stanzas.append(COMPLEX_STANZA % replacements)\n\n else:\n stanzas.append(STANZA % replacements)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99984:Expr_L105_C6", "label": "append()", "type": "expression", "loc": [105, 105], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99984:If_L104_C4", "vector": [8, 5, 0.7047, 0.0067, 5, 0.71, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " stanzas.append(COMPLEX_STANZA % replacements)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99984:Expr_L108_C6", "label": "append()", "type": "expression", "loc": [108, 108], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99984:If_L104_C4", "vector": [8, 5, 0.7248, 0.0067, 5, 0.71, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " stanzas.append(STANZA % replacements)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99984:If_L109_C2", "label": "if", "type": "if", "loc": [109, 111], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99984:FunctionDef_L88_C0", "vector": [4, 1, 0.7383, 0.0201, 1, 0.45, 0.5, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if stanzas:\n # pop off the extranious } else for the first conditional stanza.\n stanzas[0] = stanzas[0].replace('} else ', '', 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99984:Assign_L111_C4", "label": " = replace()", "type": "assigned_variable", "loc": [111, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99984:If_L109_C2", "vector": [14, 2, 0.745, 0.0067, 2, 0.78, 0.0, 0, 3, 3, 0, 0, 293, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "replace", "annotation": ""}, "snippet": " stanzas[0] = stanzas[0].replace('} else ', '', 1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99984:Assign_L113_C2", "label": "replacements = Replacements()", "type": "assigned_variable", "loc": [113, 113], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99984:FunctionDef_L88_C0", "vector": [14, 1, 0.7584, 0.0067, 1, 0.45, 0.6667, 403, 3, 4, 0, 0, 695, 10, 1], "semantic": {"name": "replacements", "arg_names": [], "import_names": [], "rhs_call_name": "Replacements", "annotation": ""}, "snippet": " replacements = Replacements(top_node_name, name, typ, [None])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99984:Assign_L114_C2", "label": " = strip()", "type": "assigned_variable", "loc": [114, 114], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99984:FunctionDef_L88_C0", "vector": [14, 1, 0.7651, 0.0067, 1, 0.45, 0.8333, 0, 3, 0, 0, 0, 973, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "strip", "annotation": ""}, "snippet": " replacements['stanzas'] = '\\n'.join(stanzas).strip()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99984:Expr_L115_C2", "label": "print()", "type": "expression", "loc": [115, 115], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99984:FunctionDef_L88_C0", "vector": [8, 1, 0.7718, 0.0067, 1, 0.45, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(PARSER % replacements)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99984:FunctionDef_L118_C0", "label": "Replacements", "type": "function", "loc": [118, 145], "level": 0, "parent": null, "vector": [2, 0, 0.8826, 0.1879, 0, 0.66, 0.9231, 695, 0, 4, 1, 0, 0, 0, 9], "semantic": {"name": "Replacements", "arg_names": ["top_node_name", "name", "typ", "children"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def Replacements(top_node_name, name, typ, children):\n # CameCaseClassName\n type_name = ''.join([word.capitalize() for word in top_node_name.split('_')])\n # CamelCaseClassName\n camel_name = ''.join([word.capitalize() for word in name.split('_')])\n # camelCaseLocalName\n attribute_name = camel_name.lower().capitalize()\n # mFieldName"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99984:Assign_L120_C2", "label": "type_name = join()", "type": "assigned_variable", "loc": [120, 120], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99984:FunctionDef_L118_C0", "vector": [14, 1, 0.8054, 0.0067, 1, 0.59, 0.0, 81, 3, 1, 0, 0, 933, 10, 3], "semantic": {"name": "type_name", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " type_name = ''.join([word.capitalize() for word in top_node_name.split('_')])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99984:Assign_L122_C2", "label": "camel_name = join()", "type": "assigned_variable", "loc": [122, 122], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99984:FunctionDef_L118_C0", "vector": [14, 1, 0.8188, 0.0067, 1, 0.59, 0.2, 510, 3, 1, 0, 0, 933, 10, 3], "semantic": {"name": "camel_name", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " camel_name = ''.join([word.capitalize() for word in name.split('_')])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99984:Assign_L124_C2", "label": "attribute_name = capitalize()", "type": "assigned_variable", "loc": [124, 124], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99984:FunctionDef_L118_C0", "vector": [14, 1, 0.8322, 0.0067, 1, 0.59, 0.4, 592, 3, 0, 0, 0, 353, 10, 2], "semantic": {"name": "attribute_name", "arg_names": [], "import_names": [], "rhs_call_name": "capitalize", "annotation": ""}, "snippet": " attribute_name = camel_name.lower().capitalize()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99984:Assign_L126_C2", "label": "field_name =", "type": "assigned_variable", "loc": [126, 126], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99984:FunctionDef_L118_C0", "vector": [14, 1, 0.8456, 0.0067, 1, 0.59, 0.6, 918, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "field_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " field_name = 'm' + camel_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99984:If_L128_C2", "label": "if", "type": "if", "loc": [128, 131], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99984:FunctionDef_L118_C0", "vector": [4, 1, 0.8691, 0.0268, 1, 0.59, 0.8, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if children[0]:\n sub_parser_camel_case = children[0] + 'Parser'\n else:\n sub_parser_camel_case = (camel_name[:-1] + 'Parser')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99984:Assign_L129_C4", "label": "sub_parser_camel_case =", "type": "assigned_variable", "loc": [129, 129], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99984:If_L128_C2", "vector": [14, 2, 0.8658, 0.0067, 2, 0.83, 0.0, 187, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "sub_parser_camel_case", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sub_parser_camel_case = children[0] + 'Parser'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99984:Assign_L131_C4", "label": "sub_parser_camel_case =", "type": "assigned_variable", "loc": [131, 131], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99984:If_L128_C2", "vector": [14, 2, 0.8792, 0.0067, 2, 0.83, 1.0, 187, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "sub_parser_camel_case", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " sub_parser_camel_case = (camel_name[:-1] + 'Parser')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99984:Return_L133_C2", "label": "return", "type": "return", "loc": [133, 145], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99984:FunctionDef_L118_C0", "vector": [13, 1, 0.9329, 0.0872, 1, 0.59, 1.0, 0, 0, 0, 0, 0, 0, 6, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return {\n 'type_name': type_name,\n 'name': name,\n 'top_node_name': top_node_name,\n 'camel_name': camel_name,\n 'parser_name': typ + 'Parser',\n 'attribute_name': attribute_name,\n 'field_name': field_name,"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99984:If_L148_C0", "label": "if", "type": "if", "loc": [148, 149], "level": 0, "parent": null, "vector": [4, 0, 0.9966, 0.0134, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n main()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99984:Expr_L149_C2", "label": "main()", "type": "expression", "loc": [149, 149], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99984:If_L148_C0", "vector": [8, 1, 1.0, 0.0067, 1, 0.6, 0.0, 624, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "main", "annotation": ""}, "snippet": " main()"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99984:FunctionDef_L82_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99984:Assign_L83_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99984:FunctionDef_L82_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99984:Expr_L85_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99984:FunctionDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99984:Expr_L89_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99984:FunctionDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99984:Assign_L94_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99984:FunctionDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99984:For_L95_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99984:For_L95_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99984:Assign_L96_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99984:For_L95_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99984:Assign_L97_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99984:For_L95_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99984:If_L98_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99984:If_L98_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99984:Expr_L99_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99984:If_L98_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99984:If_L101_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99984:If_L101_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99984:Expr_L102_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99984:If_L101_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99984:If_L104_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99984:If_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99984:Expr_L105_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99984:If_L104_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99984:Expr_L108_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99984:FunctionDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99984:If_L109_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99984:If_L109_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99984:Assign_L111_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99984:FunctionDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99984:Assign_L113_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99984:FunctionDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99984:Assign_L114_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99984:FunctionDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99984:Expr_L115_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99984:FunctionDef_L118_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99984:Assign_L120_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99984:FunctionDef_L118_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99984:Assign_L122_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99984:FunctionDef_L118_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99984:Assign_L124_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99984:FunctionDef_L118_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99984:Assign_L126_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99984:FunctionDef_L118_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99984:If_L128_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99984:If_L128_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99984:Assign_L129_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99984:If_L128_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99984:Assign_L131_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99984:FunctionDef_L118_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99984:Return_L133_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99984:If_L148_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99984:Expr_L149_C2"}] |
#!/usr/bin/python
import logging
from xml.dom import minidom
from xml.dom import pulldom
BOOLEAN = "boolean"
STRING = "String"
GROUP = "Group"
# Interfaces that all FoursquareTypes implement.
DEFAULT_INTERFACES = ['FoursquareType']
# Interfaces that specific FoursqureTypes implement.
INTERFACES = {
}
DEFAULT_CLASS_IMPORTS = [
]
CLASS_IMPORTS = {
# 'Checkin': DEFAULT_CLASS_IMPORTS + [
# 'import com.joelapenna.foursquare.filters.VenueFilterable'
# ],
# 'Venue': DEFAULT_CLASS_IMPORTS + [
# 'import com.joelapenna.foursquare.filters.VenueFilterable'
# ],
# 'Tip': DEFAULT_CLASS_IMPORTS + [
# 'import com.joelapenna.foursquare.filters.VenueFilterable'
# ],
}
COMPLEX = [
'Group',
'Badge',
'Beenhere',
'Checkin',
'CheckinResponse',
'City',
'Credentials',
'Data',
'Mayor',
'Rank',
'Score',
'Scoring',
'Settings',
'Stats',
'Tags',
'Tip',
'User',
'Venue',
]
TYPES = COMPLEX + ['boolean']
def WalkNodesForAttributes(path):
"""Parse the xml file getting all attributes.
<venue>
<attribute>value</attribute>
</venue>
Returns:
type_name - The java-style name the top node will have. "Venue"
top_node_name - unadultured name of the xml stanza, probably the type of
java class we're creating. "venue"
attributes - {'attribute': 'value'}
"""
doc = pulldom.parse(path)
type_name = None
top_node_name = None
attributes = {}
level = 0
for event, node in doc:
# For skipping parts of a tree.
if level > 0:
if event == pulldom.END_ELEMENT:
level-=1
logging.warn('(%s) Skip end: %s' % (str(level), node))
continue
elif event == pulldom.START_ELEMENT:
logging.warn('(%s) Skipping: %s' % (str(level), node))
level+=1
continue
if event == pulldom.START_ELEMENT:
logging.warn('Parsing: ' + node.tagName)
# Get the type name to use.
if type_name is None:
type_name = ''.join([word.capitalize()
for word in node.tagName.split('_')])
top_node_name = node.tagName
logging.warn('Found Top Node Name: ' + top_node_name)
continue
typ = node.getAttribute('type')
child = node.getAttribute('child')
# We don't want to walk complex types.
if typ in COMPLEX:
logging.warn('Found Complex: ' + node.tagName)
level = 1
elif typ not in TYPES:
logging.warn('Found String: ' + typ)
typ = STRING
else:
logging.warn('Found Type: ' + typ)
logging.warn('Adding: ' + str((node, typ)))
attributes.setdefault(node.tagName, (typ, [child]))
logging.warn('Attr: ' + str((type_name, top_node_name, attributes)))
return type_name, top_node_name, attributes
| ajibawa-2023/Python-Code-Large/train/row_99985 | 44 | 114 | 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_99985:Import_L3_C0", "label": "logging import logging", "type": "import", "loc": [3, 3], "level": 0, "parent": null, "vector": [1, 0, 0.0263, 0.0088, 0, 0.66, 0.0, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "logging", "arg_names": [], "import_names": ["logging"], "rhs_call_name": "", "annotation": ""}, "snippet": "import logging"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99985:ImportFrom_L5_C0", "label": "from xml.dom import minidom", "type": "import", "loc": [5, 5], "level": 0, "parent": null, "vector": [1, 0, 0.0439, 0.0088, 0, 0.66, 0.0833, 290, 0, 1, 0, 0, 290, 0, 0], "semantic": {"name": "xml.dom", "arg_names": [], "import_names": ["minidom"], "rhs_call_name": "", "annotation": ""}, "snippet": "from xml.dom import minidom"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99985:ImportFrom_L6_C0", "label": "from xml.dom import pulldom", "type": "import", "loc": [6, 6], "level": 0, "parent": null, "vector": [1, 0, 0.0526, 0.0088, 0, 0.66, 0.1667, 290, 0, 1, 0, 0, 290, 0, 0], "semantic": {"name": "xml.dom", "arg_names": [], "import_names": ["pulldom"], "rhs_call_name": "", "annotation": ""}, "snippet": "from xml.dom import pulldom"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99985:Assign_L8_C0", "label": "BOOLEAN =", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.0702, 0.0088, 0, 0.66, 0.25, 310, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "BOOLEAN", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "BOOLEAN = \"boolean\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99985:Assign_L9_C0", "label": "STRING =", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.0789, 0.0088, 0, 0.66, 0.3333, 560, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "STRING", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "STRING = \"String\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99985:Assign_L10_C0", "label": "GROUP =", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.0877, 0.0088, 0, 0.66, 0.4167, 39, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "GROUP", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "GROUP = \"Group\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99985:Assign_L14_C0", "label": "DEFAULT_INTERFACES =", "type": "assigned_variable", "loc": [14, 14], "level": 0, "parent": null, "vector": [14, 0, 0.1228, 0.0088, 0, 0.66, 0.5, 228, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "DEFAULT_INTERFACES", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DEFAULT_INTERFACES = ['FoursquareType']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99985:Assign_L17_C0", "label": "INTERFACES =", "type": "assigned_variable", "loc": [17, 18], "level": 0, "parent": null, "vector": [14, 0, 0.1535, 0.0175, 0, 0.66, 0.5833, 296, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "INTERFACES", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "INTERFACES = {\n}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99985:Assign_L20_C0", "label": "DEFAULT_CLASS_IMPORTS =", "type": "assigned_variable", "loc": [20, 21], "level": 0, "parent": null, "vector": [14, 0, 0.1798, 0.0175, 0, 0.66, 0.6667, 786, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "DEFAULT_CLASS_IMPORTS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "DEFAULT_CLASS_IMPORTS = [\n]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99985:Assign_L23_C0", "label": "CLASS_IMPORTS =", "type": "assigned_variable", "loc": [23, 33], "level": 0, "parent": null, "vector": [14, 0, 0.2456, 0.0965, 0, 0.66, 0.75, 103, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "CLASS_IMPORTS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "CLASS_IMPORTS = {\n# 'Checkin': DEFAULT_CLASS_IMPORTS + [\n# 'import com.joelapenna.foursquare.filters.VenueFilterable'\n# ],\n# 'Venue': DEFAULT_CLASS_IMPORTS + [\n# 'import com.joelapenna.foursquare.filters.VenueFilterable'\n# ],\n# 'Tip': DEFAULT_CLASS_IMPORTS + ["}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99985:Assign_L36_C0", "label": "COMPLEX =", "type": "assigned_variable", "loc": [36, 55], "level": 0, "parent": null, "vector": [14, 0, 0.3991, 0.1754, 0, 0.66, 0.8333, 78, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "COMPLEX", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "COMPLEX = [\n 'Group',\n 'Badge',\n 'Beenhere',\n 'Checkin',\n 'CheckinResponse',\n 'City',\n 'Credentials',"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99985:Assign_L56_C0", "label": "TYPES =", "type": "assigned_variable", "loc": [56, 56], "level": 0, "parent": null, "vector": [14, 0, 0.4912, 0.0088, 0, 0.66, 0.9167, 493, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "TYPES", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "TYPES = COMPLEX + ['boolean']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99985:FunctionDef_L59_C0", "label": "WalkNodesForAttributes", "type": "function", "loc": [59, 114], "level": 0, "parent": null, "vector": [2, 0, 0.7588, 0.4912, 0, 0.66, 1.0, 612, 0, 1, 1, 0, 0, 0, 20], "semantic": {"name": "WalkNodesForAttributes", "arg_names": ["path"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def WalkNodesForAttributes(path):\n \"\"\"Parse the xml file getting all attributes.\n <venue>\n <attribute>value</attribute>\n </venue>\n\n Returns:\n type_name - The java-style name the top node will have. \"Venue\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99985:Expr_L60_C2", "label": "expression", "type": "expression", "loc": [60, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99985:FunctionDef_L59_C0", "vector": [8, 1, 0.5702, 0.0965, 1, 0.35, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Parse the xml file getting all attributes.\n <venue>\n <attribute>value</attribute>\n </venue>\n\n Returns:\n type_name - The java-style name the top node will have. \"Venue\"\n top_node_name - unadultured name of the xml stanza, probably the type of"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99985:Assign_L71_C2", "label": "doc = parse()", "type": "assigned_variable", "loc": [71, 71], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99985:FunctionDef_L59_C0", "vector": [14, 1, 0.6228, 0.0088, 1, 0.35, 0.125, 555, 3, 1, 0, 0, 678, 10, 1], "semantic": {"name": "doc", "arg_names": [], "import_names": [], "rhs_call_name": "parse", "annotation": ""}, "snippet": " doc = pulldom.parse(path)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99985:Assign_L73_C2", "label": "type_name =", "type": "assigned_variable", "loc": [73, 73], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99985:FunctionDef_L59_C0", "vector": [14, 1, 0.6404, 0.0088, 1, 0.35, 0.25, 81, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "type_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " type_name = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99985:Assign_L74_C2", "label": "top_node_name =", "type": "assigned_variable", "loc": [74, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99985:FunctionDef_L59_C0", "vector": [14, 1, 0.6491, 0.0088, 1, 0.35, 0.375, 238, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "top_node_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " top_node_name = None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99985:Assign_L75_C2", "label": "attributes =", "type": "assigned_variable", "loc": [75, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99985:FunctionDef_L59_C0", "vector": [14, 1, 0.6579, 0.0088, 1, 0.35, 0.5, 344, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "attributes", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " attributes = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99985:Assign_L77_C2", "label": "level =", "type": "assigned_variable", "loc": [77, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99985:FunctionDef_L59_C0", "vector": [14, 1, 0.6754, 0.0088, 1, 0.35, 0.625, 479, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "level", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " level = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99985:For_L78_C2", "label": "for event, node", "type": "for", "loc": [78, 112], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99985:FunctionDef_L59_C0", "vector": [6, 1, 0.8333, 0.307, 1, 0.35, 0.75, 207, 2, 0, 0, 0, 0, 0, 17], "semantic": {"name": "event, node", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for event, node in doc:\n # For skipping parts of a tree.\n if level > 0:\n if event == pulldom.END_ELEMENT:\n level-=1\n logging.warn('(%s) Skip end: %s' % (str(level), node))\n continue\n elif event == pulldom.START_ELEMENT:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99985:If_L80_C4", "label": "if", "type": "if", "loc": [80, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99985:For_L78_C2", "vector": [4, 2, 0.7368, 0.0789, 2, 0.98, 0.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if level > 0:\n if event == pulldom.END_ELEMENT:\n level-=1\n logging.warn('(%s) Skip end: %s' % (str(level), node))\n continue\n elif event == pulldom.START_ELEMENT:\n logging.warn('(%s) Skipping: %s' % (str(level), node))\n level+=1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99985:If_L81_C6", "label": "if", "type": "if", "loc": [81, 88], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99985:If_L80_C4", "vector": [4, 3, 0.7412, 0.0702, 3, 0.83, 0.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if event == pulldom.END_ELEMENT:\n level-=1\n logging.warn('(%s) Skip end: %s' % (str(level), node))\n continue\n elif event == pulldom.START_ELEMENT:\n logging.warn('(%s) Skipping: %s' % (str(level), node))\n level+=1\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99985:Expr_L83_C8", "label": "warn()", "type": "expression", "loc": [83, 83], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99985:If_L81_C6", "vector": [8, 4, 0.7281, 0.0088, 4, 0.68, 0.0, 960, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "warn", "arg_names": [], "import_names": [], "rhs_call_name": "warn", "annotation": ""}, "snippet": " logging.warn('(%s) Skip end: %s' % (str(level), node))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99985:If_L85_C6", "label": "if", "type": "if", "loc": [85, 88], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99985:If_L81_C6", "vector": [4, 4, 0.7588, 0.0351, 4, 0.68, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif event == pulldom.START_ELEMENT:\n logging.warn('(%s) Skipping: %s' % (str(level), node))\n level+=1\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99985:Expr_L86_C8", "label": "warn()", "type": "expression", "loc": [86, 86], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99985:If_L85_C6", "vector": [8, 5, 0.7544, 0.0088, 5, 0.69, 0.0, 960, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "warn", "arg_names": [], "import_names": [], "rhs_call_name": "warn", "annotation": ""}, "snippet": " logging.warn('(%s) Skipping: %s' % (str(level), node))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99985:If_L90_C4", "label": "if", "type": "if", "loc": [90, 112], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99985:For_L78_C2", "vector": [4, 2, 0.886, 0.2018, 2, 0.98, 1.0, 0, 0, 0, 0, 0, 0, 0, 13], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if event == pulldom.START_ELEMENT:\n logging.warn('Parsing: ' + node.tagName)\n # Get the type name to use.\n if type_name is None:\n type_name = ''.join([word.capitalize()\n for word in node.tagName.split('_')])\n top_node_name = node.tagName\n logging.warn('Found Top Node Name: ' + top_node_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99985:Expr_L91_C6", "label": "warn()", "type": "expression", "loc": [91, 91], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99985:If_L90_C4", "vector": [8, 3, 0.7982, 0.0088, 3, 0.97, 0.0, 960, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "warn", "arg_names": [], "import_names": [], "rhs_call_name": "warn", "annotation": ""}, "snippet": " logging.warn('Parsing: ' + node.tagName)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99985:If_L93_C6", "label": "if", "type": "if", "loc": [93, 98], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99985:If_L90_C4", "vector": [4, 3, 0.8377, 0.0526, 3, 0.97, 0.1667, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if type_name is None:\n type_name = ''.join([word.capitalize()\n for word in node.tagName.split('_')])\n top_node_name = node.tagName\n logging.warn('Found Top Node Name: ' + top_node_name)\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99985:Assign_L94_C8", "label": "type_name = join()", "type": "assigned_variable", "loc": [94, 95], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99985:If_L93_C6", "vector": [14, 4, 0.8289, 0.0175, 4, 0.79, 0.0, 81, 3, 1, 0, 0, 933, 10, 3], "semantic": {"name": "type_name", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " type_name = ''.join([word.capitalize()\n for word in node.tagName.split('_')])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99985:Assign_L96_C8", "label": "top_node_name =", "type": "assigned_variable", "loc": [96, 96], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99985:If_L93_C6", "vector": [14, 4, 0.8421, 0.0088, 4, 0.79, 0.5, 238, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "top_node_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " top_node_name = node.tagName"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99985:Expr_L97_C8", "label": "warn()", "type": "expression", "loc": [97, 97], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99985:If_L93_C6", "vector": [8, 4, 0.8509, 0.0088, 4, 0.79, 1.0, 960, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "warn", "arg_names": [], "import_names": [], "rhs_call_name": "warn", "annotation": ""}, "snippet": " logging.warn('Found Top Node Name: ' + top_node_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99985:Assign_L100_C6", "label": "typ = getAttribute()", "type": "assigned_variable", "loc": [100, 100], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99985:If_L90_C4", "vector": [14, 3, 0.8772, 0.0088, 3, 0.97, 0.3333, 722, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "typ", "arg_names": [], "import_names": [], "rhs_call_name": "getAttribute", "annotation": ""}, "snippet": " typ = node.getAttribute('type')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99985:Assign_L101_C6", "label": "child = getAttribute()", "type": "assigned_variable", "loc": [101, 101], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99985:If_L90_C4", "vector": [14, 3, 0.886, 0.0088, 3, 0.97, 0.5, 967, 3, 1, 0, 0, 607, 10, 1], "semantic": {"name": "child", "arg_names": [], "import_names": [], "rhs_call_name": "getAttribute", "annotation": ""}, "snippet": " child = node.getAttribute('child')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99985:If_L103_C6", "label": "if", "type": "if", "loc": [103, 110], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99985:If_L90_C4", "vector": [4, 3, 0.9342, 0.0702, 3, 0.97, 0.6667, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if typ in COMPLEX:\n logging.warn('Found Complex: ' + node.tagName)\n level = 1\n elif typ not in TYPES:\n logging.warn('Found String: ' + typ)\n typ = STRING\n else:\n logging.warn('Found Type: ' + typ)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99985:Expr_L104_C8", "label": "warn()", "type": "expression", "loc": [104, 104], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99985:If_L103_C6", "vector": [8, 4, 0.9123, 0.0088, 4, 0.97, 0.0, 960, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "warn", "arg_names": [], "import_names": [], "rhs_call_name": "warn", "annotation": ""}, "snippet": " logging.warn('Found Complex: ' + node.tagName)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99985:Assign_L105_C8", "label": "level =", "type": "assigned_variable", "loc": [105, 105], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99985:If_L103_C6", "vector": [14, 4, 0.9211, 0.0088, 4, 0.97, 0.5, 479, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "level", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " level = 1"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99985:If_L106_C6", "label": "if", "type": "if", "loc": [106, 110], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99985:If_L103_C6", "vector": [4, 4, 0.9474, 0.0439, 4, 0.97, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " elif typ not in TYPES:\n logging.warn('Found String: ' + typ)\n typ = STRING\n else:\n logging.warn('Found Type: ' + typ)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99985:Expr_L107_C8", "label": "warn()", "type": "expression", "loc": [107, 107], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99985:If_L106_C6", "vector": [8, 5, 0.9386, 0.0088, 5, 0.57, 0.0, 960, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "warn", "arg_names": [], "import_names": [], "rhs_call_name": "warn", "annotation": ""}, "snippet": " logging.warn('Found String: ' + typ)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99985:Assign_L108_C8", "label": "typ =", "type": "assigned_variable", "loc": [108, 108], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99985:If_L106_C6", "vector": [14, 5, 0.9474, 0.0088, 5, 0.57, 0.5, 722, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "typ", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " typ = STRING"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99985:Expr_L110_C8", "label": "warn()", "type": "expression", "loc": [110, 110], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99985:If_L106_C6", "vector": [8, 5, 0.9649, 0.0088, 5, 0.57, 1.0, 960, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "warn", "arg_names": [], "import_names": [], "rhs_call_name": "warn", "annotation": ""}, "snippet": " logging.warn('Found Type: ' + typ)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99985:Expr_L111_C6", "label": "warn()", "type": "expression", "loc": [111, 111], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99985:If_L90_C4", "vector": [8, 3, 0.9737, 0.0088, 3, 0.97, 0.8333, 960, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "warn", "arg_names": [], "import_names": [], "rhs_call_name": "warn", "annotation": ""}, "snippet": " logging.warn('Adding: ' + str((node, typ)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99985:Expr_L112_C6", "label": "setdefault()", "type": "expression", "loc": [112, 112], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99985:If_L90_C4", "vector": [8, 3, 0.9825, 0.0088, 3, 0.97, 1.0, 262, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "setdefault", "arg_names": [], "import_names": [], "rhs_call_name": "setdefault", "annotation": ""}, "snippet": " attributes.setdefault(node.tagName, (typ, [child]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99985:Expr_L113_C2", "label": "warn()", "type": "expression", "loc": [113, 113], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99985:FunctionDef_L59_C0", "vector": [8, 1, 0.9912, 0.0088, 1, 0.35, 0.875, 960, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "warn", "arg_names": [], "import_names": [], "rhs_call_name": "warn", "annotation": ""}, "snippet": " logging.warn('Attr: ' + str((type_name, top_node_name, attributes)))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99985:Return_L114_C2", "label": "return", "type": "return", "loc": [114, 114], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99985:FunctionDef_L59_C0", "vector": [13, 1, 1.0, 0.0088, 1, 0.35, 1.0, 0, 0, 0, 0, 0, 0, 8, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return type_name, top_node_name, attributes"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99985:FunctionDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99985:Expr_L60_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99985:FunctionDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99985:Assign_L71_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99985:FunctionDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99985:Assign_L73_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99985:FunctionDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99985:Assign_L74_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99985:FunctionDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99985:Assign_L75_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99985:FunctionDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99985:Assign_L77_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99985:FunctionDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99985:For_L78_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99985:For_L78_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99985:If_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99985:If_L80_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99985:If_L81_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99985:If_L81_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99985:Expr_L83_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99985:If_L81_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99985:If_L85_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99985:If_L85_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99985:Expr_L86_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99985:For_L78_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99985:If_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99985:If_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99985:Expr_L91_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99985:If_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99985:If_L93_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99985:If_L93_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99985:Assign_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99985:If_L93_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99985:Assign_L96_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99985:If_L93_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99985:Expr_L97_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99985:If_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99985:Assign_L100_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99985:If_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99985:Assign_L101_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99985:If_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99985:If_L103_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99985:If_L103_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99985:Expr_L104_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99985:If_L103_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99985:Assign_L105_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99985:If_L103_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99985:If_L106_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99985:If_L106_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99985:Expr_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99985:If_L106_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99985:Assign_L108_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99985:If_L106_C6", "t": "ajibawa-2023/Python-Code-Large/train/row_99985:Expr_L110_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99985:If_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99985:Expr_L111_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99985:If_L90_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99985:Expr_L112_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99985:FunctionDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99985:Expr_L113_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99985:FunctionDef_L59_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99985:Return_L114_C2"}] |
#!/usr/bin/python
# Copyright 2011 Google, Inc. All Rights Reserved.
# simple script to walk source tree looking for third-party licenses
# dumps resulting html page to stdout
import os, re, mimetypes, sys
# read source directories to scan from command line
SOURCE = sys.argv[1:]
# regex to find /* */ style comment blocks
COMMENT_BLOCK = re.compile(r"(/\*.+?\*/)", re.MULTILINE | re.DOTALL)
# regex used to detect if comment block is a license
COMMENT_LICENSE = re.compile(r"(license)", re.IGNORECASE)
COMMENT_COPYRIGHT = re.compile(r"(copyright)", re.IGNORECASE)
EXCLUDE_TYPES = [
"application/xml",
"image/png",
]
# list of known licenses; keys are derived by stripping all whitespace and
# forcing to lowercase to help combine multiple files that have same license.
KNOWN_LICENSES = {}
class License:
def __init__(self, license_text):
self.license_text = license_text
self.filenames = []
# add filename to the list of files that have the same license text
def add_file(self, filename):
if filename not in self.filenames:
self.filenames.append(filename)
LICENSE_KEY = re.compile(r"[^\w]")
def find_license(license_text):
# TODO(alice): a lot these licenses are almost identical Apache licenses.
# Most of them differ in origin/modifications. Consider combining similar
# licenses.
license_key = LICENSE_KEY.sub("", license_text).lower()
if license_key not in KNOWN_LICENSES:
KNOWN_LICENSES[license_key] = License(license_text)
return KNOWN_LICENSES[license_key]
def discover_license(exact_path, filename):
# when filename ends with LICENSE, assume applies to filename prefixed
if filename.endswith("LICENSE"):
with open(exact_path) as file:
license_text = file.read()
target_filename = filename[:-len("LICENSE")]
if target_filename.endswith("."): target_filename = target_filename[:-1]
find_license(license_text).add_file(target_filename)
return None
# try searching for license blocks in raw file
mimetype = mimetypes.guess_type(filename)
if mimetype in EXCLUDE_TYPES: return None
with open(exact_path) as file:
raw_file = file.read()
# include comments that have both "license" and "copyright" in the text
for comment in COMMENT_BLOCK.finditer(raw_file):
comment = comment.group(1)
if COMMENT_LICENSE.search(comment) is None: continue
if COMMENT_COPYRIGHT.search(comment) is None: continue
find_license(comment).add_file(filename)
for source in SOURCE:
for root, dirs, files in os.walk(source):
for name in files:
discover_license(os.path.join(root, name), name)
print "<html><head><style> body { font-family: sans-serif; } pre { background-color: #eeeeee; padding: 1em; white-space: pre-wrap; } </style></head><body>"
for license in KNOWN_LICENSES.values():
print "<h3>Notices for files:</h3><ul>"
filenames = license.filenames
filenames.sort()
for filename in filenames:
print "<li>%s</li>" % (filename)
print "</ul>"
print "<pre>%s</pre>" % license.license_text
print "</body></html>"
| ajibawa-2023/Python-Code-Large/train/row_99986 | 51 | 98 | 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_99986:Import_L8_C0", "label": "os import os, re, mimetypes\u2026", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0816, 0.0102, 0, 0.66, 0.0, 688, 0, 4, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os", "re", "mimetypes", "sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import os, re, mimetypes, sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99986:Assign_L12_C0", "label": "SOURCE =", "type": "assigned_variable", "loc": [12, 12], "level": 0, "parent": null, "vector": [14, 0, 0.1224, 0.0102, 0, 0.66, 0.0714, 792, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "SOURCE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SOURCE = sys.argv[1:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99986:Assign_L15_C0", "label": "COMMENT_BLOCK = compile()", "type": "assigned_variable", "loc": [15, 15], "level": 0, "parent": null, "vector": [14, 0, 0.1531, 0.0102, 0, 0.66, 0.1429, 629, 3, 2, 0, 0, 821, 10, 1], "semantic": {"name": "COMMENT_BLOCK", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": "COMMENT_BLOCK = re.compile(r\"(/\\*.+?\\*/)\", re.MULTILINE | re.DOTALL)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99986:Assign_L17_C0", "label": "COMMENT_LICENSE = compile()", "type": "assigned_variable", "loc": [17, 17], "level": 0, "parent": null, "vector": [14, 0, 0.1735, 0.0102, 0, 0.66, 0.2143, 929, 3, 2, 0, 0, 821, 10, 1], "semantic": {"name": "COMMENT_LICENSE", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": "COMMENT_LICENSE = re.compile(r\"(license)\", re.IGNORECASE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99986:Assign_L18_C0", "label": "COMMENT_COPYRIGHT = compile()", "type": "assigned_variable", "loc": [18, 18], "level": 0, "parent": null, "vector": [14, 0, 0.1837, 0.0102, 0, 0.66, 0.2857, 407, 3, 2, 0, 0, 821, 10, 1], "semantic": {"name": "COMMENT_COPYRIGHT", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": "COMMENT_COPYRIGHT = re.compile(r\"(copyright)\", re.IGNORECASE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99986:Assign_L20_C0", "label": "EXCLUDE_TYPES =", "type": "assigned_variable", "loc": [20, 23], "level": 0, "parent": null, "vector": [14, 0, 0.2194, 0.0408, 0, 0.66, 0.3571, 265, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "EXCLUDE_TYPES", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "EXCLUDE_TYPES = [\n \"application/xml\",\n \"image/png\",\n]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99986:Assign_L28_C0", "label": "KNOWN_LICENSES =", "type": "assigned_variable", "loc": [28, 28], "level": 0, "parent": null, "vector": [14, 0, 0.2857, 0.0102, 0, 0.66, 0.4286, 144, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "KNOWN_LICENSES", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "KNOWN_LICENSES = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99986:ClassDef_L31_C0", "label": "License", "type": "class", "loc": [31, 39], "level": 0, "parent": null, "vector": [3, 0, 0.3571, 0.0918, 0, 0.66, 0.5, 338, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "License", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class License:\n def __init__(self, license_text):\n self.license_text = license_text\n self.filenames = []\n\n # add filename to the list of files that have the same license text\n def add_file(self, filename):\n if filename not in self.filenames:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99986:FunctionDef_L32_C4", "label": "__init__", "type": "function", "loc": [32, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99986:ClassDef_L31_C0", "vector": [2, 1, 0.3367, 0.0306, 1, 0.82, 0.0, 555, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "license_text"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, license_text):\n self.license_text = license_text\n self.filenames = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99986:Assign_L33_C8", "label": "self.license_text =", "type": "assigned_variable", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99986:FunctionDef_L32_C4", "vector": [14, 2, 0.3367, 0.0102, 2, 0.34, 0.0, 103, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.license_text", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.license_text = license_text"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99986:Assign_L34_C8", "label": "self.filenames =", "type": "assigned_variable", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99986:FunctionDef_L32_C4", "vector": [14, 2, 0.3469, 0.0102, 2, 0.34, 1.0, 866, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.filenames", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.filenames = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99986:FunctionDef_L37_C4", "label": "add_file", "type": "function", "loc": [37, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99986:ClassDef_L31_C0", "vector": [2, 1, 0.3878, 0.0306, 1, 0.82, 1.0, 369, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "add_file", "arg_names": ["self", "filename"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add_file(self, filename):\n if filename not in self.filenames:\n self.filenames.append(filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99986:If_L38_C8", "label": "if", "type": "if", "loc": [38, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99986:FunctionDef_L37_C4", "vector": [4, 2, 0.3929, 0.0204, 2, 0.05, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if filename not in self.filenames:\n self.filenames.append(filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99986:Expr_L39_C12", "label": "append()", "type": "expression", "loc": [39, 39], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99986:If_L38_C8", "vector": [8, 3, 0.398, 0.0102, 3, 0.71, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.filenames.append(filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99986:Assign_L42_C0", "label": "LICENSE_KEY = compile()", "type": "assigned_variable", "loc": [42, 42], "level": 0, "parent": null, "vector": [14, 0, 0.4286, 0.0102, 0, 0.66, 0.5714, 222, 3, 1, 0, 0, 821, 10, 1], "semantic": {"name": "LICENSE_KEY", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": "LICENSE_KEY = re.compile(r\"[^\\w]\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99986:FunctionDef_L44_C0", "label": "find_license", "type": "function", "loc": [44, 51], "level": 0, "parent": null, "vector": [2, 0, 0.4847, 0.0816, 0, 0.66, 0.6429, 149, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "find_license", "arg_names": ["license_text"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def find_license(license_text):\n # TODO(alice): a lot these licenses are almost identical Apache licenses.\n # Most of them differ in origin/modifications. Consider combining similar\n # licenses.\n license_key = LICENSE_KEY.sub(\"\", license_text).lower()\n if license_key not in KNOWN_LICENSES:\n KNOWN_LICENSES[license_key] = License(license_text)\n return KNOWN_LICENSES[license_key]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99986:Assign_L48_C4", "label": "license_key = lower()", "type": "assigned_variable", "loc": [48, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99986:FunctionDef_L44_C0", "vector": [14, 1, 0.4898, 0.0102, 1, 0.67, 0.0, 374, 3, 0, 0, 0, 432, 10, 2], "semantic": {"name": "license_key", "arg_names": [], "import_names": [], "rhs_call_name": "lower", "annotation": ""}, "snippet": " license_key = LICENSE_KEY.sub(\"\", license_text).lower()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99986:If_L49_C4", "label": "if", "type": "if", "loc": [49, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99986:FunctionDef_L44_C0", "vector": [4, 1, 0.5051, 0.0204, 1, 0.67, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if license_key not in KNOWN_LICENSES:\n KNOWN_LICENSES[license_key] = License(license_text)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99986:Assign_L50_C8", "label": " = License()", "type": "assigned_variable", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99986:If_L49_C4", "vector": [14, 2, 0.5102, 0.0102, 2, 0.06, 0.0, 0, 3, 1, 0, 0, 338, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "License", "annotation": ""}, "snippet": " KNOWN_LICENSES[license_key] = License(license_text)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99986:Return_L51_C4", "label": "return", "type": "return", "loc": [51, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99986:FunctionDef_L44_C0", "vector": [13, 1, 0.5204, 0.0102, 1, 0.67, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return KNOWN_LICENSES[license_key]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99986:FunctionDef_L55_C0", "label": "discover_license", "type": "function", "loc": [55, 77], "level": 0, "parent": null, "vector": [2, 0, 0.6735, 0.2347, 0, 0.66, 0.7143, 17, 0, 2, 1, 0, 0, 0, 16], "semantic": {"name": "discover_license", "arg_names": ["exact_path", "filename"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def discover_license(exact_path, filename):\n # when filename ends with LICENSE, assume applies to filename prefixed\n if filename.endswith(\"LICENSE\"):\n with open(exact_path) as file:\n license_text = file.read()\n target_filename = filename[:-len(\"LICENSE\")]\n if target_filename.endswith(\".\"): target_filename = target_filename[:-1]\n find_license(license_text).add_file(target_filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99986:If_L57_C4", "label": "if", "type": "if", "loc": [57, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99986:FunctionDef_L55_C0", "vector": [4, 1, 0.6122, 0.0714, 1, 0.26, 0.0, 0, 3, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if filename.endswith(\"LICENSE\"):\n with open(exact_path) as file:\n license_text = file.read()\n target_filename = filename[:-len(\"LICENSE\")]\n if target_filename.endswith(\".\"): target_filename = target_filename[:-1]\n find_license(license_text).add_file(target_filename)\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99986:Assign_L59_C12", "label": "license_text = read()", "type": "assigned_variable", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99986:If_L57_C4", "vector": [14, 2, 0.602, 0.0102, 2, 0.41, 0.0, 550, 3, 0, 0, 0, 453, 10, 1], "semantic": {"name": "license_text", "arg_names": [], "import_names": [], "rhs_call_name": "read", "annotation": ""}, "snippet": " license_text = file.read()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99986:Assign_L60_C8", "label": "target_filename =", "type": "assigned_variable", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99986:If_L57_C4", "vector": [14, 2, 0.6122, 0.0102, 2, 0.41, 0.0, 439, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "target_filename", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " target_filename = filename[:-len(\"LICENSE\")]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99986:If_L61_C8", "label": "if", "type": "if", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99986:If_L57_C4", "vector": [4, 2, 0.6224, 0.0102, 2, 0.41, 0.3333, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if target_filename.endswith(\".\"): target_filename = target_filename[:-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99986:Assign_L61_C42", "label": "target_filename =", "type": "assigned_variable", "loc": [61, 61], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99986:If_L61_C8", "vector": [14, 3, 0.6224, 0.0102, 3, 0.08, 0.0, 439, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "target_filename", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if target_filename.endswith(\".\"): target_filename = target_filename[:-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99986:Expr_L62_C8", "label": "add_file()", "type": "expression", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99986:If_L57_C4", "vector": [8, 2, 0.6327, 0.0102, 2, 0.41, 0.6667, 369, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "add_file", "arg_names": [], "import_names": [], "rhs_call_name": "add_file", "annotation": ""}, "snippet": " find_license(license_text).add_file(target_filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99986:Return_L63_C8", "label": "return", "type": "return", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99986:If_L57_C4", "vector": [13, 2, 0.6429, 0.0102, 2, 0.41, 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_99986:Assign_L66_C4", "label": "mimetype = guess_type()", "type": "assigned_variable", "loc": [66, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99986:FunctionDef_L55_C0", "vector": [14, 1, 0.6735, 0.0102, 1, 0.26, 0.3333, 290, 3, 1, 0, 0, 213, 10, 1], "semantic": {"name": "mimetype", "arg_names": [], "import_names": [], "rhs_call_name": "guess_type", "annotation": ""}, "snippet": " mimetype = mimetypes.guess_type(filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99986:If_L67_C4", "label": "if", "type": "if", "loc": [67, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99986:FunctionDef_L55_C0", "vector": [4, 1, 0.6837, 0.0102, 1, 0.26, 0.6667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if mimetype in EXCLUDE_TYPES: return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99986:Return_L67_C34", "label": "return", "type": "return", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99986:If_L67_C4", "vector": [13, 2, 0.6837, 0.0102, 2, 0.78, 0.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if mimetype in EXCLUDE_TYPES: return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99986:Assign_L70_C8", "label": "raw_file = read()", "type": "assigned_variable", "loc": [70, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99986:FunctionDef_L55_C0", "vector": [14, 1, 0.7143, 0.0102, 1, 0.26, 0.0, 1, 3, 0, 0, 0, 453, 10, 1], "semantic": {"name": "raw_file", "arg_names": [], "import_names": [], "rhs_call_name": "read", "annotation": ""}, "snippet": " raw_file = file.read()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99986:For_L73_C4", "label": "for comment", "type": "for", "loc": [73, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99986:FunctionDef_L55_C0", "vector": [6, 1, 0.7653, 0.051, 1, 0.26, 1.0, 34, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "comment", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for comment in COMMENT_BLOCK.finditer(raw_file):\n comment = comment.group(1)\n if COMMENT_LICENSE.search(comment) is None: continue\n if COMMENT_COPYRIGHT.search(comment) is None: continue\n find_license(comment).add_file(filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99986:Assign_L74_C8", "label": "comment = group()", "type": "assigned_variable", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99986:For_L73_C4", "vector": [14, 2, 0.7551, 0.0102, 2, 0.85, 0.0, 34, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "comment", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": " comment = comment.group(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99986:If_L75_C8", "label": "if", "type": "if", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99986:For_L73_C4", "vector": [4, 2, 0.7653, 0.0102, 2, 0.85, 0.3333, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if COMMENT_LICENSE.search(comment) is None: continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99986:If_L76_C8", "label": "if", "type": "if", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99986:For_L73_C4", "vector": [4, 2, 0.7755, 0.0102, 2, 0.85, 0.6667, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if COMMENT_COPYRIGHT.search(comment) is None: continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99986:Expr_L77_C8", "label": "add_file()", "type": "expression", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99986:For_L73_C4", "vector": [8, 2, 0.7857, 0.0102, 2, 0.85, 1.0, 369, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "add_file", "arg_names": [], "import_names": [], "rhs_call_name": "add_file", "annotation": ""}, "snippet": " find_license(comment).add_file(filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99986:For_L80_C0", "label": "for source", "type": "for", "loc": [80, 83], "level": 0, "parent": null, "vector": [6, 0, 0.8316, 0.0408, 0, 0.66, 0.7857, 703, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "source", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "for source in SOURCE:\n for root, dirs, files in os.walk(source):\n for name in files:\n discover_license(os.path.join(root, name), name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99986:For_L81_C4", "label": "for root, dirs, files", "type": "for", "loc": [81, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99986:For_L80_C0", "vector": [6, 1, 0.8367, 0.0306, 1, 0.3, 0.0, 129, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "root, dirs, files", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for root, dirs, files in os.walk(source):\n for name in files:\n discover_license(os.path.join(root, name), name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99986:For_L82_C8", "label": "for name", "type": "for", "loc": [82, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99986:For_L81_C4", "vector": [6, 2, 0.8418, 0.0204, 2, 0.05, 0.0, 57, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for name in files:\n discover_license(os.path.join(root, name), name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99986:Expr_L83_C12", "label": "discover_license()", "type": "expression", "loc": [83, 83], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99986:For_L82_C8", "vector": [8, 3, 0.8469, 0.0102, 3, 0.19, 0.0, 17, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "discover_license", "arg_names": [], "import_names": [], "rhs_call_name": "discover_license", "annotation": ""}, "snippet": " discover_license(os.path.join(root, name), name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99986:Expr_L86_C0", "label": "print()", "type": "expression", "loc": [86, 86], "level": 0, "parent": null, "vector": [8, 0, 0.8776, 0.0102, 0, 0.66, 0.8571, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "print(\"<html><head><style> body { font-family: sans-serif; } pre { background-color: #eeeeee; padding: 1em; white-space: pre-wrap; } </style></head><body>\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99986:For_L88_C0", "label": "for license", "type": "for", "loc": [88, 96], "level": 0, "parent": null, "vector": [6, 0, 0.9388, 0.0918, 0, 0.66, 0.9286, 365, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "license", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "for license in KNOWN_LICENSES.values():\n\n print(\"<h3>Notices for files:</h3><ul>\")\n filenames = license.filenames\n filenames.sort()\n for filename in filenames:\n print(\"<li>%s</li>\" % (filename))\n print(\"</ul>\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99986:Expr_L90_C4", "label": "print()", "type": "expression", "loc": [90, 90], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99986:For_L88_C0", "vector": [8, 1, 0.9184, 0.0102, 1, 0.81, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"<h3>Notices for files:</h3><ul>\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99986:Assign_L91_C4", "label": "filenames =", "type": "assigned_variable", "loc": [91, 91], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99986:For_L88_C0", "vector": [14, 1, 0.9286, 0.0102, 1, 0.81, 0.2, 94, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "filenames", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " filenames = license.filenames"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99986:Expr_L92_C4", "label": "sort()", "type": "expression", "loc": [92, 92], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99986:For_L88_C0", "vector": [8, 1, 0.9388, 0.0102, 1, 0.81, 0.4, 489, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sort", "arg_names": [], "import_names": [], "rhs_call_name": "sort", "annotation": ""}, "snippet": " filenames.sort()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99986:For_L93_C4", "label": "for filename", "type": "for", "loc": [93, 94], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99986:For_L88_C0", "vector": [6, 1, 0.9541, 0.0204, 1, 0.81, 0.6, 275, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "filename", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for filename in filenames:\n print(\"<li>%s</li>\" % (filename))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99986:Expr_L94_C8", "label": "print()", "type": "expression", "loc": [94, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99986:For_L93_C4", "vector": [8, 2, 0.9592, 0.0102, 2, 0.24, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"<li>%s</li>\" % (filename))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99986:Expr_L95_C4", "label": "print()", "type": "expression", "loc": [95, 95], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99986:For_L88_C0", "vector": [8, 1, 0.9694, 0.0102, 1, 0.81, 0.8, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"</ul>\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99986:Expr_L96_C4", "label": "print()", "type": "expression", "loc": [96, 96], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99986:For_L88_C0", "vector": [8, 1, 0.9796, 0.0102, 1, 0.81, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"<pre>%s</pre>\" % license.license_text)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99986:Expr_L98_C0", "label": "print()", "type": "expression", "loc": [98, 98], "level": 0, "parent": null, "vector": [8, 0, 1.0, 0.0102, 0, 0.66, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "print(\"</body></html>\")"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99986:ClassDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99986:FunctionDef_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99986:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99986:Assign_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99986:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99986:Assign_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99986:ClassDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99986:FunctionDef_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99986:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99986:If_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99986:If_L38_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99986:Expr_L39_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99986:FunctionDef_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99986:Assign_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99986:FunctionDef_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99986:If_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99986:If_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99986:Assign_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99986:FunctionDef_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99986:Return_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99986:FunctionDef_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99986:If_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99986:If_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99986:Assign_L59_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99986:If_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99986:Assign_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99986:If_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99986:If_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99986:If_L61_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99986:Assign_L61_C42"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99986:If_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99986:Expr_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99986:If_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99986:Return_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99986:FunctionDef_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99986:Assign_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99986:FunctionDef_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99986:If_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99986:If_L67_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99986:Return_L67_C34"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99986:FunctionDef_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99986:Assign_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99986:FunctionDef_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99986:For_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99986:For_L73_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99986:Assign_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99986:For_L73_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99986:If_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99986:For_L73_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99986:If_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99986:For_L73_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99986:Expr_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99986:For_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99986:For_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99986:For_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99986:For_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99986:For_L82_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99986:Expr_L83_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99986:For_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99986:Expr_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99986:For_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99986:Assign_L91_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99986:For_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99986:Expr_L92_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99986:For_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99986:For_L93_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99986:For_L93_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99986:Expr_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99986:For_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99986:Expr_L95_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99986:For_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99986:Expr_L96_C4"}] |
#!/usr/bin/python2.6
#
# Copyright 2011 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Build the BITE Extension."""
__author__ = 'ralphj@google.com (Julie Ralph)'
import logging
import optparse
import os
import shutil
import subprocess
import urllib
import zipfile
CHECKOUT_ACE_COMMAND = ('git clone git://github.com/ajaxorg/ace.git')
CHECKOUT_CLOSURE_COMMAND = ('svn checkout http://closure-library.googlecode.com'
'/svn/trunk/ closure-library')
CHECKOUT_SELENIUM_COMMAND = ('svn checkout http://selenium.googlecode.com'
'/svn/trunk/javascript/atoms selenium-atoms-lib')
CLOSURE_COMPILER_URL = ('http://closure-compiler.googlecode.com/files/'
'compiler-latest.zip')
SOY_COMPILER_URL = ('http://closure-templates.googlecode.com/files/'
'closure-templates-for-javascript-latest.zip')
SOYDATA_URL = ('http://closure-templates.googlecode.com/svn/trunk/javascript/'
'soydata.js')
COMPILE_CLOSURE_COMMAND = ('closure-library/closure/bin/build/closurebuilder.py'
' --root=src'
' --root=closure-library'
' --root=build_gen'
' --root=selenium-atoms-lib'
' --input=%(input)s'
' --output_mode=compiled'
' --output_file=%(output)s'
' --compiler_jar=compiler.jar')
SOY_COMPILER_COMMAND = ('java -jar SoyToJsSrcCompiler.jar'
' --shouldProvideRequireSoyNamespaces'
' --outputPathFormat %(output)s'
' %(file)s')
class ClosureError(Exception):
pass
def BuildClosureScript(input_filename, output_filename):
"""Build a compiled closure script based on the given input file.
Args:
input_filename: A string representing the name of the input script to
compile
output_filename: A string representing the name of the output script.
Raises:
ClosureError: If closure fails to compile the given input file.
"""
result = ExecuteCommand(
COMPILE_CLOSURE_COMMAND % {
'input': input_filename,
'output': output_filename})
if result or not os.path.exists(output_filename):
raise ClosureError('Failed while compiling %s.' % input_filename)
def BuildSoyJs(input_file):
"""Builds a javascript file from a soy file.
Args:
input_file: A path to the soy file to compile into JavaScript. The js file
will be stored in build_gen/{FILENAME}.soy.js
Raises:
ClosureError: If the soy compiler fails to compile.
"""
output_name = os.path.join('build_gen', '%s.js' % input_file)
result = ExecuteCommand(
SOY_COMPILER_COMMAND % {
'file': input_file,
'output': output_name})
if result or not os.path.exists(output_name):
raise ClosureError('Failed while compiling the soy file %s.' % input_file)
def Clean():
if os.path.exists('clean'):
shutil.rmtree('build')
if os.path.exists('build_gen'):
shutil.rmtree('build_gen')
def ExecuteCommand(command):
"""Execute the given command and return the output.
Args:
command: A string representing the command to execute.
Returns:
The return code of the process.
"""
print 'Running command: %s' % command
process = subprocess.Popen(command.split(' '),
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
results = process.communicate()
if process.returncode:
logging.error(results[1])
return process.returncode
def SetupAce():
"""Setup the Ace library.
Checkout the Ace library using git.
Raises:
ClosureError: If the setup fails.
"""
if not os.path.exists('ace'):
ExecuteCommand(CHECKOUT_ACE_COMMAND)
if not os.path.exists('ace'):
logging.error('Could not checkout ACE from github.')
raise ClosureError('Could not set up ACE.')
def SetupClosure():
"""Setup the closure library and compiler.
Checkout the closure library using svn if it doesn't exist. Also, download
the closure compiler.
Raises:
ClosureError: If the setup fails.
"""
# Set up the svn repo for closure if it doesn't exist.
if not os.path.exists('closure-library'):
ExecuteCommand(CHECKOUT_CLOSURE_COMMAND)
if not os.path.exists('closure-library'):
logging.error(('Could not check out the closure library from svn. '
'Please check out the closure library to the '
'"closure-library" directory.'))
raise ClosureError('Could not set up the closure library.')
# Download the compiler jar if it doesn't exist.
if not os.path.exists('compiler.jar'):
(compiler_zip, _) = urllib.urlretrieve(CLOSURE_COMPILER_URL)
compiler_zipfile = zipfile.ZipFile(compiler_zip)
compiler_zipfile.extract('compiler.jar')
if not os.path.exists('compiler.jar'):
logging.error('Could not download the closure compiler jar.')
raise ClosureError('Could not find the closure compiler.')
# Download the soy compiler jar if it doesn't exist.
if (not os.path.exists('SoyToJsSrcCompiler.jar') or
not os.path.exists('build_gen/soyutils_usegoog.js')):
(soy_compiler_zip, _) = urllib.urlretrieve(SOY_COMPILER_URL)
soy_compiler_zipfile = zipfile.ZipFile(soy_compiler_zip)
soy_compiler_zipfile.extract('SoyToJsSrcCompiler.jar')
soy_compiler_zipfile.extract('soyutils_usegoog.js', 'build_gen')
if (not os.path.exists('SoyToJsSrcCompiler.jar') or
not os.path.exists('build_gen/soyutils_usegoog.js')):
logging.error('Could not download the soy compiler jar.')
raise ClosureError('Could not find the soy compiler.')
# Download required soydata file, which is required for soyutils_usegoog.js
# to work.
if not os.path.exists('build_gen/soydata.js'):
urllib.urlretrieve(SOYDATA_URL, 'build_gen/soydata.js')
if not os.path.exists('build_gen/soydata.js'):
logging.error('Could not download soydata.js.')
raise ClosureError('Could not fine soydata.js')
def SetupSelenium():
"""Setup the selenium library.
Checkout necessary files from the selenium library using svn, if they
don't exist.
Raises:
ClosureError: If the setup fails.
"""
if not os.path.exists('selenium-atoms-lib/bot.js'):
ExecuteCommand(CHECKOUT_SELENIUM_COMMAND)
if not os.path.exists('selenium-atoms-lib/bot.js'):
logging.error('Could not download the selenium library.')
raise ClosureError('Could not find the selenium library.')
def main():
usage = 'usage: %prog [options]'
parser = optparse.OptionParser(usage)
parser.add_option('--clean', dest='build_clean',
action='store_true', default=False,
help='Clean the build directories.')
(options, _) = parser.parse_args()
if options.build_clean:
Clean()
exit()
# Set up the directories that will be built into.
if not os.path.exists('build'):
os.mkdir('build')
if not os.path.exists('build/options'):
os.mkdir('build/options')
if not os.path.exists('build_gen'):
os.mkdir('build_gen')
# Get external resources.
SetupClosure()
SetupSelenium()
SetupAce()
# Compile the closure scripts.
soy_files = ['consoles.soy',
'rpfconsole.soy',
'rpf_dialogs.soy',
'locatorsupdater.soy',
'newbug_console.soy',
'newbug_type_selector.soy',
'popup.soy']
for soy_filename in soy_files:
BuildSoyJs(os.path.join('src', soy_filename))
js_targets = {'background.js': 'background_script.js',
'content.js': 'content_script.js',
'getactioninfo.js': 'getactioninfo_script.js',
'console.js': 'console_script.js',
'elementhelper.js': 'elementhelper_script.js',
'popup.js': 'popup_script.js',
'options/page.js': 'options_script.js'}
for target in js_targets:
BuildClosureScript(os.path.join('src', target),
os.path.join('build', js_targets[target]))
# Copy over the static resources
if os.path.exists('build/styles'):
shutil.rmtree('build/styles')
shutil.copytree('src/styles', 'build/styles')
if os.path.exists('build/imgs'):
shutil.rmtree('build/imgs')
shutil.copytree('src/imgs', 'build/imgs')
static_files = ['src/background.html',
'src/console.html',
'src/options/options.html',
'src/popup.html',
'manifest.json']
for static_file in static_files:
shutil.copy(static_file, 'build')
# Copy the required ACE files.
if os.path.exists('build/ace'):
shutil.rmtree('build/ace')
shutil.copytree('ace/build/src', 'build/ace')
if __name__ == '__main__':
main()
| ajibawa-2023/Python-Code-Large/train/row_99987 | 112 | 277 | 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_99987:Expr_L18_C0", "label": "expression", "type": "expression", "loc": [18, 18], "level": 0, "parent": null, "vector": [8, 0, 0.065, 0.0036, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"Build the BITE Extension.\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Assign_L20_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [20, 20], "level": 0, "parent": null, "vector": [14, 0, 0.0722, 0.0036, 0, 0.66, 0.0385, 777, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "__author__", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "__author__ = 'ralphj@google.com (Julie Ralph)'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Import_L22_C0", "label": "logging import logging", "type": "import", "loc": [22, 22], "level": 0, "parent": null, "vector": [1, 0, 0.0794, 0.0036, 0, 0.66, 0.0769, 715, 0, 1, 0, 0, 715, 0, 0], "semantic": {"name": "logging", "arg_names": [], "import_names": ["logging"], "rhs_call_name": "", "annotation": ""}, "snippet": "import logging"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Import_L23_C0", "label": "optparse import optparse", "type": "import", "loc": [23, 23], "level": 0, "parent": null, "vector": [1, 0, 0.083, 0.0036, 0, 0.66, 0.1154, 323, 0, 1, 0, 0, 323, 0, 0], "semantic": {"name": "optparse", "arg_names": [], "import_names": ["optparse"], "rhs_call_name": "", "annotation": ""}, "snippet": "import optparse"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Import_L24_C0", "label": "os import os", "type": "import", "loc": [24, 24], "level": 0, "parent": null, "vector": [1, 0, 0.0866, 0.0036, 0, 0.66, 0.1538, 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_99987:Import_L25_C0", "label": "shutil import shutil", "type": "import", "loc": [25, 25], "level": 0, "parent": null, "vector": [1, 0, 0.0903, 0.0036, 0, 0.66, 0.1923, 614, 0, 1, 0, 0, 614, 0, 0], "semantic": {"name": "shutil", "arg_names": [], "import_names": ["shutil"], "rhs_call_name": "", "annotation": ""}, "snippet": "import shutil"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Import_L26_C0", "label": "subprocess import subprocess", "type": "import", "loc": [26, 26], "level": 0, "parent": null, "vector": [1, 0, 0.0939, 0.0036, 0, 0.66, 0.2308, 394, 0, 1, 0, 0, 394, 0, 0], "semantic": {"name": "subprocess", "arg_names": [], "import_names": ["subprocess"], "rhs_call_name": "", "annotation": ""}, "snippet": "import subprocess"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Import_L27_C0", "label": "urllib import urllib", "type": "import", "loc": [27, 27], "level": 0, "parent": null, "vector": [1, 0, 0.0975, 0.0036, 0, 0.66, 0.2692, 614, 0, 1, 0, 0, 614, 0, 0], "semantic": {"name": "urllib", "arg_names": [], "import_names": ["urllib"], "rhs_call_name": "", "annotation": ""}, "snippet": "import urllib"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Import_L28_C0", "label": "zipfile import zipfile", "type": "import", "loc": [28, 28], "level": 0, "parent": null, "vector": [1, 0, 0.1011, 0.0036, 0, 0.66, 0.3077, 93, 0, 1, 0, 0, 93, 0, 0], "semantic": {"name": "zipfile", "arg_names": [], "import_names": ["zipfile"], "rhs_call_name": "", "annotation": ""}, "snippet": "import zipfile"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Assign_L30_C0", "label": "CHECKOUT_ACE_COMMAND =", "type": "assigned_variable", "loc": [30, 30], "level": 0, "parent": null, "vector": [14, 0, 0.1083, 0.0036, 0, 0.66, 0.3462, 268, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "CHECKOUT_ACE_COMMAND", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "CHECKOUT_ACE_COMMAND = ('git clone git://github.com/ajaxorg/ace.git')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Assign_L31_C0", "label": "CHECKOUT_CLOSURE_COMMAND =", "type": "assigned_variable", "loc": [31, 32], "level": 0, "parent": null, "vector": [14, 0, 0.1137, 0.0072, 0, 0.66, 0.3846, 505, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "CHECKOUT_CLOSURE_COMMAND", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "CHECKOUT_CLOSURE_COMMAND = ('svn checkout http://closure-library.googlecode.com'\n '/svn/trunk/ closure-library')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Assign_L33_C0", "label": "CHECKOUT_SELENIUM_COMMAND =", "type": "assigned_variable", "loc": [33, 34], "level": 0, "parent": null, "vector": [14, 0, 0.1209, 0.0072, 0, 0.66, 0.4231, 873, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "CHECKOUT_SELENIUM_COMMAND", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "CHECKOUT_SELENIUM_COMMAND = ('svn checkout http://selenium.googlecode.com'\n '/svn/trunk/javascript/atoms selenium-atoms-lib')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Assign_L35_C0", "label": "CLOSURE_COMPILER_URL =", "type": "assigned_variable", "loc": [35, 36], "level": 0, "parent": null, "vector": [14, 0, 0.1282, 0.0072, 0, 0.66, 0.4615, 345, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "CLOSURE_COMPILER_URL", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "CLOSURE_COMPILER_URL = ('http://closure-compiler.googlecode.com/files/'\n 'compiler-latest.zip')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Assign_L37_C0", "label": "SOY_COMPILER_URL =", "type": "assigned_variable", "loc": [37, 38], "level": 0, "parent": null, "vector": [14, 0, 0.1354, 0.0072, 0, 0.66, 0.5, 98, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SOY_COMPILER_URL", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SOY_COMPILER_URL = ('http://closure-templates.googlecode.com/files/'\n 'closure-templates-for-javascript-latest.zip')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Assign_L39_C0", "label": "SOYDATA_URL =", "type": "assigned_variable", "loc": [39, 40], "level": 0, "parent": null, "vector": [14, 0, 0.1426, 0.0072, 0, 0.66, 0.5385, 107, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SOYDATA_URL", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SOYDATA_URL = ('http://closure-templates.googlecode.com/svn/trunk/javascript/'\n 'soydata.js')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Assign_L41_C0", "label": "COMPILE_CLOSURE_COMMAND =", "type": "assigned_variable", "loc": [41, 49], "level": 0, "parent": null, "vector": [14, 0, 0.1625, 0.0325, 0, 0.66, 0.5769, 644, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "COMPILE_CLOSURE_COMMAND", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "COMPILE_CLOSURE_COMMAND = ('closure-library/closure/bin/build/closurebuilder.py'\n ' --root=src'\n ' --root=closure-library'\n ' --root=build_gen'\n ' --root=selenium-atoms-lib'\n ' --input=%(input)s'\n ' --output_mode=compiled'\n ' --output_file=%(output)s'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Assign_L50_C0", "label": "SOY_COMPILER_COMMAND =", "type": "assigned_variable", "loc": [50, 53], "level": 0, "parent": null, "vector": [14, 0, 0.1859, 0.0144, 0, 0.66, 0.6154, 590, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "SOY_COMPILER_COMMAND", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SOY_COMPILER_COMMAND = ('java -jar SoyToJsSrcCompiler.jar'\n ' --shouldProvideRequireSoyNamespaces'\n ' --outputPathFormat %(output)s'\n ' %(file)s')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:ClassDef_L56_C0", "label": "ClosureError", "type": "class", "loc": [56, 57], "level": 0, "parent": null, "vector": [3, 0, 0.204, 0.0072, 0, 0.66, 0.6538, 106, 0, 0, 0, 0, 645, 0, 0], "semantic": {"name": "ClosureError", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ClosureError(Exception):\n pass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L60_C0", "label": "BuildClosureScript", "type": "function", "loc": [60, 77], "level": 0, "parent": null, "vector": [2, 0, 0.2473, 0.065, 0, 0.66, 0.6923, 257, 0, 2, 0, 0, 0, 0, 3], "semantic": {"name": "BuildClosureScript", "arg_names": ["input_filename", "output_filename"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def BuildClosureScript(input_filename, output_filename):\n \"\"\"Build a compiled closure script based on the given input file.\n\n Args:\n input_filename: A string representing the name of the input script to\n compile\n output_filename: A string representing the name of the output script.\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L61_C2", "label": "expression", "type": "expression", "loc": [61, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L60_C0", "vector": [8, 1, 0.2365, 0.0361, 1, 0.44, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Build a compiled closure script based on the given input file.\n\n Args:\n input_filename: A string representing the name of the input script to\n compile\n output_filename: A string representing the name of the output script.\n\n Raises:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Assign_L71_C2", "label": "result = ExecuteCommand()", "type": "assigned_variable", "loc": [71, 74], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L60_C0", "vector": [14, 1, 0.2617, 0.0144, 1, 0.44, 0.5, 51, 3, 1, 0, 0, 789, 10, 1], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "ExecuteCommand", "annotation": ""}, "snippet": " result = ExecuteCommand(\n COMPILE_CLOSURE_COMMAND % {\n 'input': input_filename,\n 'output': output_filename})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L76_C2", "label": "if", "type": "if", "loc": [76, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L60_C0", "vector": [4, 1, 0.2762, 0.0072, 1, 0.44, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if result or not os.path.exists(output_filename):\n raise ClosureError('Failed while compiling %s.' % input_filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L80_C0", "label": "BuildSoyJs", "type": "function", "loc": [80, 96], "level": 0, "parent": null, "vector": [2, 0, 0.3177, 0.0614, 0, 0.66, 0.7308, 853, 0, 1, 0, 0, 0, 0, 4], "semantic": {"name": "BuildSoyJs", "arg_names": ["input_file"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def BuildSoyJs(input_file):\n \"\"\"Builds a javascript file from a soy file.\n\n Args:\n input_file: A path to the soy file to compile into JavaScript. The js file\n will be stored in build_gen/{FILENAME}.soy.js\n\n Raises:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L81_C2", "label": "expression", "type": "expression", "loc": [81, 89], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L80_C0", "vector": [8, 1, 0.3069, 0.0325, 1, 0.92, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Builds a javascript file from a soy file.\n\n Args:\n input_file: A path to the soy file to compile into JavaScript. The js file\n will be stored in build_gen/{FILENAME}.soy.js\n\n Raises:\n ClosureError: If the soy compiler fails to compile."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Assign_L90_C2", "label": "output_name = join()", "type": "assigned_variable", "loc": [90, 90], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L80_C0", "vector": [14, 1, 0.3249, 0.0036, 1, 0.92, 0.3333, 992, 3, 2, 0, 0, 933, 10, 1], "semantic": {"name": "output_name", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " output_name = os.path.join('build_gen', '%s.js' % input_file)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Assign_L91_C2", "label": "result = ExecuteCommand()", "type": "assigned_variable", "loc": [91, 94], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L80_C0", "vector": [14, 1, 0.3339, 0.0144, 1, 0.92, 0.6667, 51, 3, 1, 0, 0, 789, 10, 1], "semantic": {"name": "result", "arg_names": [], "import_names": [], "rhs_call_name": "ExecuteCommand", "annotation": ""}, "snippet": " result = ExecuteCommand(\n SOY_COMPILER_COMMAND % {\n 'file': input_file,\n 'output': output_name})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L95_C2", "label": "if", "type": "if", "loc": [95, 96], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L80_C0", "vector": [4, 1, 0.3448, 0.0072, 1, 0.92, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if result or not os.path.exists(output_name):\n raise ClosureError('Failed while compiling the soy file %s.' % input_file)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L99_C0", "label": "Clean", "type": "function", "loc": [99, 103], "level": 0, "parent": null, "vector": [2, 0, 0.3646, 0.0181, 0, 0.66, 0.7692, 416, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "Clean", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def Clean():\n if os.path.exists('clean'):\n shutil.rmtree('build')\n if os.path.exists('build_gen'):\n shutil.rmtree('build_gen')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L100_C2", "label": "if", "type": "if", "loc": [100, 101], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L99_C0", "vector": [4, 1, 0.3628, 0.0072, 1, 0.9, 0.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if os.path.exists('clean'):\n shutil.rmtree('build')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L101_C4", "label": "rmtree()", "type": "expression", "loc": [101, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L100_C2", "vector": [8, 2, 0.3646, 0.0036, 2, 0.06, 0.0, 317, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "rmtree", "arg_names": [], "import_names": [], "rhs_call_name": "rmtree", "annotation": ""}, "snippet": " shutil.rmtree('build')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L102_C2", "label": "if", "type": "if", "loc": [102, 103], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L99_C0", "vector": [4, 1, 0.37, 0.0072, 1, 0.9, 1.0, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if os.path.exists('build_gen'):\n shutil.rmtree('build_gen')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L103_C4", "label": "rmtree()", "type": "expression", "loc": [103, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L102_C2", "vector": [8, 2, 0.3718, 0.0036, 2, 0.49, 0.0, 317, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "rmtree", "arg_names": [], "import_names": [], "rhs_call_name": "rmtree", "annotation": ""}, "snippet": " shutil.rmtree('build_gen')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L106_C0", "label": "ExecuteCommand", "type": "function", "loc": [106, 122], "level": 0, "parent": null, "vector": [2, 0, 0.4116, 0.0614, 0, 0.66, 0.8077, 789, 0, 1, 1, 0, 0, 0, 5], "semantic": {"name": "ExecuteCommand", "arg_names": ["command"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def ExecuteCommand(command):\n \"\"\"Execute the given command and return the output.\n\n Args:\n command: A string representing the command to execute.\n\n Returns:\n The return code of the process."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L107_C2", "label": "expression", "type": "expression", "loc": [107, 114], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L106_C0", "vector": [8, 1, 0.3989, 0.0289, 1, 0.35, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Execute the given command and return the output.\n\n Args:\n command: A string representing the command to execute.\n\n Returns:\n The return code of the process.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L115_C2", "label": "print()", "type": "expression", "loc": [115, 115], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L106_C0", "vector": [8, 1, 0.4152, 0.0036, 1, 0.35, 0.2, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('Running command: %s' % command)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Assign_L116_C2", "label": "process = Popen()", "type": "assigned_variable", "loc": [116, 118], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L106_C0", "vector": [14, 1, 0.4224, 0.0108, 1, 0.35, 0.4, 712, 3, 3, 0, 0, 568, 10, 2], "semantic": {"name": "process", "arg_names": [], "import_names": [], "rhs_call_name": "Popen", "annotation": ""}, "snippet": " process = subprocess.Popen(command.split(' '),\n stdout=subprocess.PIPE,\n stderr=subprocess.PIPE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Assign_L119_C2", "label": "results = communicate()", "type": "assigned_variable", "loc": [119, 119], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L106_C0", "vector": [14, 1, 0.4296, 0.0036, 1, 0.35, 0.6, 143, 3, 0, 0, 0, 768, 10, 1], "semantic": {"name": "results", "arg_names": [], "import_names": [], "rhs_call_name": "communicate", "annotation": ""}, "snippet": " results = process.communicate()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L120_C2", "label": "if", "type": "if", "loc": [120, 121], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L106_C0", "vector": [4, 1, 0.435, 0.0072, 1, 0.35, 0.8, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if process.returncode:\n logging.error(results[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L121_C4", "label": "error()", "type": "expression", "loc": [121, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L120_C2", "vector": [8, 2, 0.4368, 0.0036, 2, 0.13, 0.0, 771, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "error", "arg_names": [], "import_names": [], "rhs_call_name": "error", "annotation": ""}, "snippet": " logging.error(results[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Return_L122_C2", "label": "return", "type": "return", "loc": [122, 122], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L106_C0", "vector": [13, 1, 0.4404, 0.0036, 1, 0.35, 1.0, 0, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return process.returncode"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L125_C0", "label": "SetupAce", "type": "function", "loc": [125, 138], "level": 0, "parent": null, "vector": [2, 0, 0.4747, 0.0505, 0, 0.66, 0.8462, 254, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "SetupAce", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def SetupAce():\n \"\"\"Setup the Ace library.\n\n Checkout the Ace library using git.\n\n Raises:\n ClosureError: If the setup fails.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L126_C2", "label": "expression", "type": "expression", "loc": [126, 132], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L125_C0", "vector": [8, 1, 0.4657, 0.0253, 1, 0.09, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Setup the Ace library.\n\n Checkout the Ace library using git.\n\n Raises:\n ClosureError: If the setup fails.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L134_C2", "label": "if", "type": "if", "loc": [134, 138], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L125_C0", "vector": [4, 1, 0.491, 0.0181, 1, 0.09, 1.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not os.path.exists('ace'):\n ExecuteCommand(CHECKOUT_ACE_COMMAND)\n if not os.path.exists('ace'):\n logging.error('Could not checkout ACE from github.')\n raise ClosureError('Could not set up ACE.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L135_C4", "label": "ExecuteCommand()", "type": "expression", "loc": [135, 135], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L134_C2", "vector": [8, 2, 0.4874, 0.0036, 2, 0.22, 0.0, 789, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "ExecuteCommand", "arg_names": [], "import_names": [], "rhs_call_name": "ExecuteCommand", "annotation": ""}, "snippet": " ExecuteCommand(CHECKOUT_ACE_COMMAND)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L136_C4", "label": "if", "type": "if", "loc": [136, 138], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L134_C2", "vector": [4, 2, 0.4946, 0.0108, 2, 0.22, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not os.path.exists('ace'):\n logging.error('Could not checkout ACE from github.')\n raise ClosureError('Could not set up ACE.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L137_C6", "label": "error()", "type": "expression", "loc": [137, 137], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L136_C4", "vector": [8, 3, 0.4946, 0.0036, 3, 0.57, 0.0, 771, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "error", "arg_names": [], "import_names": [], "rhs_call_name": "error", "annotation": ""}, "snippet": " logging.error('Could not checkout ACE from github.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L141_C0", "label": "SetupClosure", "type": "function", "loc": [141, 186], "level": 0, "parent": null, "vector": [2, 0, 0.5903, 0.1661, 0, 0.66, 0.8846, 844, 0, 0, 0, 0, 0, 0, 27], "semantic": {"name": "SetupClosure", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def SetupClosure():\n \"\"\"Setup the closure library and compiler.\n\n Checkout the closure library using svn if it doesn't exist. Also, download\n the closure compiler.\n\n Raises:\n ClosureError: If the setup fails."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L142_C2", "label": "expression", "type": "expression", "loc": [142, 149], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L141_C0", "vector": [8, 1, 0.5253, 0.0289, 1, 0.01, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Setup the closure library and compiler.\n\n Checkout the closure library using svn if it doesn't exist. Also, download\n the closure compiler.\n\n Raises:\n ClosureError: If the setup fails.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L151_C2", "label": "if", "type": "if", "loc": [151, 157], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L141_C0", "vector": [4, 1, 0.556, 0.0253, 1, 0.01, 0.25, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not os.path.exists('closure-library'):\n ExecuteCommand(CHECKOUT_CLOSURE_COMMAND)\n if not os.path.exists('closure-library'):\n logging.error(('Could not check out the closure library from svn. '\n 'Please check out the closure library to the '\n '\"closure-library\" directory.'))\n raise ClosureError('Could not set up the closure library.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L152_C4", "label": "ExecuteCommand()", "type": "expression", "loc": [152, 152], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L151_C2", "vector": [8, 2, 0.5487, 0.0036, 2, 0.28, 0.0, 789, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "ExecuteCommand", "arg_names": [], "import_names": [], "rhs_call_name": "ExecuteCommand", "annotation": ""}, "snippet": " ExecuteCommand(CHECKOUT_CLOSURE_COMMAND)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L153_C4", "label": "if", "type": "if", "loc": [153, 157], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L151_C2", "vector": [4, 2, 0.5596, 0.0181, 2, 0.28, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not os.path.exists('closure-library'):\n logging.error(('Could not check out the closure library from svn. '\n 'Please check out the closure library to the '\n '\"closure-library\" directory.'))\n raise ClosureError('Could not set up the closure library.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L154_C6", "label": "error()", "type": "expression", "loc": [154, 156], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L153_C4", "vector": [8, 3, 0.5596, 0.0108, 3, 0.02, 0.0, 771, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "error", "arg_names": [], "import_names": [], "rhs_call_name": "error", "annotation": ""}, "snippet": " logging.error(('Could not check out the closure library from svn. '\n 'Please check out the closure library to the '\n '\"closure-library\" directory.'))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L160_C2", "label": "if", "type": "if", "loc": [160, 166], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L141_C0", "vector": [4, 1, 0.5884, 0.0253, 1, 0.01, 0.5, 0, 0, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not os.path.exists('compiler.jar'):\n (compiler_zip, _) = urllib.urlretrieve(CLOSURE_COMPILER_URL)\n compiler_zipfile = zipfile.ZipFile(compiler_zip)\n compiler_zipfile.extract('compiler.jar')\n if not os.path.exists('compiler.jar'):\n logging.error('Could not download the closure compiler jar.')\n raise ClosureError('Could not find the closure compiler.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Assign_L161_C4", "label": "compiler_zip, _ = urlretrieve()", "type": "assigned_variable", "loc": [161, 161], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L160_C2", "vector": [14, 2, 0.5812, 0.0036, 2, 0.83, 0.0, 761, 3, 1, 0, 0, 329, 10, 1], "semantic": {"name": "compiler_zip, _", "arg_names": [], "import_names": [], "rhs_call_name": "urlretrieve", "annotation": ""}, "snippet": " (compiler_zip, _) = urllib.urlretrieve(CLOSURE_COMPILER_URL)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Assign_L162_C4", "label": "compiler_zipfile = ZipFile()", "type": "assigned_variable", "loc": [162, 162], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L160_C2", "vector": [14, 2, 0.5848, 0.0036, 2, 0.83, 0.3333, 337, 3, 1, 0, 0, 299, 10, 1], "semantic": {"name": "compiler_zipfile", "arg_names": [], "import_names": [], "rhs_call_name": "ZipFile", "annotation": ""}, "snippet": " compiler_zipfile = zipfile.ZipFile(compiler_zip)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L163_C4", "label": "extract()", "type": "expression", "loc": [163, 163], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L160_C2", "vector": [8, 2, 0.5884, 0.0036, 2, 0.83, 0.6667, 450, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "extract", "arg_names": [], "import_names": [], "rhs_call_name": "extract", "annotation": ""}, "snippet": " compiler_zipfile.extract('compiler.jar')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L164_C4", "label": "if", "type": "if", "loc": [164, 166], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L160_C2", "vector": [4, 2, 0.5957, 0.0108, 2, 0.83, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not os.path.exists('compiler.jar'):\n logging.error('Could not download the closure compiler jar.')\n raise ClosureError('Could not find the closure compiler.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L165_C6", "label": "error()", "type": "expression", "loc": [165, 165], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L164_C4", "vector": [8, 3, 0.5957, 0.0036, 3, 0.79, 0.0, 771, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "error", "arg_names": [], "import_names": [], "rhs_call_name": "error", "annotation": ""}, "snippet": " logging.error('Could not download the closure compiler jar.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L169_C2", "label": "if", "type": "if", "loc": [169, 178], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L141_C0", "vector": [4, 1, 0.6264, 0.0361, 1, 0.01, 0.75, 0, 0, 0, 0, 0, 0, 0, 10], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (not os.path.exists('SoyToJsSrcCompiler.jar') or\n not os.path.exists('build_gen/soyutils_usegoog.js')):\n (soy_compiler_zip, _) = urllib.urlretrieve(SOY_COMPILER_URL)\n soy_compiler_zipfile = zipfile.ZipFile(soy_compiler_zip)\n soy_compiler_zipfile.extract('SoyToJsSrcCompiler.jar')\n soy_compiler_zipfile.extract('soyutils_usegoog.js', 'build_gen')\n if (not os.path.exists('SoyToJsSrcCompiler.jar') or\n not os.path.exists('build_gen/soyutils_usegoog.js')):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Assign_L171_C4", "label": "soy_compiler_zip, _ = urlretrieve()", "type": "assigned_variable", "loc": [171, 171], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L169_C2", "vector": [14, 2, 0.6173, 0.0036, 2, 0.29, 0.0, 508, 3, 1, 0, 0, 329, 10, 1], "semantic": {"name": "soy_compiler_zip, _", "arg_names": [], "import_names": [], "rhs_call_name": "urlretrieve", "annotation": ""}, "snippet": " (soy_compiler_zip, _) = urllib.urlretrieve(SOY_COMPILER_URL)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Assign_L172_C4", "label": "soy_compiler_zipfile = ZipFile()", "type": "assigned_variable", "loc": [172, 172], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L169_C2", "vector": [14, 2, 0.6209, 0.0036, 2, 0.29, 0.25, 110, 3, 1, 0, 0, 299, 10, 1], "semantic": {"name": "soy_compiler_zipfile", "arg_names": [], "import_names": [], "rhs_call_name": "ZipFile", "annotation": ""}, "snippet": " soy_compiler_zipfile = zipfile.ZipFile(soy_compiler_zip)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L173_C4", "label": "extract()", "type": "expression", "loc": [173, 173], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L169_C2", "vector": [8, 2, 0.6245, 0.0036, 2, 0.29, 0.5, 450, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "extract", "arg_names": [], "import_names": [], "rhs_call_name": "extract", "annotation": ""}, "snippet": " soy_compiler_zipfile.extract('SoyToJsSrcCompiler.jar')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L174_C4", "label": "extract()", "type": "expression", "loc": [174, 174], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L169_C2", "vector": [8, 2, 0.6282, 0.0036, 2, 0.29, 0.75, 450, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "extract", "arg_names": [], "import_names": [], "rhs_call_name": "extract", "annotation": ""}, "snippet": " soy_compiler_zipfile.extract('soyutils_usegoog.js', 'build_gen')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L175_C4", "label": "if", "type": "if", "loc": [175, 178], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L169_C2", "vector": [4, 2, 0.6372, 0.0144, 2, 0.29, 1.0, 0, 0, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (not os.path.exists('SoyToJsSrcCompiler.jar') or\n not os.path.exists('build_gen/soyutils_usegoog.js')):\n logging.error('Could not download the soy compiler jar.')\n raise ClosureError('Could not find the soy compiler.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L177_C6", "label": "error()", "type": "expression", "loc": [177, 177], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L175_C4", "vector": [8, 3, 0.639, 0.0036, 3, 0.2, 0.0, 771, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "error", "arg_names": [], "import_names": [], "rhs_call_name": "error", "annotation": ""}, "snippet": " logging.error('Could not download the soy compiler jar.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L182_C2", "label": "if", "type": "if", "loc": [182, 186], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L141_C0", "vector": [4, 1, 0.6643, 0.0181, 1, 0.01, 1.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not os.path.exists('build_gen/soydata.js'):\n urllib.urlretrieve(SOYDATA_URL, 'build_gen/soydata.js')\n if not os.path.exists('build_gen/soydata.js'):\n logging.error('Could not download soydata.js.')\n raise ClosureError('Could not fine soydata.js')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L183_C4", "label": "urlretrieve()", "type": "expression", "loc": [183, 183], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L182_C2", "vector": [8, 2, 0.6606, 0.0036, 2, 0.15, 0.0, 329, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "urlretrieve", "arg_names": [], "import_names": [], "rhs_call_name": "urlretrieve", "annotation": ""}, "snippet": " urllib.urlretrieve(SOYDATA_URL, 'build_gen/soydata.js')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L184_C4", "label": "if", "type": "if", "loc": [184, 186], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L182_C2", "vector": [4, 2, 0.6679, 0.0108, 2, 0.15, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not os.path.exists('build_gen/soydata.js'):\n logging.error('Could not download soydata.js.')\n raise ClosureError('Could not fine soydata.js')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L185_C6", "label": "error()", "type": "expression", "loc": [185, 185], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L184_C4", "vector": [8, 3, 0.6679, 0.0036, 3, 0.13, 0.0, 771, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "error", "arg_names": [], "import_names": [], "rhs_call_name": "error", "annotation": ""}, "snippet": " logging.error('Could not download soydata.js.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L189_C0", "label": "SetupSelenium", "type": "function", "loc": [189, 202], "level": 0, "parent": null, "vector": [2, 0, 0.7058, 0.0505, 0, 0.66, 0.9231, 313, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "SetupSelenium", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def SetupSelenium():\n \"\"\"Setup the selenium library.\n\n Checkout necessary files from the selenium library using svn, if they\n don't exist.\n\n Raises:\n ClosureError: If the setup fails."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L190_C2", "label": "expression", "type": "expression", "loc": [190, 197], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L189_C0", "vector": [8, 1, 0.6986, 0.0289, 1, 0.56, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"Setup the selenium library.\n\n Checkout necessary files from the selenium library using svn, if they\n don't exist.\n\n Raises:\n ClosureError: If the setup fails.\n \"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L198_C2", "label": "if", "type": "if", "loc": [198, 202], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L189_C0", "vector": [4, 1, 0.722, 0.0181, 1, 0.56, 1.0, 0, 0, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not os.path.exists('selenium-atoms-lib/bot.js'):\n ExecuteCommand(CHECKOUT_SELENIUM_COMMAND)\n if not os.path.exists('selenium-atoms-lib/bot.js'):\n logging.error('Could not download the selenium library.')\n raise ClosureError('Could not find the selenium library.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L199_C4", "label": "ExecuteCommand()", "type": "expression", "loc": [199, 199], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L198_C2", "vector": [8, 2, 0.7184, 0.0036, 2, 0.52, 0.0, 789, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "ExecuteCommand", "arg_names": [], "import_names": [], "rhs_call_name": "ExecuteCommand", "annotation": ""}, "snippet": " ExecuteCommand(CHECKOUT_SELENIUM_COMMAND)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L200_C4", "label": "if", "type": "if", "loc": [200, 202], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L198_C2", "vector": [4, 2, 0.7256, 0.0108, 2, 0.52, 1.0, 0, 0, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not os.path.exists('selenium-atoms-lib/bot.js'):\n logging.error('Could not download the selenium library.')\n raise ClosureError('Could not find the selenium library.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L201_C6", "label": "error()", "type": "expression", "loc": [201, 201], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L200_C4", "vector": [8, 3, 0.7256, 0.0036, 3, 0.71, 0.0, 771, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "error", "arg_names": [], "import_names": [], "rhs_call_name": "error", "annotation": ""}, "snippet": " logging.error('Could not download the selenium library.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L205_C0", "label": "main", "type": "function", "loc": [205, 272], "level": 0, "parent": null, "vector": [2, 0, 0.861, 0.2455, 0, 0.66, 0.9615, 624, 0, 0, 0, 0, 0, 0, 29], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def main():\n usage = 'usage: %prog [options]'\n parser = optparse.OptionParser(usage)\n parser.add_option('--clean', dest='build_clean',\n action='store_true', default=False,\n help='Clean the build directories.')\n (options, _) = parser.parse_args()\n"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Assign_L206_C2", "label": "usage =", "type": "assigned_variable", "loc": [206, 206], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L205_C0", "vector": [14, 1, 0.7437, 0.0036, 1, 0.65, 0.0, 129, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "usage", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " usage = 'usage: %prog [options]'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Assign_L207_C2", "label": "parser = OptionParser()", "type": "assigned_variable", "loc": [207, 207], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L205_C0", "vector": [14, 1, 0.7473, 0.0036, 1, 0.65, 0.0455, 968, 3, 1, 0, 0, 894, 10, 1], "semantic": {"name": "parser", "arg_names": [], "import_names": [], "rhs_call_name": "OptionParser", "annotation": ""}, "snippet": " parser = optparse.OptionParser(usage)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L208_C2", "label": "add_option()", "type": "expression", "loc": [208, 210], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L205_C0", "vector": [8, 1, 0.7545, 0.0108, 1, 0.65, 0.0909, 176, 3, 5, 0, 0, 0, 0, 1], "semantic": {"name": "add_option", "arg_names": [], "import_names": [], "rhs_call_name": "add_option", "annotation": ""}, "snippet": " parser.add_option('--clean', dest='build_clean',\n action='store_true', default=False,\n help='Clean the build directories.')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Assign_L211_C2", "label": "options, _ = parse_args()", "type": "assigned_variable", "loc": [211, 211], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L205_C0", "vector": [14, 1, 0.7617, 0.0036, 1, 0.65, 0.1364, 735, 3, 0, 0, 0, 187, 10, 1], "semantic": {"name": "options, _", "arg_names": [], "import_names": [], "rhs_call_name": "parse_args", "annotation": ""}, "snippet": " (options, _) = parser.parse_args()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L213_C2", "label": "if", "type": "if", "loc": [213, 215], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L205_C0", "vector": [4, 1, 0.7726, 0.0108, 1, 0.65, 0.1818, 0, 7, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if options.build_clean:\n Clean()\n exit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L214_C4", "label": "Clean()", "type": "expression", "loc": [214, 214], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L213_C2", "vector": [8, 2, 0.7726, 0.0036, 2, 0.95, 0.0, 416, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "Clean", "arg_names": [], "import_names": [], "rhs_call_name": "Clean", "annotation": ""}, "snippet": " Clean()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L215_C4", "label": "exit()", "type": "expression", "loc": [215, 215], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L213_C2", "vector": [8, 2, 0.7762, 0.0036, 2, 0.95, 1.0, 436, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "exit", "arg_names": [], "import_names": [], "rhs_call_name": "exit", "annotation": ""}, "snippet": " exit()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L218_C2", "label": "if", "type": "if", "loc": [218, 219], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L205_C0", "vector": [4, 1, 0.7888, 0.0072, 1, 0.65, 0.2273, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not os.path.exists('build'):\n os.mkdir('build')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L219_C4", "label": "mkdir()", "type": "expression", "loc": [219, 219], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L218_C2", "vector": [8, 2, 0.7906, 0.0036, 2, 0.8, 0.0, 853, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "mkdir", "arg_names": [], "import_names": [], "rhs_call_name": "mkdir", "annotation": ""}, "snippet": " os.mkdir('build')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L220_C2", "label": "if", "type": "if", "loc": [220, 221], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L205_C0", "vector": [4, 1, 0.796, 0.0072, 1, 0.65, 0.2727, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not os.path.exists('build/options'):\n os.mkdir('build/options')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L221_C4", "label": "mkdir()", "type": "expression", "loc": [221, 221], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L220_C2", "vector": [8, 2, 0.7978, 0.0036, 2, 0.45, 0.0, 853, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "mkdir", "arg_names": [], "import_names": [], "rhs_call_name": "mkdir", "annotation": ""}, "snippet": " os.mkdir('build/options')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L222_C2", "label": "if", "type": "if", "loc": [222, 223], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L205_C0", "vector": [4, 1, 0.8032, 0.0072, 1, 0.65, 0.3182, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not os.path.exists('build_gen'):\n os.mkdir('build_gen')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L223_C4", "label": "mkdir()", "type": "expression", "loc": [223, 223], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L222_C2", "vector": [8, 2, 0.8051, 0.0036, 2, 0.37, 0.0, 853, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "mkdir", "arg_names": [], "import_names": [], "rhs_call_name": "mkdir", "annotation": ""}, "snippet": " os.mkdir('build_gen')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L226_C2", "label": "SetupClosure()", "type": "expression", "loc": [226, 226], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L205_C0", "vector": [8, 1, 0.8159, 0.0036, 1, 0.65, 0.3636, 844, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "SetupClosure", "arg_names": [], "import_names": [], "rhs_call_name": "SetupClosure", "annotation": ""}, "snippet": " SetupClosure()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L227_C2", "label": "SetupSelenium()", "type": "expression", "loc": [227, 227], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L205_C0", "vector": [8, 1, 0.8195, 0.0036, 1, 0.65, 0.4091, 313, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "SetupSelenium", "arg_names": [], "import_names": [], "rhs_call_name": "SetupSelenium", "annotation": ""}, "snippet": " SetupSelenium()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L228_C2", "label": "SetupAce()", "type": "expression", "loc": [228, 228], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L205_C0", "vector": [8, 1, 0.8231, 0.0036, 1, 0.65, 0.4545, 254, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "SetupAce", "arg_names": [], "import_names": [], "rhs_call_name": "SetupAce", "annotation": ""}, "snippet": " SetupAce()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Assign_L231_C2", "label": "soy_files =", "type": "assigned_variable", "loc": [231, 237], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L205_C0", "vector": [14, 1, 0.8448, 0.0253, 1, 0.65, 0.5, 888, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "soy_files", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " soy_files = ['consoles.soy',\n 'rpfconsole.soy',\n 'rpf_dialogs.soy',\n 'locatorsupdater.soy',\n 'newbug_console.soy',\n 'newbug_type_selector.soy',\n 'popup.soy']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:For_L239_C2", "label": "for soy_filename", "type": "for", "loc": [239, 240], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L205_C0", "vector": [6, 1, 0.8646, 0.0072, 1, 0.65, 0.5455, 459, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "soy_filename", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for soy_filename in soy_files:\n BuildSoyJs(os.path.join('src', soy_filename))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L240_C4", "label": "BuildSoyJs()", "type": "expression", "loc": [240, 240], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:For_L239_C2", "vector": [8, 2, 0.8664, 0.0036, 2, 0.29, 0.0, 853, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "BuildSoyJs", "arg_names": [], "import_names": [], "rhs_call_name": "BuildSoyJs", "annotation": ""}, "snippet": " BuildSoyJs(os.path.join('src', soy_filename))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Assign_L242_C2", "label": "js_targets =", "type": "assigned_variable", "loc": [242, 248], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L205_C0", "vector": [14, 1, 0.8845, 0.0253, 1, 0.65, 0.5909, 208, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "js_targets", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " js_targets = {'background.js': 'background_script.js',\n 'content.js': 'content_script.js',\n 'getactioninfo.js': 'getactioninfo_script.js',\n 'console.js': 'console_script.js',\n 'elementhelper.js': 'elementhelper_script.js',\n 'popup.js': 'popup_script.js',\n 'options/page.js': 'options_script.js'}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:For_L250_C2", "label": "for target", "type": "for", "loc": [250, 252], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L205_C0", "vector": [6, 1, 0.9061, 0.0108, 1, 0.65, 0.6364, 766, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "target", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for target in js_targets:\n BuildClosureScript(os.path.join('src', target),\n os.path.join('build', js_targets[target]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L251_C4", "label": "BuildClosureScript()", "type": "expression", "loc": [251, 252], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:For_L250_C2", "vector": [8, 2, 0.9079, 0.0072, 2, 0.07, 0.0, 257, 3, 2, 0, 0, 0, 0, 3], "semantic": {"name": "BuildClosureScript", "arg_names": [], "import_names": [], "rhs_call_name": "BuildClosureScript", "annotation": ""}, "snippet": " BuildClosureScript(os.path.join('src', target),\n os.path.join('build', js_targets[target]))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L255_C2", "label": "if", "type": "if", "loc": [255, 256], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L205_C0", "vector": [4, 1, 0.9224, 0.0072, 1, 0.65, 0.6818, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if os.path.exists('build/styles'):\n shutil.rmtree('build/styles')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L256_C4", "label": "rmtree()", "type": "expression", "loc": [256, 256], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L255_C2", "vector": [8, 2, 0.9242, 0.0036, 2, 0.59, 0.0, 317, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "rmtree", "arg_names": [], "import_names": [], "rhs_call_name": "rmtree", "annotation": ""}, "snippet": " shutil.rmtree('build/styles')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L257_C2", "label": "copytree()", "type": "expression", "loc": [257, 257], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L205_C0", "vector": [8, 1, 0.9278, 0.0036, 1, 0.65, 0.7273, 739, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "copytree", "arg_names": [], "import_names": [], "rhs_call_name": "copytree", "annotation": ""}, "snippet": " shutil.copytree('src/styles', 'build/styles')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L258_C2", "label": "if", "type": "if", "loc": [258, 259], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L205_C0", "vector": [4, 1, 0.9332, 0.0072, 1, 0.65, 0.7727, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if os.path.exists('build/imgs'):\n shutil.rmtree('build/imgs')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L259_C4", "label": "rmtree()", "type": "expression", "loc": [259, 259], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L258_C2", "vector": [8, 2, 0.935, 0.0036, 2, 0.17, 0.0, 317, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "rmtree", "arg_names": [], "import_names": [], "rhs_call_name": "rmtree", "annotation": ""}, "snippet": " shutil.rmtree('build/imgs')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L260_C2", "label": "copytree()", "type": "expression", "loc": [260, 260], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L205_C0", "vector": [8, 1, 0.9386, 0.0036, 1, 0.65, 0.8182, 739, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "copytree", "arg_names": [], "import_names": [], "rhs_call_name": "copytree", "annotation": ""}, "snippet": " shutil.copytree('src/imgs', 'build/imgs')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Assign_L261_C2", "label": "static_files =", "type": "assigned_variable", "loc": [261, 265], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L205_C0", "vector": [14, 1, 0.9495, 0.0181, 1, 0.65, 0.8636, 748, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "static_files", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " static_files = ['src/background.html',\n 'src/console.html',\n 'src/options/options.html',\n 'src/popup.html',\n 'manifest.json']"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:For_L266_C2", "label": "for static_file", "type": "for", "loc": [266, 267], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L205_C0", "vector": [6, 1, 0.9621, 0.0072, 1, 0.65, 0.9091, 76, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "static_file", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for static_file in static_files:\n shutil.copy(static_file, 'build')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L267_C4", "label": "copy()", "type": "expression", "loc": [267, 267], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:For_L266_C2", "vector": [8, 2, 0.9639, 0.0036, 2, 0.47, 0.0, 739, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "copy", "arg_names": [], "import_names": [], "rhs_call_name": "copy", "annotation": ""}, "snippet": " shutil.copy(static_file, 'build')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L270_C2", "label": "if", "type": "if", "loc": [270, 271], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L205_C0", "vector": [4, 1, 0.9765, 0.0072, 1, 0.65, 0.9545, 0, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if os.path.exists('build/ace'):\n shutil.rmtree('build/ace')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L271_C4", "label": "rmtree()", "type": "expression", "loc": [271, 271], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L270_C2", "vector": [8, 2, 0.9783, 0.0036, 2, 0.31, 0.0, 317, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "rmtree", "arg_names": [], "import_names": [], "rhs_call_name": "rmtree", "annotation": ""}, "snippet": " shutil.rmtree('build/ace')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L272_C2", "label": "copytree()", "type": "expression", "loc": [272, 272], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L205_C0", "vector": [8, 1, 0.9819, 0.0036, 1, 0.65, 1.0, 739, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "copytree", "arg_names": [], "import_names": [], "rhs_call_name": "copytree", "annotation": ""}, "snippet": " shutil.copytree('ace/build/src', 'build/ace')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L275_C0", "label": "if", "type": "if", "loc": [275, 276], "level": 0, "parent": null, "vector": [4, 0, 0.9946, 0.0072, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n main()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L276_C2", "label": "main()", "type": "expression", "loc": [276, 276], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L275_C0", "vector": [8, 1, 0.9964, 0.0036, 1, 0.2, 0.0, 624, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "main", "annotation": ""}, "snippet": " main()"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L60_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L61_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L60_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:Assign_L71_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L60_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L76_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L81_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:Assign_L90_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:Assign_L91_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L95_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L99_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L100_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L100_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L101_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L99_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L102_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L102_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L103_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L106_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L107_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L106_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L115_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L106_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:Assign_L116_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L106_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:Assign_L119_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L106_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L120_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L120_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L121_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L106_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:Return_L122_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L125_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L126_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L125_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L134_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L134_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L135_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L134_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L136_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L136_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L137_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L142_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L151_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L151_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L152_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L151_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L153_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L153_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L154_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L160_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L160_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:Assign_L161_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L160_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:Assign_L162_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L160_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L163_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L160_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L164_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L164_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L165_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L169_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L169_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:Assign_L171_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L169_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:Assign_L172_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L169_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L173_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L169_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L174_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L169_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L175_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L175_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L177_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L141_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L182_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L182_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L183_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L182_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L184_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L184_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L185_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L189_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L190_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L189_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L198_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L198_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L199_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L198_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L200_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L200_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L201_C6"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L205_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:Assign_L206_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L205_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:Assign_L207_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L205_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L208_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L205_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:Assign_L211_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L205_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L213_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L213_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L214_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L213_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L215_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L205_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L218_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L218_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L219_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L205_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L220_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L220_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L221_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L205_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L222_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L222_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L223_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L205_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L226_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L205_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L227_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L205_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L228_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L205_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:Assign_L231_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L205_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:For_L239_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:For_L239_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L240_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L205_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:Assign_L242_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L205_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:For_L250_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:For_L250_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L251_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L205_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L255_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L255_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L256_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L205_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L257_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L205_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L258_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L258_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L259_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L205_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L260_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L205_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:Assign_L261_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L205_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:For_L266_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:For_L266_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L267_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L205_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L270_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L270_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L271_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:FunctionDef_L205_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L272_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99987:If_L275_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99987:Expr_L276_C2"}] |
'''
este script parsea los atributos de personajes y ciudades descargando los datos de
la url especificada en URL, y los guarda en formato JSON.
require python 2.7
'''
import urllib2
import re
import json
from __builtin__ import file
URL = r'http://www.gamefaqs.com/sms/588168-where-in-the-world-is-carmen-sandiego/faqs/58370'
RAW_DATA_FILENAME = 'website.txt'
def dict_parse(data):
data = re.sub(r' +', ' ', data, flags=re.MULTILINE)
data = re.sub(r'\n+', '\n', data, flags=re.MULTILINE)
items = re.findall(r"""
\.+ \n
(
(?:
\w+ \: [ ]+ [\w\ \?,]+ \n
)+
)
""", data, re.MULTILINE | re.DOTALL | re.X)
data_list = []
for item in items:
fields = item.split('\n')
data_dict = {}
for field in fields:
if not field:
continue
key, data = field.split(':')
data_dict[key] = data.lstrip().rstrip()
data_list.append(data_dict)
return data_list
def loot_parse(data):
lines = data.split('\n')
data_dict = {}
for line in lines:
if not line.startswith('-'):
continue
match = re.match(r"""
\-[ ]+
(
[^\(]+ # item
)
\ \((
[\w ]+ # country
)\)
""", line, flags=re.X)
data_dict[match.group(1)] = match.group(2)
return data_dict
SECTIONS = {
'cities': dict_parse,
'dossiers': dict_parse,
'loot': loot_parse,
}
def download_data(URL):
print 'descargando de %s...' % URL
req = urllib2.Request(URL, headers={'User-Agent' : "Some browser"})
con = urllib2.urlopen(req)
data = con.read()
print 'OK'
with open(RAW_DATA_FILENAME, 'w') as f:
f.write(data)
return data
def get_website_data():
try:
with open(RAW_DATA_FILENAME, 'r') as f:
data = f.read()
except (IOError, OSError):
data = download_data(URL)
return parse_website_data(data)
def parse_website_data(data):
match = re.search(r'\<pre\>(.*?)\<\/pre\>', data, re.DOTALL | re.MULTILINE)
data = match.group(1)
return data.lower().replace('\r', '')
def parse_sections(raw):
sections = re.split(r'\*+\r?\n', data, flags=re.DOTALL | re.MULTILINE)
selection = {}
indexes = '|'.join(['(?:%s)' % s for s in SECTIONS])
for section in sections:
match = re.match(r'[vix]*\. +(%s)\s*(.*)' % indexes, section, flags=re.DOTALL | re.MULTILINE)
if match:
section, content = match.group(1), match.group(2)
parser = SECTIONS[section]
selection[section] = parser(content)
return selection
if __name__ == '__main__':
data = get_website_data()
print 'parseando...'
sections = parse_sections(data)
print 'OK'
for k, v in sections.items():
filename = '%s.json' % k
print 'creando archivo %s' % filename
with open(filename, 'w') as fp:
json.dump(v, fp, indent=4)
print 'OK'
| ajibawa-2023/Python-Code-Large/train/row_99988 | 68 | 127 | 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_99988:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 6], "level": 0, "parent": null, "vector": [8, 0, 0.0276, 0.0472, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "'''\neste script parsea los atributos de personajes y ciudades descargando los datos de\nla url especificada en URL, y los guarda en formato JSON.\n\nrequire python 2.7\n'''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99988:Import_L9_C0", "label": "urllib2 import urllib2", "type": "import", "loc": [9, 9], "level": 0, "parent": null, "vector": [1, 0, 0.0709, 0.0079, 0, 0.66, 0.0714, 345, 0, 1, 0, 0, 345, 0, 0], "semantic": {"name": "urllib2", "arg_names": [], "import_names": ["urllib2"], "rhs_call_name": "", "annotation": ""}, "snippet": "import urllib2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99988:Import_L10_C0", "label": "re import re", "type": "import", "loc": [10, 10], "level": 0, "parent": null, "vector": [1, 0, 0.0787, 0.0079, 0, 0.66, 0.1429, 540, 0, 1, 0, 0, 540, 0, 0], "semantic": {"name": "re", "arg_names": [], "import_names": ["re"], "rhs_call_name": "", "annotation": ""}, "snippet": "import re"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99988:Import_L11_C0", "label": "json import json", "type": "import", "loc": [11, 11], "level": 0, "parent": null, "vector": [1, 0, 0.0866, 0.0079, 0, 0.66, 0.2143, 463, 0, 1, 0, 0, 463, 0, 0], "semantic": {"name": "json", "arg_names": [], "import_names": ["json"], "rhs_call_name": "", "annotation": ""}, "snippet": "import json"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99988:ImportFrom_L12_C0", "label": "from __builtin__ import file", "type": "import", "loc": [12, 12], "level": 0, "parent": null, "vector": [1, 0, 0.0945, 0.0079, 0, 0.66, 0.2857, 364, 0, 1, 0, 0, 364, 0, 0], "semantic": {"name": "__builtin__", "arg_names": [], "import_names": ["file"], "rhs_call_name": "", "annotation": ""}, "snippet": "from __builtin__ import file"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99988:Assign_L15_C0", "label": "URL =", "type": "assigned_variable", "loc": [15, 15], "level": 0, "parent": null, "vector": [14, 0, 0.1181, 0.0079, 0, 0.66, 0.3571, 759, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "URL", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "URL = r'http://www.gamefaqs.com/sms/588168-where-in-the-world-is-carmen-sandiego/faqs/58370'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99988:Assign_L16_C0", "label": "RAW_DATA_FILENAME =", "type": "assigned_variable", "loc": [16, 16], "level": 0, "parent": null, "vector": [14, 0, 0.126, 0.0079, 0, 0.66, 0.4286, 95, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "RAW_DATA_FILENAME", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "RAW_DATA_FILENAME = 'website.txt'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99988:FunctionDef_L19_C0", "label": "dict_parse", "type": "function", "loc": [19, 45], "level": 0, "parent": null, "vector": [2, 0, 0.252, 0.2126, 0, 0.66, 0.5, 73, 0, 1, 1, 0, 0, 0, 8], "semantic": {"name": "dict_parse", "arg_names": ["data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def dict_parse(data):\n data = re.sub(r' +', ' ', data, flags=re.MULTILINE)\n data = re.sub(r'\\n+', '\\n', data, flags=re.MULTILINE)\n\n items = re.findall(r\"\"\"\n \\.+ \\n\n (\n (?:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99988:Assign_L20_C4", "label": "data = sub()", "type": "assigned_variable", "loc": [20, 20], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99988:FunctionDef_L19_C0", "vector": [14, 1, 0.1575, 0.0079, 1, 0.72, 0.0, 929, 3, 4, 0, 0, 819, 10, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "sub", "annotation": ""}, "snippet": " data = re.sub(r' +', ' ', data, flags=re.MULTILINE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99988:Assign_L21_C4", "label": "data = sub()", "type": "assigned_variable", "loc": [21, 21], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99988:FunctionDef_L19_C0", "vector": [14, 1, 0.1654, 0.0079, 1, 0.72, 0.2, 929, 3, 4, 0, 0, 819, 10, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "sub", "annotation": ""}, "snippet": " data = re.sub(r'\\n+', '\\n', data, flags=re.MULTILINE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99988:Assign_L23_C4", "label": "items = findall()", "type": "assigned_variable", "loc": [23, 30], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99988:FunctionDef_L19_C0", "vector": [14, 1, 0.2087, 0.063, 1, 0.72, 0.4, 339, 3, 3, 0, 0, 737, 10, 1], "semantic": {"name": "items", "arg_names": [], "import_names": [], "rhs_call_name": "findall", "annotation": ""}, "snippet": " items = re.findall(r\"\"\"\n \\.+ \\n\n (\n (?:\n \\w+ \\: [ ]+ [\\w\\ \\?,]+ \\n\n )+\n )\n \"\"\", data, re.MULTILINE | re.DOTALL | re.X)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99988:Assign_L32_C4", "label": "data_list =", "type": "assigned_variable", "loc": [32, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99988:FunctionDef_L19_C0", "vector": [14, 1, 0.252, 0.0079, 1, 0.72, 0.6, 390, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "data_list", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " data_list = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99988:For_L33_C4", "label": "for item", "type": "for", "loc": [33, 43], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99988:FunctionDef_L19_C0", "vector": [6, 1, 0.2992, 0.0866, 1, 0.72, 0.8, 434, 2, 0, 0, 0, 0, 0, 5], "semantic": {"name": "item", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for item in items:\n fields = item.split('\\n')\n\n data_dict = {}\n for field in fields:\n if not field:\n continue\n key, data = field.split(':')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99988:Assign_L34_C8", "label": "fields = split()", "type": "assigned_variable", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99988:For_L33_C4", "vector": [14, 2, 0.2677, 0.0079, 2, 0.12, 0.0, 358, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "fields", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " fields = item.split('\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99988:Assign_L36_C8", "label": "data_dict =", "type": "assigned_variable", "loc": [36, 36], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99988:For_L33_C4", "vector": [14, 2, 0.2835, 0.0079, 2, 0.12, 0.3333, 23, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "data_dict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " data_dict = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99988:For_L37_C8", "label": "for field", "type": "for", "loc": [37, 41], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99988:For_L33_C4", "vector": [6, 2, 0.3071, 0.0394, 2, 0.12, 0.6667, 480, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "field", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for field in fields:\n if not field:\n continue\n key, data = field.split(':')\n data_dict[key] = data.lstrip().rstrip()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99988:If_L38_C12", "label": "if", "type": "if", "loc": [38, 39], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99988:For_L37_C8", "vector": [4, 3, 0.3031, 0.0157, 3, 0.69, 0.0, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not field:\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99988:Assign_L40_C12", "label": "key, data = split()", "type": "assigned_variable", "loc": [40, 40], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99988:For_L37_C8", "vector": [14, 3, 0.315, 0.0079, 3, 0.69, 0.5, 530, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "key, data", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " key, data = field.split(':')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99988:Assign_L41_C12", "label": " = rstrip()", "type": "assigned_variable", "loc": [41, 41], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99988:For_L37_C8", "vector": [14, 3, 0.3228, 0.0079, 3, 0.69, 1.0, 0, 3, 0, 0, 0, 807, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "rstrip", "annotation": ""}, "snippet": " data_dict[key] = data.lstrip().rstrip()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99988:Expr_L43_C8", "label": "append()", "type": "expression", "loc": [43, 43], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99988:For_L33_C4", "vector": [8, 2, 0.3386, 0.0079, 2, 0.12, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " data_list.append(data_dict)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99988:Return_L45_C4", "label": "return", "type": "return", "loc": [45, 45], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99988:FunctionDef_L19_C0", "vector": [13, 1, 0.3543, 0.0079, 1, 0.72, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return data_list"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99988:FunctionDef_L48_C0", "label": "loot_parse", "type": "function", "loc": [48, 66], "level": 0, "parent": null, "vector": [2, 0, 0.4488, 0.1496, 0, 0.66, 0.5714, 777, 0, 1, 1, 0, 0, 0, 5], "semantic": {"name": "loot_parse", "arg_names": ["data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def loot_parse(data):\n lines = data.split('\\n')\n\n data_dict = {}\n for line in lines:\n if not line.startswith('-'):\n continue\n match = re.match(r\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99988:Assign_L49_C4", "label": "lines = split()", "type": "assigned_variable", "loc": [49, 49], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99988:FunctionDef_L48_C0", "vector": [14, 1, 0.3858, 0.0079, 1, 0.17, 0.0, 73, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "lines", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " lines = data.split('\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99988:Assign_L51_C4", "label": "data_dict =", "type": "assigned_variable", "loc": [51, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99988:FunctionDef_L48_C0", "vector": [14, 1, 0.4016, 0.0079, 1, 0.17, 0.3333, 23, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "data_dict", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " data_dict = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99988:For_L52_C4", "label": "for line", "type": "for", "loc": [52, 64], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99988:FunctionDef_L48_C0", "vector": [6, 1, 0.4567, 0.1024, 1, 0.17, 0.6667, 373, 2, 0, 0, 0, 0, 0, 4], "semantic": {"name": "line", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for line in lines:\n if not line.startswith('-'):\n continue\n match = re.match(r\"\"\"\n \\-[ ]+\n (\n [^\\(]+ # item\n )"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99988:If_L53_C8", "label": "if", "type": "if", "loc": [53, 54], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99988:For_L52_C4", "vector": [4, 2, 0.4213, 0.0157, 2, 0.14, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if not line.startswith('-'):\n continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99988:Assign_L55_C8", "label": "match = match()", "type": "assigned_variable", "loc": [55, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99988:For_L52_C4", "vector": [14, 2, 0.4646, 0.0709, 2, 0.14, 0.5, 36, 3, 3, 0, 0, 36, 10, 1], "semantic": {"name": "match", "arg_names": [], "import_names": [], "rhs_call_name": "match", "annotation": ""}, "snippet": " match = re.match(r\"\"\"\n \\-[ ]+\n (\n [^\\(]+ # item\n )\n \\ \\((\n [\\w ]+ # country\n )\\)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99988:Assign_L64_C8", "label": " = group()", "type": "assigned_variable", "loc": [64, 64], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99988:For_L52_C4", "vector": [14, 2, 0.5039, 0.0079, 2, 0.14, 1.0, 0, 3, 1, 0, 0, 43, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": " data_dict[match.group(1)] = match.group(2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99988:Return_L66_C4", "label": "return", "type": "return", "loc": [66, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99988:FunctionDef_L48_C0", "vector": [13, 1, 0.5197, 0.0079, 1, 0.17, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return data_dict"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99988:Assign_L69_C0", "label": "SECTIONS =", "type": "assigned_variable", "loc": [69, 73], "level": 0, "parent": null, "vector": [14, 0, 0.5591, 0.0394, 0, 0.66, 0.6429, 544, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "SECTIONS", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SECTIONS = {\n 'cities': dict_parse,\n 'dossiers': dict_parse,\n 'loot': loot_parse,\n}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99988:FunctionDef_L76_C0", "label": "download_data", "type": "function", "loc": [76, 86], "level": 0, "parent": null, "vector": [2, 0, 0.6378, 0.0866, 0, 0.66, 0.7143, 883, 0, 1, 1, 0, 0, 0, 7], "semantic": {"name": "download_data", "arg_names": ["URL"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def download_data(URL):\n print('descargando de %s...' % URL)\n req = urllib2.Request(URL, headers={'User-Agent' : \"Some browser\"})\n con = urllib2.urlopen(req)\n data = con.read()\n print('OK')\n\n with open(RAW_DATA_FILENAME, 'w') as f:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99988:Expr_L77_C4", "label": "print()", "type": "expression", "loc": [77, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99988:FunctionDef_L76_C0", "vector": [8, 1, 0.6063, 0.0079, 1, 0.71, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('descargando de %s...' % URL)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99988:Assign_L78_C4", "label": "req = Request()", "type": "assigned_variable", "loc": [78, 78], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99988:FunctionDef_L76_C0", "vector": [14, 1, 0.6142, 0.0079, 1, 0.71, 0.2, 233, 3, 2, 0, 0, 51, 10, 1], "semantic": {"name": "req", "arg_names": [], "import_names": [], "rhs_call_name": "Request", "annotation": ""}, "snippet": " req = urllib2.Request(URL, headers={'User-Agent' : \"Some browser\"})"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99988:Assign_L79_C4", "label": "con = urlopen()", "type": "assigned_variable", "loc": [79, 79], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99988:FunctionDef_L76_C0", "vector": [14, 1, 0.622, 0.0079, 1, 0.71, 0.4, 761, 3, 1, 0, 0, 687, 10, 1], "semantic": {"name": "con", "arg_names": [], "import_names": [], "rhs_call_name": "urlopen", "annotation": ""}, "snippet": " con = urllib2.urlopen(req)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99988:Assign_L80_C4", "label": "data = read()", "type": "assigned_variable", "loc": [80, 80], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99988:FunctionDef_L76_C0", "vector": [14, 1, 0.6299, 0.0079, 1, 0.71, 0.6, 929, 3, 0, 0, 0, 453, 10, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "read", "annotation": ""}, "snippet": " data = con.read()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99988:Expr_L81_C4", "label": "print()", "type": "expression", "loc": [81, 81], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99988:FunctionDef_L76_C0", "vector": [8, 1, 0.6378, 0.0079, 1, 0.71, 0.8, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('OK')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99988:Expr_L84_C8", "label": "write()", "type": "expression", "loc": [84, 84], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99988:FunctionDef_L76_C0", "vector": [8, 1, 0.6614, 0.0079, 1, 0.71, 0.0, 837, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": " f.write(data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99988:Return_L86_C4", "label": "return", "type": "return", "loc": [86, 86], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99988:FunctionDef_L76_C0", "vector": [13, 1, 0.6772, 0.0079, 1, 0.71, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return data"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99988:FunctionDef_L88_C0", "label": "get_website_data", "type": "function", "loc": [88, 94], "level": 0, "parent": null, "vector": [2, 0, 0.7165, 0.0551, 0, 0.66, 0.7857, 926, 0, 0, 1, 0, 0, 0, 4], "semantic": {"name": "get_website_data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def get_website_data():\n try:\n with open(RAW_DATA_FILENAME, 'r') as f:\n data = f.read()\n except (IOError, OSError):\n data = download_data(URL)\n return parse_website_data(data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99988:Try_L89_C4", "label": "try", "type": "try", "loc": [89, 93], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99988:FunctionDef_L88_C0", "vector": [7, 1, 0.7165, 0.0394, 1, 0.95, 0.0, 0, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " try:\n with open(RAW_DATA_FILENAME, 'r') as f:\n data = f.read()\n except (IOError, OSError):\n data = download_data(URL)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99988:Assign_L91_C12", "label": "data = read()", "type": "assigned_variable", "loc": [91, 91], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99988:Try_L89_C4", "vector": [14, 2, 0.7165, 0.0079, 2, 0.5, 0.0, 929, 3, 0, 0, 0, 453, 10, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "read", "annotation": ""}, "snippet": " data = f.read()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99988:Assign_L93_C8", "label": "data = download_data()", "type": "assigned_variable", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99988:Try_L89_C4", "vector": [14, 2, 0.7323, 0.0079, 2, 0.5, 0.0, 929, 3, 1, 0, 0, 883, 10, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "download_data", "annotation": ""}, "snippet": " data = download_data(URL)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99988:Return_L94_C4", "label": "return", "type": "return", "loc": [94, 94], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99988:FunctionDef_L88_C0", "vector": [13, 1, 0.7402, 0.0079, 1, 0.95, 1.0, 0, 3, 0, 0, 0, 0, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return parse_website_data(data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99988:FunctionDef_L96_C0", "label": "parse_website_data", "type": "function", "loc": [96, 99], "level": 0, "parent": null, "vector": [2, 0, 0.7677, 0.0315, 0, 0.66, 0.8571, 401, 0, 1, 1, 0, 0, 0, 4], "semantic": {"name": "parse_website_data", "arg_names": ["data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def parse_website_data(data):\n match = re.search(r'\\<pre\\>(.*?)\\<\\/pre\\>', data, re.DOTALL | re.MULTILINE)\n data = match.group(1)\n return data.lower().replace('\\r', '')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99988:Assign_L97_C4", "label": "match = search()", "type": "assigned_variable", "loc": [97, 97], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99988:FunctionDef_L96_C0", "vector": [14, 1, 0.7638, 0.0079, 1, 0.09, 0.0, 36, 3, 3, 0, 0, 163, 10, 1], "semantic": {"name": "match", "arg_names": [], "import_names": [], "rhs_call_name": "search", "annotation": ""}, "snippet": " match = re.search(r'\\<pre\\>(.*?)\\<\\/pre\\>', data, re.DOTALL | re.MULTILINE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99988:Assign_L98_C4", "label": "data = group()", "type": "assigned_variable", "loc": [98, 98], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99988:FunctionDef_L96_C0", "vector": [14, 1, 0.7717, 0.0079, 1, 0.09, 0.5, 929, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": " data = match.group(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99988:Return_L99_C4", "label": "return", "type": "return", "loc": [99, 99], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99988:FunctionDef_L96_C0", "vector": [13, 1, 0.7795, 0.0079, 1, 0.09, 1.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return data.lower().replace('\\r', '')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99988:FunctionDef_L101_C0", "label": "parse_sections", "type": "function", "loc": [101, 113], "level": 0, "parent": null, "vector": [2, 0, 0.8425, 0.1024, 0, 0.66, 0.9286, 602, 0, 1, 1, 0, 0, 0, 6], "semantic": {"name": "parse_sections", "arg_names": ["raw"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def parse_sections(raw):\n sections = re.split(r'\\*+\\r?\\n', data, flags=re.DOTALL | re.MULTILINE)\n selection = {}\n indexes = '|'.join(['(?:%s)' % s for s in SECTIONS])\n\n for section in sections:\n match = re.match(r'[vix]*\\. +(%s)\\s*(.*)' % indexes, section, flags=re.DOTALL | re.MULTILINE)\n if match:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99988:Assign_L102_C4", "label": "sections = split()", "type": "assigned_variable", "loc": [102, 102], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99988:FunctionDef_L101_C0", "vector": [14, 1, 0.8031, 0.0079, 1, 0.82, 0.0, 190, 3, 3, 0, 0, 908, 10, 1], "semantic": {"name": "sections", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": " sections = re.split(r'\\*+\\r?\\n', data, flags=re.DOTALL | re.MULTILINE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99988:Assign_L103_C4", "label": "selection =", "type": "assigned_variable", "loc": [103, 103], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99988:FunctionDef_L101_C0", "vector": [14, 1, 0.811, 0.0079, 1, 0.82, 0.25, 441, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "selection", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " selection = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99988:Assign_L104_C4", "label": "indexes = join()", "type": "assigned_variable", "loc": [104, 104], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99988:FunctionDef_L101_C0", "vector": [14, 1, 0.8189, 0.0079, 1, 0.82, 0.5, 600, 3, 1, 0, 0, 933, 10, 1], "semantic": {"name": "indexes", "arg_names": [], "import_names": [], "rhs_call_name": "join", "annotation": ""}, "snippet": " indexes = '|'.join(['(?:%s)' % s for s in SECTIONS])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99988:For_L106_C4", "label": "for section", "type": "for", "loc": [106, 111], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99988:FunctionDef_L101_C0", "vector": [6, 1, 0.8543, 0.0472, 1, 0.82, 0.75, 806, 2, 0, 0, 0, 0, 0, 4], "semantic": {"name": "section", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for section in sections:\n match = re.match(r'[vix]*\\. +(%s)\\s*(.*)' % indexes, section, flags=re.DOTALL | re.MULTILINE)\n if match:\n section, content = match.group(1), match.group(2)\n parser = SECTIONS[section]\n selection[section] = parser(content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99988:Assign_L107_C8", "label": "match = match()", "type": "assigned_variable", "loc": [107, 107], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99988:For_L106_C4", "vector": [14, 2, 0.8425, 0.0079, 2, 0.98, 0.0, 36, 3, 3, 0, 0, 36, 10, 1], "semantic": {"name": "match", "arg_names": [], "import_names": [], "rhs_call_name": "match", "annotation": ""}, "snippet": " match = re.match(r'[vix]*\\. +(%s)\\s*(.*)' % indexes, section, flags=re.DOTALL | re.MULTILINE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99988:If_L108_C8", "label": "if", "type": "if", "loc": [108, 111], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99988:For_L106_C4", "vector": [4, 2, 0.8622, 0.0315, 2, 0.98, 1.0, 0, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if match:\n section, content = match.group(1), match.group(2)\n parser = SECTIONS[section]\n selection[section] = parser(content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99988:Assign_L109_C12", "label": "section, content =", "type": "assigned_variable", "loc": [109, 109], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99988:If_L108_C8", "vector": [14, 3, 0.8583, 0.0079, 3, 0.51, 0.0, 681, 0, 0, 0, 0, 0, 8, 2], "semantic": {"name": "section, content", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " section, content = match.group(1), match.group(2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99988:Assign_L110_C12", "label": "parser =", "type": "assigned_variable", "loc": [110, 110], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99988:If_L108_C8", "vector": [14, 3, 0.8661, 0.0079, 3, 0.51, 0.5, 968, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "parser", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " parser = SECTIONS[section]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99988:Assign_L111_C12", "label": " = parser()", "type": "assigned_variable", "loc": [111, 111], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99988:If_L108_C8", "vector": [14, 3, 0.874, 0.0079, 3, 0.51, 1.0, 0, 3, 1, 0, 0, 968, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "parser", "annotation": ""}, "snippet": " selection[section] = parser(content)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99988:Return_L113_C4", "label": "return", "type": "return", "loc": [113, 113], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99988:FunctionDef_L101_C0", "vector": [13, 1, 0.8898, 0.0079, 1, 0.82, 1.0, 0, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return selection"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99988:If_L115_C0", "label": "if", "type": "if", "loc": [115, 127], "level": 0, "parent": null, "vector": [4, 0, 0.9528, 0.1024, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 9], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == '__main__':\n data = get_website_data()\n\n print('parseando...')\n sections = parse_sections(data)\n print('OK')\n\n for k, v in sections.items():"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99988:Assign_L116_C4", "label": "data = get_website_data()", "type": "assigned_variable", "loc": [116, 116], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99988:If_L115_C0", "vector": [14, 1, 0.9134, 0.0079, 1, 0.79, 0.0, 929, 3, 0, 0, 0, 926, 10, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "get_website_data", "annotation": ""}, "snippet": " data = get_website_data()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99988:Expr_L118_C4", "label": "print()", "type": "expression", "loc": [118, 118], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99988:If_L115_C0", "vector": [8, 1, 0.9291, 0.0079, 1, 0.79, 0.25, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('parseando...')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99988:Assign_L119_C4", "label": "sections = parse_sections()", "type": "assigned_variable", "loc": [119, 119], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99988:If_L115_C0", "vector": [14, 1, 0.937, 0.0079, 1, 0.79, 0.5, 190, 3, 1, 0, 0, 602, 10, 1], "semantic": {"name": "sections", "arg_names": [], "import_names": [], "rhs_call_name": "parse_sections", "annotation": ""}, "snippet": " sections = parse_sections(data)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99988:Expr_L120_C4", "label": "print()", "type": "expression", "loc": [120, 120], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99988:If_L115_C0", "vector": [8, 1, 0.9449, 0.0079, 1, 0.79, 0.75, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('OK')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99988:For_L122_C4", "label": "for k, v", "type": "for", "loc": [122, 127], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99988:If_L115_C0", "vector": [6, 1, 0.9803, 0.0472, 1, 0.79, 1.0, 867, 3, 0, 0, 0, 0, 0, 5], "semantic": {"name": "k, v", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for k, v in sections.items():\n filename = '%s.json' % k\n print('creando archivo %s' % filename)\n with open(filename, 'w') as fp:\n json.dump(v, fp, indent=4)\n print('OK')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99988:Assign_L123_C8", "label": "filename =", "type": "assigned_variable", "loc": [123, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99988:For_L122_C4", "vector": [14, 2, 0.9685, 0.0079, 2, 0.03, 0.0, 275, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "filename", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " filename = '%s.json' % k"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99988:Expr_L124_C8", "label": "print()", "type": "expression", "loc": [124, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99988:For_L122_C4", "vector": [8, 2, 0.9764, 0.0079, 2, 0.03, 0.5, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('creando archivo %s' % filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99988:Expr_L126_C12", "label": "dump()", "type": "expression", "loc": [126, 126], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99988:For_L122_C4", "vector": [8, 2, 0.9921, 0.0079, 2, 0.03, 0.0, 952, 3, 3, 0, 0, 0, 0, 1], "semantic": {"name": "dump", "arg_names": [], "import_names": [], "rhs_call_name": "dump", "annotation": ""}, "snippet": " json.dump(v, fp, indent=4)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99988:Expr_L127_C8", "label": "print()", "type": "expression", "loc": [127, 127], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99988:For_L122_C4", "vector": [8, 2, 1.0, 0.0079, 2, 0.03, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print('OK')"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99988:FunctionDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99988:Assign_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99988:FunctionDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99988:Assign_L21_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99988:FunctionDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99988:Assign_L23_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99988:FunctionDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99988:Assign_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99988:FunctionDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99988:For_L33_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99988:For_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99988:Assign_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99988:For_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99988:Assign_L36_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99988:For_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99988:For_L37_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99988:For_L37_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99988:If_L38_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99988:For_L37_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99988:Assign_L40_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99988:For_L37_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99988:Assign_L41_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99988:For_L33_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99988:Expr_L43_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99988:FunctionDef_L19_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99988:Return_L45_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99988:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99988:Assign_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99988:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99988:Assign_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99988:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99988:For_L52_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99988:For_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99988:If_L53_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99988:For_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99988:Assign_L55_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99988:For_L52_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99988:Assign_L64_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99988:FunctionDef_L48_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99988:Return_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99988:FunctionDef_L76_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99988:Expr_L77_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99988:FunctionDef_L76_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99988:Assign_L78_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99988:FunctionDef_L76_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99988:Assign_L79_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99988:FunctionDef_L76_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99988:Assign_L80_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99988:FunctionDef_L76_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99988:Expr_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99988:FunctionDef_L76_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99988:Expr_L84_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99988:FunctionDef_L76_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99988:Return_L86_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99988:FunctionDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99988:Try_L89_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99988:Try_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99988:Assign_L91_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99988:Try_L89_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99988:Assign_L93_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99988:FunctionDef_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99988:Return_L94_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99988:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99988:Assign_L97_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99988:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99988:Assign_L98_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99988:FunctionDef_L96_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99988:Return_L99_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99988:FunctionDef_L101_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99988:Assign_L102_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99988:FunctionDef_L101_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99988:Assign_L103_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99988:FunctionDef_L101_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99988:Assign_L104_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99988:FunctionDef_L101_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99988:For_L106_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99988:For_L106_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99988:Assign_L107_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99988:For_L106_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99988:If_L108_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99988:If_L108_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99988:Assign_L109_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99988:If_L108_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99988:Assign_L110_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99988:If_L108_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99988:Assign_L111_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99988:FunctionDef_L101_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99988:Return_L113_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99988:If_L115_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99988:Assign_L116_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99988:If_L115_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99988:Expr_L118_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99988:If_L115_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99988:Assign_L119_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99988:If_L115_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99988:Expr_L120_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99988:If_L115_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99988:For_L122_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99988:For_L122_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99988:Assign_L123_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99988:For_L122_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99988:Expr_L124_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99988:For_L122_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99988:Expr_L126_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99988:For_L122_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99988:Expr_L127_C8"}] |
#!/usr/bin/python
# Copyright 2011 Google, Inc. All Rights Reserved.
# simple script to walk source tree looking for third-party licenses
# dumps resulting html page to stdout
import os, re, mimetypes, sys
# read source directories to scan from command line
SOURCE = sys.argv[1:]
# regex to find /* */ style comment blocks
COMMENT_BLOCK = re.compile(r"(/\*.+?\*/)", re.MULTILINE | re.DOTALL)
# regex used to detect if comment block is a license
COMMENT_LICENSE = re.compile(r"(license)", re.IGNORECASE)
COMMENT_COPYRIGHT = re.compile(r"(copyright)", re.IGNORECASE)
EXCLUDE_TYPES = [
"application/xml",
"image/png",
]
# list of known licenses; keys are derived by stripping all whitespace and
# forcing to lowercase to help combine multiple files that have same license.
KNOWN_LICENSES = {}
class License:
def __init__(self, license_text):
self.license_text = license_text
self.filenames = []
# add filename to the list of files that have the same license text
def add_file(self, filename):
if filename not in self.filenames:
self.filenames.append(filename)
LICENSE_KEY = re.compile(r"[^\w]")
def find_license(license_text):
# TODO(alice): a lot these licenses are almost identical Apache licenses.
# Most of them differ in origin/modifications. Consider combining similar
# licenses.
license_key = LICENSE_KEY.sub("", license_text).lower()
if license_key not in KNOWN_LICENSES:
KNOWN_LICENSES[license_key] = License(license_text)
return KNOWN_LICENSES[license_key]
def discover_license(exact_path, filename):
# when filename ends with LICENSE, assume applies to filename prefixed
if filename.endswith("LICENSE"):
with open(exact_path) as file:
license_text = file.read()
target_filename = filename[:-len("LICENSE")]
if target_filename.endswith("."): target_filename = target_filename[:-1]
find_license(license_text).add_file(target_filename)
return None
# try searching for license blocks in raw file
mimetype = mimetypes.guess_type(filename)
if mimetype in EXCLUDE_TYPES: return None
with open(exact_path) as file:
raw_file = file.read()
# include comments that have both "license" and "copyright" in the text
for comment in COMMENT_BLOCK.finditer(raw_file):
comment = comment.group(1)
if COMMENT_LICENSE.search(comment) is None: continue
if COMMENT_COPYRIGHT.search(comment) is None: continue
find_license(comment).add_file(filename)
for source in SOURCE:
for root, dirs, files in os.walk(source):
for name in files:
discover_license(os.path.join(root, name), name)
print "<html><head><style> body { font-family: sans-serif; } pre { background-color: #eeeeee; padding: 1em; white-space: pre-wrap; } </style></head><body>"
for license in KNOWN_LICENSES.values():
print "<h3>Notices for files:</h3><ul>"
filenames = license.filenames
filenames.sort()
for filename in filenames:
print "<li>%s</li>" % (filename)
print "</ul>"
print "<pre>%s</pre>" % license.license_text
print "</body></html>"
| ajibawa-2023/Python-Code-Large/train/row_99989 | 51 | 98 | 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_99989:Import_L8_C0", "label": "os import os, re, mimetypes\u2026", "type": "import", "loc": [8, 8], "level": 0, "parent": null, "vector": [1, 0, 0.0816, 0.0102, 0, 0.66, 0.0, 688, 0, 4, 0, 0, 688, 0, 0], "semantic": {"name": "os", "arg_names": [], "import_names": ["os", "re", "mimetypes", "sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import os, re, mimetypes, sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99989:Assign_L12_C0", "label": "SOURCE =", "type": "assigned_variable", "loc": [12, 12], "level": 0, "parent": null, "vector": [14, 0, 0.1224, 0.0102, 0, 0.66, 0.0714, 792, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "SOURCE", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "SOURCE = sys.argv[1:]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99989:Assign_L15_C0", "label": "COMMENT_BLOCK = compile()", "type": "assigned_variable", "loc": [15, 15], "level": 0, "parent": null, "vector": [14, 0, 0.1531, 0.0102, 0, 0.66, 0.1429, 629, 3, 2, 0, 0, 821, 10, 1], "semantic": {"name": "COMMENT_BLOCK", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": "COMMENT_BLOCK = re.compile(r\"(/\\*.+?\\*/)\", re.MULTILINE | re.DOTALL)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99989:Assign_L17_C0", "label": "COMMENT_LICENSE = compile()", "type": "assigned_variable", "loc": [17, 17], "level": 0, "parent": null, "vector": [14, 0, 0.1735, 0.0102, 0, 0.66, 0.2143, 929, 3, 2, 0, 0, 821, 10, 1], "semantic": {"name": "COMMENT_LICENSE", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": "COMMENT_LICENSE = re.compile(r\"(license)\", re.IGNORECASE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99989:Assign_L18_C0", "label": "COMMENT_COPYRIGHT = compile()", "type": "assigned_variable", "loc": [18, 18], "level": 0, "parent": null, "vector": [14, 0, 0.1837, 0.0102, 0, 0.66, 0.2857, 407, 3, 2, 0, 0, 821, 10, 1], "semantic": {"name": "COMMENT_COPYRIGHT", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": "COMMENT_COPYRIGHT = re.compile(r\"(copyright)\", re.IGNORECASE)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99989:Assign_L20_C0", "label": "EXCLUDE_TYPES =", "type": "assigned_variable", "loc": [20, 23], "level": 0, "parent": null, "vector": [14, 0, 0.2194, 0.0408, 0, 0.66, 0.3571, 265, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "EXCLUDE_TYPES", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "EXCLUDE_TYPES = [\n \"application/xml\",\n \"image/png\",\n]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99989:Assign_L28_C0", "label": "KNOWN_LICENSES =", "type": "assigned_variable", "loc": [28, 28], "level": 0, "parent": null, "vector": [14, 0, 0.2857, 0.0102, 0, 0.66, 0.4286, 144, 0, 0, 0, 0, 0, 6, 0], "semantic": {"name": "KNOWN_LICENSES", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "KNOWN_LICENSES = {}"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99989:ClassDef_L31_C0", "label": "License", "type": "class", "loc": [31, 39], "level": 0, "parent": null, "vector": [3, 0, 0.3571, 0.0918, 0, 0.66, 0.5, 338, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "License", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class License:\n def __init__(self, license_text):\n self.license_text = license_text\n self.filenames = []\n\n # add filename to the list of files that have the same license text\n def add_file(self, filename):\n if filename not in self.filenames:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99989:FunctionDef_L32_C4", "label": "__init__", "type": "function", "loc": [32, 34], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99989:ClassDef_L31_C0", "vector": [2, 1, 0.3367, 0.0306, 1, 0.96, 0.0, 555, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "license_text"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self, license_text):\n self.license_text = license_text\n self.filenames = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99989:Assign_L33_C8", "label": "self.license_text =", "type": "assigned_variable", "loc": [33, 33], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99989:FunctionDef_L32_C4", "vector": [14, 2, 0.3367, 0.0102, 2, 0.98, 0.0, 103, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.license_text", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.license_text = license_text"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99989:Assign_L34_C8", "label": "self.filenames =", "type": "assigned_variable", "loc": [34, 34], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99989:FunctionDef_L32_C4", "vector": [14, 2, 0.3469, 0.0102, 2, 0.98, 1.0, 866, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.filenames", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " self.filenames = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99989:FunctionDef_L37_C4", "label": "add_file", "type": "function", "loc": [37, 39], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99989:ClassDef_L31_C0", "vector": [2, 1, 0.3878, 0.0306, 1, 0.96, 1.0, 369, 0, 2, 0, 0, 0, 0, 1], "semantic": {"name": "add_file", "arg_names": ["self", "filename"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def add_file(self, filename):\n if filename not in self.filenames:\n self.filenames.append(filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99989:If_L38_C8", "label": "if", "type": "if", "loc": [38, 39], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99989:FunctionDef_L37_C4", "vector": [4, 2, 0.3929, 0.0204, 2, 0.55, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if filename not in self.filenames:\n self.filenames.append(filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99989:Expr_L39_C12", "label": "append()", "type": "expression", "loc": [39, 39], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99989:If_L38_C8", "vector": [8, 3, 0.398, 0.0102, 3, 0.09, 0.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": " self.filenames.append(filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99989:Assign_L42_C0", "label": "LICENSE_KEY = compile()", "type": "assigned_variable", "loc": [42, 42], "level": 0, "parent": null, "vector": [14, 0, 0.4286, 0.0102, 0, 0.66, 0.5714, 222, 3, 1, 0, 0, 821, 10, 1], "semantic": {"name": "LICENSE_KEY", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": "LICENSE_KEY = re.compile(r\"[^\\w]\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99989:FunctionDef_L44_C0", "label": "find_license", "type": "function", "loc": [44, 51], "level": 0, "parent": null, "vector": [2, 0, 0.4847, 0.0816, 0, 0.66, 0.6429, 149, 0, 1, 1, 0, 0, 0, 3], "semantic": {"name": "find_license", "arg_names": ["license_text"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def find_license(license_text):\n # TODO(alice): a lot these licenses are almost identical Apache licenses.\n # Most of them differ in origin/modifications. Consider combining similar\n # licenses.\n license_key = LICENSE_KEY.sub(\"\", license_text).lower()\n if license_key not in KNOWN_LICENSES:\n KNOWN_LICENSES[license_key] = License(license_text)\n return KNOWN_LICENSES[license_key]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99989:Assign_L48_C4", "label": "license_key = lower()", "type": "assigned_variable", "loc": [48, 48], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99989:FunctionDef_L44_C0", "vector": [14, 1, 0.4898, 0.0102, 1, 0.96, 0.0, 374, 3, 0, 0, 0, 432, 10, 2], "semantic": {"name": "license_key", "arg_names": [], "import_names": [], "rhs_call_name": "lower", "annotation": ""}, "snippet": " license_key = LICENSE_KEY.sub(\"\", license_text).lower()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99989:If_L49_C4", "label": "if", "type": "if", "loc": [49, 50], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99989:FunctionDef_L44_C0", "vector": [4, 1, 0.5051, 0.0204, 1, 0.96, 0.5, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if license_key not in KNOWN_LICENSES:\n KNOWN_LICENSES[license_key] = License(license_text)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99989:Assign_L50_C8", "label": " = License()", "type": "assigned_variable", "loc": [50, 50], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99989:If_L49_C4", "vector": [14, 2, 0.5102, 0.0102, 2, 0.61, 0.0, 0, 3, 1, 0, 0, 338, 10, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "License", "annotation": ""}, "snippet": " KNOWN_LICENSES[license_key] = License(license_text)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99989:Return_L51_C4", "label": "return", "type": "return", "loc": [51, 51], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99989:FunctionDef_L44_C0", "vector": [13, 1, 0.5204, 0.0102, 1, 0.96, 1.0, 0, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " return KNOWN_LICENSES[license_key]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99989:FunctionDef_L55_C0", "label": "discover_license", "type": "function", "loc": [55, 77], "level": 0, "parent": null, "vector": [2, 0, 0.6735, 0.2347, 0, 0.66, 0.7143, 17, 0, 2, 1, 0, 0, 0, 16], "semantic": {"name": "discover_license", "arg_names": ["exact_path", "filename"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def discover_license(exact_path, filename):\n # when filename ends with LICENSE, assume applies to filename prefixed\n if filename.endswith(\"LICENSE\"):\n with open(exact_path) as file:\n license_text = file.read()\n target_filename = filename[:-len(\"LICENSE\")]\n if target_filename.endswith(\".\"): target_filename = target_filename[:-1]\n find_license(license_text).add_file(target_filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99989:If_L57_C4", "label": "if", "type": "if", "loc": [57, 63], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99989:FunctionDef_L55_C0", "vector": [4, 1, 0.6122, 0.0714, 1, 0.18, 0.0, 0, 3, 0, 0, 0, 0, 0, 7], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if filename.endswith(\"LICENSE\"):\n with open(exact_path) as file:\n license_text = file.read()\n target_filename = filename[:-len(\"LICENSE\")]\n if target_filename.endswith(\".\"): target_filename = target_filename[:-1]\n find_license(license_text).add_file(target_filename)\n return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99989:Assign_L59_C12", "label": "license_text = read()", "type": "assigned_variable", "loc": [59, 59], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99989:If_L57_C4", "vector": [14, 2, 0.602, 0.0102, 2, 0.71, 0.0, 550, 3, 0, 0, 0, 453, 10, 1], "semantic": {"name": "license_text", "arg_names": [], "import_names": [], "rhs_call_name": "read", "annotation": ""}, "snippet": " license_text = file.read()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99989:Assign_L60_C8", "label": "target_filename =", "type": "assigned_variable", "loc": [60, 60], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99989:If_L57_C4", "vector": [14, 2, 0.6122, 0.0102, 2, 0.71, 0.0, 439, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "target_filename", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " target_filename = filename[:-len(\"LICENSE\")]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99989:If_L61_C8", "label": "if", "type": "if", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99989:If_L57_C4", "vector": [4, 2, 0.6224, 0.0102, 2, 0.71, 0.3333, 0, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if target_filename.endswith(\".\"): target_filename = target_filename[:-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99989:Assign_L61_C42", "label": "target_filename =", "type": "assigned_variable", "loc": [61, 61], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99989:If_L61_C8", "vector": [14, 3, 0.6224, 0.0102, 3, 0.65, 0.0, 439, 6, 0, 0, 0, 0, 0, 0], "semantic": {"name": "target_filename", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if target_filename.endswith(\".\"): target_filename = target_filename[:-1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99989:Expr_L62_C8", "label": "add_file()", "type": "expression", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99989:If_L57_C4", "vector": [8, 2, 0.6327, 0.0102, 2, 0.71, 0.6667, 369, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "add_file", "arg_names": [], "import_names": [], "rhs_call_name": "add_file", "annotation": ""}, "snippet": " find_license(license_text).add_file(target_filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99989:Return_L63_C8", "label": "return", "type": "return", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99989:If_L57_C4", "vector": [13, 2, 0.6429, 0.0102, 2, 0.71, 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_99989:Assign_L66_C4", "label": "mimetype = guess_type()", "type": "assigned_variable", "loc": [66, 66], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99989:FunctionDef_L55_C0", "vector": [14, 1, 0.6735, 0.0102, 1, 0.18, 0.3333, 290, 3, 1, 0, 0, 213, 10, 1], "semantic": {"name": "mimetype", "arg_names": [], "import_names": [], "rhs_call_name": "guess_type", "annotation": ""}, "snippet": " mimetype = mimetypes.guess_type(filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99989:If_L67_C4", "label": "if", "type": "if", "loc": [67, 67], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99989:FunctionDef_L55_C0", "vector": [4, 1, 0.6837, 0.0102, 1, 0.18, 0.6667, 0, 0, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if mimetype in EXCLUDE_TYPES: return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99989:Return_L67_C34", "label": "return", "type": "return", "loc": [67, 67], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99989:If_L67_C4", "vector": [13, 2, 0.6837, 0.0102, 2, 0.9, 0.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if mimetype in EXCLUDE_TYPES: return None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99989:Assign_L70_C8", "label": "raw_file = read()", "type": "assigned_variable", "loc": [70, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99989:FunctionDef_L55_C0", "vector": [14, 1, 0.7143, 0.0102, 1, 0.18, 0.0, 1, 3, 0, 0, 0, 453, 10, 1], "semantic": {"name": "raw_file", "arg_names": [], "import_names": [], "rhs_call_name": "read", "annotation": ""}, "snippet": " raw_file = file.read()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99989:For_L73_C4", "label": "for comment", "type": "for", "loc": [73, 77], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99989:FunctionDef_L55_C0", "vector": [6, 1, 0.7653, 0.051, 1, 0.18, 1.0, 34, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "comment", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for comment in COMMENT_BLOCK.finditer(raw_file):\n comment = comment.group(1)\n if COMMENT_LICENSE.search(comment) is None: continue\n if COMMENT_COPYRIGHT.search(comment) is None: continue\n find_license(comment).add_file(filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99989:Assign_L74_C8", "label": "comment = group()", "type": "assigned_variable", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99989:For_L73_C4", "vector": [14, 2, 0.7551, 0.0102, 2, 0.08, 0.0, 34, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "comment", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": " comment = comment.group(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99989:If_L75_C8", "label": "if", "type": "if", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99989:For_L73_C4", "vector": [4, 2, 0.7653, 0.0102, 2, 0.08, 0.3333, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if COMMENT_LICENSE.search(comment) is None: continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99989:If_L76_C8", "label": "if", "type": "if", "loc": [76, 76], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99989:For_L73_C4", "vector": [4, 2, 0.7755, 0.0102, 2, 0.08, 0.6667, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if COMMENT_COPYRIGHT.search(comment) is None: continue"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99989:Expr_L77_C8", "label": "add_file()", "type": "expression", "loc": [77, 77], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99989:For_L73_C4", "vector": [8, 2, 0.7857, 0.0102, 2, 0.08, 1.0, 369, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "add_file", "arg_names": [], "import_names": [], "rhs_call_name": "add_file", "annotation": ""}, "snippet": " find_license(comment).add_file(filename)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99989:For_L80_C0", "label": "for source", "type": "for", "loc": [80, 83], "level": 0, "parent": null, "vector": [6, 0, 0.8316, 0.0408, 0, 0.66, 0.7857, 703, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "source", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "for source in SOURCE:\n for root, dirs, files in os.walk(source):\n for name in files:\n discover_license(os.path.join(root, name), name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99989:For_L81_C4", "label": "for root, dirs, files", "type": "for", "loc": [81, 83], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99989:For_L80_C0", "vector": [6, 1, 0.8367, 0.0306, 1, 0.23, 0.0, 129, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "root, dirs, files", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for root, dirs, files in os.walk(source):\n for name in files:\n discover_license(os.path.join(root, name), name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99989:For_L82_C8", "label": "for name", "type": "for", "loc": [82, 83], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99989:For_L81_C4", "vector": [6, 2, 0.8418, 0.0204, 2, 0.44, 0.0, 57, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for name in files:\n discover_license(os.path.join(root, name), name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99989:Expr_L83_C12", "label": "discover_license()", "type": "expression", "loc": [83, 83], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99989:For_L82_C8", "vector": [8, 3, 0.8469, 0.0102, 3, 0.28, 0.0, 17, 3, 2, 0, 0, 0, 0, 2], "semantic": {"name": "discover_license", "arg_names": [], "import_names": [], "rhs_call_name": "discover_license", "annotation": ""}, "snippet": " discover_license(os.path.join(root, name), name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99989:Expr_L86_C0", "label": "print()", "type": "expression", "loc": [86, 86], "level": 0, "parent": null, "vector": [8, 0, 0.8776, 0.0102, 0, 0.66, 0.8571, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "print(\"<html><head><style> body { font-family: sans-serif; } pre { background-color: #eeeeee; padding: 1em; white-space: pre-wrap; } </style></head><body>\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99989:For_L88_C0", "label": "for license", "type": "for", "loc": [88, 96], "level": 0, "parent": null, "vector": [6, 0, 0.9388, 0.0918, 0, 0.66, 0.9286, 365, 3, 0, 0, 0, 0, 0, 6], "semantic": {"name": "license", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "for license in KNOWN_LICENSES.values():\n\n print(\"<h3>Notices for files:</h3><ul>\")\n filenames = license.filenames\n filenames.sort()\n for filename in filenames:\n print(\"<li>%s</li>\" % (filename))\n print(\"</ul>\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99989:Expr_L90_C4", "label": "print()", "type": "expression", "loc": [90, 90], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99989:For_L88_C0", "vector": [8, 1, 0.9184, 0.0102, 1, 0.85, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"<h3>Notices for files:</h3><ul>\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99989:Assign_L91_C4", "label": "filenames =", "type": "assigned_variable", "loc": [91, 91], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99989:For_L88_C0", "vector": [14, 1, 0.9286, 0.0102, 1, 0.85, 0.2, 94, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "filenames", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " filenames = license.filenames"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99989:Expr_L92_C4", "label": "sort()", "type": "expression", "loc": [92, 92], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99989:For_L88_C0", "vector": [8, 1, 0.9388, 0.0102, 1, 0.85, 0.4, 489, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "sort", "arg_names": [], "import_names": [], "rhs_call_name": "sort", "annotation": ""}, "snippet": " filenames.sort()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99989:For_L93_C4", "label": "for filename", "type": "for", "loc": [93, 94], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99989:For_L88_C0", "vector": [6, 1, 0.9541, 0.0204, 1, 0.85, 0.6, 275, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "filename", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " for filename in filenames:\n print(\"<li>%s</li>\" % (filename))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99989:Expr_L94_C8", "label": "print()", "type": "expression", "loc": [94, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99989:For_L93_C4", "vector": [8, 2, 0.9592, 0.0102, 2, 0.89, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"<li>%s</li>\" % (filename))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99989:Expr_L95_C4", "label": "print()", "type": "expression", "loc": [95, 95], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99989:For_L88_C0", "vector": [8, 1, 0.9694, 0.0102, 1, 0.85, 0.8, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"</ul>\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99989:Expr_L96_C4", "label": "print()", "type": "expression", "loc": [96, 96], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99989:For_L88_C0", "vector": [8, 1, 0.9796, 0.0102, 1, 0.85, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": " print(\"<pre>%s</pre>\" % license.license_text)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99989:Expr_L98_C0", "label": "print()", "type": "expression", "loc": [98, 98], "level": 0, "parent": null, "vector": [8, 0, 1.0, 0.0102, 0, 0.66, 1.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "print(\"</body></html>\")"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99989:ClassDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99989:FunctionDef_L32_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99989:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99989:Assign_L33_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99989:FunctionDef_L32_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99989:Assign_L34_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99989:ClassDef_L31_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99989:FunctionDef_L37_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99989:FunctionDef_L37_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99989:If_L38_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99989:If_L38_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99989:Expr_L39_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99989:FunctionDef_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99989:Assign_L48_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99989:FunctionDef_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99989:If_L49_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99989:If_L49_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99989:Assign_L50_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99989:FunctionDef_L44_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99989:Return_L51_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99989:FunctionDef_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99989:If_L57_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99989:If_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99989:Assign_L59_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99989:If_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99989:Assign_L60_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99989:If_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99989:If_L61_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99989:If_L61_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99989:Assign_L61_C42"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99989:If_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99989:Expr_L62_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99989:If_L57_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99989:Return_L63_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99989:FunctionDef_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99989:Assign_L66_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99989:FunctionDef_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99989:If_L67_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99989:If_L67_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99989:Return_L67_C34"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99989:FunctionDef_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99989:Assign_L70_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99989:FunctionDef_L55_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99989:For_L73_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99989:For_L73_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99989:Assign_L74_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99989:For_L73_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99989:If_L75_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99989:For_L73_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99989:If_L76_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99989:For_L73_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99989:Expr_L77_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99989:For_L80_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99989:For_L81_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99989:For_L81_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99989:For_L82_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99989:For_L82_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99989:Expr_L83_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99989:For_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99989:Expr_L90_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99989:For_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99989:Assign_L91_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99989:For_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99989:Expr_L92_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99989:For_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99989:For_L93_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99989:For_L93_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99989:Expr_L94_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99989:For_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99989:Expr_L95_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99989:For_L88_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99989:Expr_L96_C4"}] |
#!/usr/bin/env python
# encoding: utf-8
"""
Created by Jaime Blasco on 2009-09-15
Uploaed to Labs on 2011-09-26 <--- First contribution :P
License:
Copyright (c) 2009 AlienVault
All rights reserved.
This package is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 dated June, 1991.
You may not use, modify or distribute this program under any other version
of the GNU General Public License.
This package 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this package; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
MA 02110-1301 USA
On Debian GNU/Linux systems, the complete text of the GNU General
Public License can be found in `/usr/share/common-licenses/GPL-2'.
Otherwise you can read it here: http://www.gnu.org/licenses/gpl-2.0.txt
"""
import sys
import getopt
import fileinput
import commands
import re
from xmlobject import XMLFile
import libxml2
import libxslt
#Disks
#Memory
#CPU
#PCI devices
#tarjetas de red
#pfring
#Packages and versions
#Kernle parameters
class disk():
def __init__(self, id, size):
self.id = id
self.size = size
self.rVel = self.timeRead()
def timeRead(self):
print "Timing %s ..." % self.id
data = commands.getstatusoutput('hdparm -t /dev/%s' % self.id)[1]
data = data.split('\n')
# Timing buffered disk reads: 376 MB in 3.00 seconds = 125.18 MB/sec
p = re.compile(r".*= (?P<vel>[\d\.]+).*")
for d in data:
m = p.match(d)
if (m):
return float(m.group(1))
return None
class diskInfo():
def __init__(self):
self.disks = []
self.checkInfo()
def checkInfo(self):
data = commands.getstatusoutput('fdisk -l')[1]
data = data.split('\n')
#Disk /dev/sda: 73.4 GB, 73407488000 bytes
p = re.compile(r"Disk /dev/(?P<label>\S+):.*, (?P<cap>\d+)\sbytes.*")
for d in data:
m = p.match(d)
if (m):
label = m.group(1)
size = m.group(2)
di = disk(label, size)
self.disks.append(di)
class memInfo():
def __init__(self):
self.checkInfo()
self.memTotal = 0
self.memFree = 0
self.swapTotal = 0
self.swapFree = 0
def checkInfo(self):
data = commands.getstatusoutput('cat /proc/meminfo')[1]
data = data.split('\n')
p1 = re.compile(r"MemTotal:\s+(?P<mem>\d+)\skB.*")
p2 = re.compile(r"MemFree:\s+(?P<mem>\d+)\skB.*")
p3 = re.compile(r"SwapTotal:\s+(?P<mem>\d+)\skB.*")
p4 = re.compile(r"SwapFree:\s+(?P<mem>\d+)\skB.*")
for d in data:
m = p1.match(d)
if (m):
self.memTotal = m.group(1)
m = p2.match(d)
if (m):
self.memFree = m.group(1)
m = p3.match(d)
if (m):
self.swapTotal = m.group(1)
m = p4.match(d)
if (m):
self.swapFree = m.group(1)
class cpu():
def __init__(self, id, vendor_id, cpu_family, model_id, model_name):
self.id = id
self.vendor_id = vendor_id
self.cpu_family = cpu_family
self.model_id = model_id
self.model_name = model_name
def __repr__(self):
return "%s,%s,%s,%s,%s" % (self.id, self.vendor_id, self.cpu_family, self.model_id, self.model_name)
'''
def xml(self, dom):
cp = dom.createElement("cpu")
cp.id = self.id
cp.vendor_id = vendor_id
cp.cpu_family = cpu_family
cp.model_id = model_id
cp.model_name = model_name
return cp
'''
class cpuInfo():
def __init__(self):
self.cpus = []
self.checkInfo()
def checkInfo(self):
data = commands.getstatusoutput('cat /proc/cpuinfo')[1]
data = data.split('\n\n')
for d in data:
self.parseCpuData(d)
def parseCpuData(self, data):
data = data.split('\n')
p = re.compile(r"([\w\s+]+)\t: (?P<val>.*)")
m = p.match(data[0])
id = m.group(2)
p = re.compile(r"([\w\s+]+)\t: (?P<val>.*)")
m = p.match(data[1])
vendor_id = m.group(2)
p = re.compile(r"([\w\s+]+)\t: (?P<val>.*)")
m = p.match(data[2])
cpu_family = m.group(2)
p = re.compile(r"([\w\s+]+)\t: (?P<val>.*)")
m = p.match(data[3])
model_id = m.group(2)
p = re.compile(r"([\w\s+]+)\t: (?P<val>.*)")
m = p.match(data[4])
model_name = m.group(2)
cp = cpu(id, vendor_id, cpu_family, model_id, model_name)
#print cp
self.cpus.append(cp)
class pciDev():
def __init__(self, device, dClass, vendor, deviceName, sVendor, sDevice):
self.device = device
self.dClass = dClass
self.vendor = vendor
self.deviceName = deviceName
self.sVendor = sVendor
self.sDevice = sDevice
def __repr__(self):
return "%s,%s,%s,%s,%s,%s" % (self.device, self.dClass, self.vendor, self.deviceName, self.sVendor, self.sDevice)
class pciInfo():
def __init__(self):
self.devices = []
self.checkInfo()
def checkInfo(self):
"""Parse lspci info"""
data = commands.getstatusoutput('lspci -mm')[1]
data = data.split('\n')
#07:00.0 "Ethernet controller" "Intel Corporation" "80003ES2LAN Gigabit Ethernet Controller (Copper)" -r01 "ASUSTeK Computer Inc." "Device 8217"
#07:00.1 "Ethernet controller" "Intel Corporation" "80003ES2LAN Gigabit Ethernet Controller (Copper)" -r01 "ASUSTeK Computer Inc." "Device 8217"
for d in data:
d = d.split(' "')
device = d[0].replace('"', '')
dClass = d[1].replace('"', '')
vendor = d[2].replace('"', '')
deviceName = d[3].replace('"', '')
sVendor = d[4].replace('"', '')
sDevice = d[5].replace('"', '')
pDev = pciDev(device, dClass, vendor, deviceName, sVendor, sDevice)
self.devices.append(pDev)
class networkCard():
def __init__(self, interface, neg):
self.interface = interface
self.neg = neg
self.getRingParams()
def __repr__(self):
return "%s,%s,%s,%s,%s,%s" % (self.interface, self.neg, self.maxRX, self.maxTX, self.RX, self.TX)
def getRingParams(self):
data = commands.getstatusoutput('ethtool -g %s' % self.interface)[1]
data = data.split('\n')
p = re.compile(r"([\w\s+]+):([^\d]+)(?P<val>\d+)")
m = p.match(data[2])
self.maxRX = m.group(3)
m = p.match(data[5])
self.maxTX = m.group(3)
m = p.match(data[7])
self.RX = m.group(3)
m = p.match(data[10])
self.TX = m.group(3)
class networkInfo():
def __init__(self):
self.cards = []
self.checkInfo()
def checkInfo(self):
"""Parse Mii-tool and ethtool info"""
data = commands.getstatusoutput('mii-tool')[1]
data = data.split('\n')
#eth0: negotiated 100baseTx-FD, link ok
p = re.compile(r"(?P<in>[\d\w]+): negotiated (?P<vel>[\d\.]+).*")
for d in data:
m = p.match(d)
if (m):
interface = m.group(1)
neg = m.group(2)
card = networkCard(interface, neg)
self.cards.append(card)
class pkt():
def __init__(self, name, version, desc):
self.name = name
self.version = version
self.desc = desc
def __repr__(self):
return "%s,%s,%s" % (self.name, self.version, self.desc)
class packageInfo():
def __init__(self):
self.packages = []
self.checkInfo()
def checkInfo(self):
data = commands.getstatusoutput('dpkg -l')[1]
data = data.split('\n')
p = re.compile(r".. (?P<name>\S+)\s+(?P<ver>\S+)\s+(?P<desc>.*)")
for d in data:
m = p.match(d)
if m:
name = m.group(1)
version = m.group(2)
desc = m.group(3)
pk = pkt(name, version, desc)
self.packages.append(pk)
class pfringInfo():
def __init__(self):
self.checkInfo()
def checkInfo(self):
data = commands.getstatusoutput('cat /proc/net/pf_ring/info')[1]
data = data.split('\n')
if len(data) == 8:
p = re.compile(r"[^:]+: (?P<val>.*)")
m = p.match(data[0])
self.version = m.group(1)
m = p.match(data[1])
self.slots = m.group(1)
m = p.match(data[2])
self.sVersion = m.group(1)
m = p.match(data[3])
self.cTX = m.group(1)
m = p.match(data[4])
self.defrag = m.group(1)
m = p.match(data[5])
self.transparentMode = m.group(1)
m = p.match(data[6])
self.rings = m.group(1)
m = p.match(data[7])
self.plugins = m.group(1)
class kParam():
def __init__(self, name, val):
self.name = name
self.val = val
class kernelInfo():
def __init__(self):
self.parametes = []
self.version = ''
self.checkInfo()
def checkInfo(self):
data = commands.getstatusoutput('sysctl -a')[1]
data = data.split('\n')
p = re.compile(r"(?P<name>[^\s]+)\s=\s(?P<val>.*)")
for d in data:
m = p.match(d)
if m:
name = m.group(1)
val = m.group(2)
kP = kParam(name, val)
self.parametes.append(kP)
class systemInfo():
def __init__(self):
self.disk = diskInfo()
self.mem = memInfo()
self.cpu = cpuInfo()
self.pci = pciInfo()
self.network = networkInfo()
self.packages = packageInfo()
self.pfring = pfringInfo()
self.kernel = kernelInfo()
def xmlOut(self, fileName):
xmlStr = '<?xml version="1.0" encoding="UTF-8"?>' \
'<system></system>'
x = XMLFile(raw=xmlStr)
system = x.root
#CPU
xcp = system._addNode("cpuInfo")
for c in self.cpu.cpus:
xc = xcp._addNode("cpu")
for att in dir(c):
if att[0] != '_':
exec("xc.%s = c.%s" % (att, att))
xcp._addNode(xc)
#Memory
xme = system._addNode("memInfo")
for att in dir(self.mem):
if att[0] != '_' and att != "checkInfo":
exec("xme.%s = self.mem.%s" % (att, att))
#Disk
xdi = system._addNode("diskInfo")
for d in self.disk.disks:
xdis = xdi._addNode("disk")
for att in dir(d):
if att[0] != '_' and att != "timeRead":
exec("xdis.%s = d.%s" % (att, att))
xdi._addNode(xdis)
#PCI
xpci = system._addNode("pciInfo")
for m in self.pci.devices:
xp = xpci._addNode("pciModule")
for att in dir(m):
if att[0] != '_':
exec("xp.%s = m.%s" % (att, att))
xpci._addNode(xp)
#Packages
xpac = system._addNode("packages")
for p in self.packages.packages:
xpa = xpac._addNode("package")
for att in dir(p):
if att[0] != '_':
exec("xpa.%s = p.%s" % (att,att))
xpac._addNode(xpa)
#Kernel
xker = system._addNode("kernel")
for k in self.kernel.parametes:
xke = xker._addNode("parameter")
for att in dir(k):
if att[0] != '_':
exec("xke.%s = k.%s" % (att, att))
xker._addNode(xke)
#PFRING
xpfr = system._addNode("pfring")
for att in dir(self.pfring):
if att[0] != '_' and att != "checkInfo":
exec("xpfr.%s = self.pfring.%s" % (att, att))
#NETWORK
xnet = system._addNode("network")
for nc in self.network.cards:
xn = xnet._addNode("card")
for att in dir(nc):
if att[0] != '_' and att != "getRingParams":
exec("xn.%s = nc.%s" % (att,att))
xnet._addNode(xn)
#Write Results
f = open(fileName, 'w')
f.write(x.toxml())
f.close()
def applyXSLT(self, fileName):
pass
def main(argv=None):
s = systemInfo()
s.xmlOut("results.xml")
if __name__ == "__main__":
sys.exit(main())
| ajibawa-2023/Python-Code-Large/train/row_99990 | 307 | 435 | 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_99990:Expr_L4_C0", "label": "expression", "type": "expression", "loc": [4, 34], "level": 0, "parent": null, "vector": [8, 0, 0.0437, 0.0713, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"\nCreated by Jaime Blasco on 2009-09-15\nUploaed to Labs on 2011-09-26 <--- First contribution :P\n\nLicense:\n\nCopyright (c) 2009 AlienVault\nAll rights reserved."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Import_L36_C0", "label": "sys import sys", "type": "import", "loc": [36, 36], "level": 0, "parent": null, "vector": [1, 0, 0.0828, 0.0023, 0, 0.66, 0.04, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Import_L37_C0", "label": "getopt import getopt", "type": "import", "loc": [37, 37], "level": 0, "parent": null, "vector": [1, 0, 0.0851, 0.0023, 0, 0.66, 0.08, 588, 0, 1, 0, 0, 588, 0, 0], "semantic": {"name": "getopt", "arg_names": [], "import_names": ["getopt"], "rhs_call_name": "", "annotation": ""}, "snippet": "import getopt"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Import_L38_C0", "label": "fileinput import fileinput", "type": "import", "loc": [38, 38], "level": 0, "parent": null, "vector": [1, 0, 0.0874, 0.0023, 0, 0.66, 0.12, 286, 0, 1, 0, 0, 286, 0, 0], "semantic": {"name": "fileinput", "arg_names": [], "import_names": ["fileinput"], "rhs_call_name": "", "annotation": ""}, "snippet": "import fileinput"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Import_L39_C0", "label": "commands import commands", "type": "import", "loc": [39, 39], "level": 0, "parent": null, "vector": [1, 0, 0.0897, 0.0023, 0, 0.66, 0.16, 760, 0, 1, 0, 0, 760, 0, 0], "semantic": {"name": "commands", "arg_names": [], "import_names": ["commands"], "rhs_call_name": "", "annotation": ""}, "snippet": "import commands"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Import_L40_C0", "label": "re import re", "type": "import", "loc": [40, 40], "level": 0, "parent": null, "vector": [1, 0, 0.092, 0.0023, 0, 0.66, 0.2, 540, 0, 1, 0, 0, 540, 0, 0], "semantic": {"name": "re", "arg_names": [], "import_names": ["re"], "rhs_call_name": "", "annotation": ""}, "snippet": "import re"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:ImportFrom_L41_C0", "label": "from xmlobject import XMLFile", "type": "import", "loc": [41, 41], "level": 0, "parent": null, "vector": [1, 0, 0.0943, 0.0023, 0, 0.66, 0.24, 534, 0, 1, 0, 0, 534, 0, 0], "semantic": {"name": "xmlobject", "arg_names": [], "import_names": ["XMLFile"], "rhs_call_name": "", "annotation": ""}, "snippet": "from xmlobject import XMLFile"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Import_L42_C0", "label": "libxml2 import libxml2", "type": "import", "loc": [42, 42], "level": 0, "parent": null, "vector": [1, 0, 0.0966, 0.0023, 0, 0.66, 0.28, 256, 0, 1, 0, 0, 256, 0, 0], "semantic": {"name": "libxml2", "arg_names": [], "import_names": ["libxml2"], "rhs_call_name": "", "annotation": ""}, "snippet": "import libxml2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Import_L43_C0", "label": "libxslt import libxslt", "type": "import", "loc": [43, 43], "level": 0, "parent": null, "vector": [1, 0, 0.0989, 0.0023, 0, 0.66, 0.32, 767, 0, 1, 0, 0, 767, 0, 0], "semantic": {"name": "libxslt", "arg_names": [], "import_names": ["libxslt"], "rhs_call_name": "", "annotation": ""}, "snippet": "import libxslt"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L54_C0", "label": "disk", "type": "class", "loc": [54, 70], "level": 0, "parent": null, "vector": [3, 0, 0.1425, 0.0391, 0, 0.66, 0.36, 3, 0, 2, 0, 0, 0, 0, 8], "semantic": {"name": "disk", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class disk():\n\tdef __init__(self, id, size):\n\t\tself.id = id\n\t\tself.size = size\n\t\tself.rVel = self.timeRead()\n\t\t\n\tdef timeRead(self):\n\t\tprint(\"Timing %s ...\" % self.id)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L55_C1", "label": "__init__", "type": "function", "loc": [55, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L54_C0", "vector": [2, 1, 0.1299, 0.0092, 1, 0.55, 0.0, 555, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "id", "size"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __init__(self, id, size):\n\t\tself.id = id\n\t\tself.size = size\n\t\tself.rVel = self.timeRead()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L56_C2", "label": "self.id =", "type": "assigned_variable", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L55_C1", "vector": [14, 2, 0.1287, 0.0023, 2, 0.93, 0.0, 485, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.id = id"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L57_C2", "label": "self.size =", "type": "assigned_variable", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L55_C1", "vector": [14, 2, 0.131, 0.0023, 2, 0.93, 0.5, 183, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.size", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.size = size"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L58_C2", "label": "self.rVel = timeRead()", "type": "assigned_variable", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L55_C1", "vector": [14, 2, 0.1333, 0.0023, 2, 0.93, 1.0, 294, 3, 0, 0, 0, 719, 10, 1], "semantic": {"name": "self.rVel", "arg_names": [], "import_names": [], "rhs_call_name": "timeRead", "annotation": ""}, "snippet": "\t\tself.rVel = self.timeRead()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L60_C1", "label": "timeRead", "type": "function", "loc": [60, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L54_C0", "vector": [2, 1, 0.1494, 0.0253, 1, 0.55, 1.0, 719, 0, 1, 1, 0, 0, 0, 7], "semantic": {"name": "timeRead", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef timeRead(self):\n\t\tprint(\"Timing %s ...\" % self.id)\n\t\tdata = commands.getstatusoutput('hdparm -t /dev/%s' % self.id)[1]\n\t\tdata = data.split('\\n')\n\t\t# Timing buffered disk reads: 376 MB in 3.00 seconds = 125.18 MB/sec\n\t\tp = re.compile(r\".*= (?P<vel>[\\d\\.]+).*\")\n\t\tfor d in data:\n\t\t\tm = p.match(d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L61_C2", "label": "print()", "type": "expression", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L60_C1", "vector": [8, 2, 0.1402, 0.0023, 2, 0.44, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\t\tprint(\"Timing %s ...\" % self.id)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L62_C2", "label": "data =", "type": "assigned_variable", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L60_C1", "vector": [14, 2, 0.1425, 0.0023, 2, 0.44, 0.2, 929, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tdata = commands.getstatusoutput('hdparm -t /dev/%s' % self.id)[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L63_C2", "label": "data = split()", "type": "assigned_variable", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L60_C1", "vector": [14, 2, 0.1448, 0.0023, 2, 0.44, 0.4, 929, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": "\t\tdata = data.split('\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L65_C2", "label": "p = compile()", "type": "assigned_variable", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L60_C1", "vector": [14, 2, 0.1494, 0.0023, 2, 0.44, 0.6, 491, 3, 1, 0, 0, 821, 10, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": "\t\tp = re.compile(r\".*= (?P<vel>[\\d\\.]+).*\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L66_C2", "label": "for d", "type": "for", "loc": [66, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L60_C1", "vector": [6, 2, 0.1552, 0.0092, 2, 0.44, 0.8, 355, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor d in data:\n\t\t\tm = p.match(d)\n\t\t\tif (m):\n\t\t\t\treturn float(m.group(1))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L67_C3", "label": "m = match()", "type": "assigned_variable", "loc": [67, 67], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L66_C2", "vector": [14, 3, 0.154, 0.0023, 3, 0.74, 0.0, 711, 3, 1, 0, 0, 36, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "match", "annotation": ""}, "snippet": "\t\t\tm = p.match(d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L68_C3", "label": "if", "type": "if", "loc": [68, 69], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L66_C2", "vector": [4, 3, 0.1575, 0.0046, 3, 0.74, 1.0, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif (m):\n\t\t\t\treturn float(m.group(1))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Return_L69_C4", "label": "return", "type": "return", "loc": [69, 69], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L68_C3", "vector": [13, 4, 0.1586, 0.0023, 4, 0.56, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\treturn float(m.group(1))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Return_L70_C2", "label": "return", "type": "return", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L60_C1", "vector": [13, 2, 0.1609, 0.0023, 2, 0.44, 1.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L72_C0", "label": "diskInfo", "type": "class", "loc": [72, 88], "level": 0, "parent": null, "vector": [3, 0, 0.1839, 0.0391, 0, 0.66, 0.4, 28, 0, 2, 0, 0, 0, 0, 9], "semantic": {"name": "diskInfo", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class diskInfo():\n\tdef __init__(self):\n\t\tself.disks = []\n\t\tself.checkInfo()\n\t\t\n\tdef checkInfo(self):\n\t\tdata = commands.getstatusoutput('fdisk -l')[1]\n\t\tdata = data.split('\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L73_C1", "label": "__init__", "type": "function", "loc": [73, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L72_C0", "vector": [2, 1, 0.1701, 0.0069, 1, 0.99, 0.0, 555, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __init__(self):\n\t\tself.disks = []\n\t\tself.checkInfo()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L74_C2", "label": "self.disks =", "type": "assigned_variable", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L73_C1", "vector": [14, 2, 0.1701, 0.0023, 2, 0.3, 0.0, 186, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.disks", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.disks = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L75_C2", "label": "checkInfo()", "type": "expression", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L73_C1", "vector": [8, 2, 0.1724, 0.0023, 2, 0.3, 1.0, 369, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "checkInfo", "arg_names": [], "import_names": [], "rhs_call_name": "checkInfo", "annotation": ""}, "snippet": "\t\tself.checkInfo()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L77_C1", "label": "checkInfo", "type": "function", "loc": [77, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L72_C0", "vector": [2, 1, 0.1897, 0.0276, 1, 0.99, 1.0, 369, 0, 1, 0, 0, 0, 0, 8], "semantic": {"name": "checkInfo", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef checkInfo(self):\n\t\tdata = commands.getstatusoutput('fdisk -l')[1]\n\t\tdata = data.split('\\n')\n\t\t#Disk /dev/sda: 73.4 GB, 73407488000 bytes\n\t\tp = re.compile(r\"Disk /dev/(?P<label>\\S+):.*, (?P<cap>\\d+)\\sbytes.*\")\n\t\tfor d in data:\n\t\t\tm = p.match(d)\n\t\t\tif (m):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L78_C2", "label": "data =", "type": "assigned_variable", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L77_C1", "vector": [14, 2, 0.1793, 0.0023, 2, 0.35, 0.0, 929, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tdata = commands.getstatusoutput('fdisk -l')[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L79_C2", "label": "data = split()", "type": "assigned_variable", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L77_C1", "vector": [14, 2, 0.1816, 0.0023, 2, 0.35, 0.3333, 929, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": "\t\tdata = data.split('\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L81_C2", "label": "p = compile()", "type": "assigned_variable", "loc": [81, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L77_C1", "vector": [14, 2, 0.1862, 0.0023, 2, 0.35, 0.6667, 491, 3, 1, 0, 0, 821, 10, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": "\t\tp = re.compile(r\"Disk /dev/(?P<label>\\S+):.*, (?P<cap>\\d+)\\sbytes.*\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L82_C2", "label": "for d", "type": "for", "loc": [82, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L77_C1", "vector": [6, 2, 0.1954, 0.0161, 2, 0.35, 1.0, 355, 2, 0, 0, 0, 0, 0, 5], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor d in data:\n\t\t\tm = p.match(d)\n\t\t\tif (m):\n\t\t\t\tlabel = m.group(1)\n\t\t\t\tsize = m.group(2)\n\t\t\t\tdi = disk(label, size)\n\t\t\t\tself.disks.append(di)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L83_C3", "label": "m = match()", "type": "assigned_variable", "loc": [83, 83], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L82_C2", "vector": [14, 3, 0.1908, 0.0023, 3, 0.9, 0.0, 711, 3, 1, 0, 0, 36, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "match", "annotation": ""}, "snippet": "\t\t\tm = p.match(d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L84_C3", "label": "if", "type": "if", "loc": [84, 88], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L82_C2", "vector": [4, 3, 0.1977, 0.0115, 3, 0.9, 1.0, 0, 2, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif (m):\n\t\t\t\tlabel = m.group(1)\n\t\t\t\tsize = m.group(2)\n\t\t\t\tdi = disk(label, size)\n\t\t\t\tself.disks.append(di)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L85_C4", "label": "label = group()", "type": "assigned_variable", "loc": [85, 85], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L84_C3", "vector": [14, 4, 0.1954, 0.0023, 4, 0.39, 0.0, 811, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "label", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\t\t\tlabel = m.group(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L86_C4", "label": "size = group()", "type": "assigned_variable", "loc": [86, 86], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L84_C3", "vector": [14, 4, 0.1977, 0.0023, 4, 0.39, 0.3333, 714, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "size", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\t\t\tsize = m.group(2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L87_C4", "label": "di = disk()", "type": "assigned_variable", "loc": [87, 87], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L84_C3", "vector": [14, 4, 0.2, 0.0023, 4, 0.39, 0.6667, 700, 3, 2, 0, 0, 3, 10, 1], "semantic": {"name": "di", "arg_names": [], "import_names": [], "rhs_call_name": "disk", "annotation": ""}, "snippet": "\t\t\t\tdi = disk(label, size)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L88_C4", "label": "append()", "type": "expression", "loc": [88, 88], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L84_C3", "vector": [8, 4, 0.2023, 0.0023, 4, 0.39, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": "\t\t\t\tself.disks.append(di)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L90_C0", "label": "memInfo", "type": "class", "loc": [90, 117], "level": 0, "parent": null, "vector": [3, 0, 0.2379, 0.0644, 0, 0.66, 0.44, 661, 0, 2, 0, 0, 0, 0, 15], "semantic": {"name": "memInfo", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class memInfo():\n\tdef __init__(self):\n\t\tself.checkInfo()\n\t\tself.memTotal = 0\n\t\tself.memFree = 0\n\t\tself.swapTotal = 0\n\t\tself.swapFree = 0\n\t\t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L91_C1", "label": "__init__", "type": "function", "loc": [91, 96], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L90_C0", "vector": [2, 1, 0.2149, 0.0138, 1, 0.0, 0.0, 555, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __init__(self):\n\t\tself.checkInfo()\n\t\tself.memTotal = 0\n\t\tself.memFree = 0\n\t\tself.swapTotal = 0\n\t\tself.swapFree = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L92_C2", "label": "checkInfo()", "type": "expression", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L91_C1", "vector": [8, 2, 0.2115, 0.0023, 2, 0.28, 0.0, 369, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "checkInfo", "arg_names": [], "import_names": [], "rhs_call_name": "checkInfo", "annotation": ""}, "snippet": "\t\tself.checkInfo()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L93_C2", "label": "self.memTotal =", "type": "assigned_variable", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L91_C1", "vector": [14, 2, 0.2138, 0.0023, 2, 0.28, 0.25, 502, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.memTotal", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.memTotal = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L94_C2", "label": "self.memFree =", "type": "assigned_variable", "loc": [94, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L91_C1", "vector": [14, 2, 0.2161, 0.0023, 2, 0.28, 0.5, 695, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.memFree", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.memFree = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L95_C2", "label": "self.swapTotal =", "type": "assigned_variable", "loc": [95, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L91_C1", "vector": [14, 2, 0.2184, 0.0023, 2, 0.28, 0.75, 578, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.swapTotal", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.swapTotal = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L96_C2", "label": "self.swapFree =", "type": "assigned_variable", "loc": [96, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L91_C1", "vector": [14, 2, 0.2207, 0.0023, 2, 0.28, 1.0, 357, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.swapFree", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.swapFree = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L98_C1", "label": "checkInfo", "type": "function", "loc": [98, 117], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L90_C0", "vector": [2, 1, 0.2471, 0.046, 1, 0.0, 1.0, 369, 0, 1, 0, 0, 0, 0, 14], "semantic": {"name": "checkInfo", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef checkInfo(self):\n\t\tdata = commands.getstatusoutput('cat /proc/meminfo')[1]\n\t\tdata = data.split('\\n')\n\t\tp1 = re.compile(r\"MemTotal:\\s+(?P<mem>\\d+)\\skB.*\")\n\t\tp2 = re.compile(r\"MemFree:\\s+(?P<mem>\\d+)\\skB.*\")\n\t\tp3 = re.compile(r\"SwapTotal:\\s+(?P<mem>\\d+)\\skB.*\")\n\t\tp4 = re.compile(r\"SwapFree:\\s+(?P<mem>\\d+)\\skB.*\")\n\t\tfor d in data:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L99_C2", "label": "data =", "type": "assigned_variable", "loc": [99, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L98_C1", "vector": [14, 2, 0.2276, 0.0023, 2, 0.58, 0.0, 929, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tdata = commands.getstatusoutput('cat /proc/meminfo')[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L100_C2", "label": "data = split()", "type": "assigned_variable", "loc": [100, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L98_C1", "vector": [14, 2, 0.2299, 0.0023, 2, 0.58, 0.1667, 929, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": "\t\tdata = data.split('\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L101_C2", "label": "p1 = compile()", "type": "assigned_variable", "loc": [101, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L98_C1", "vector": [14, 2, 0.2322, 0.0023, 2, 0.58, 0.3333, 87, 3, 1, 0, 0, 821, 10, 1], "semantic": {"name": "p1", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": "\t\tp1 = re.compile(r\"MemTotal:\\s+(?P<mem>\\d+)\\skB.*\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L102_C2", "label": "p2 = compile()", "type": "assigned_variable", "loc": [102, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L98_C1", "vector": [14, 2, 0.2345, 0.0023, 2, 0.58, 0.5, 843, 3, 1, 0, 0, 821, 10, 1], "semantic": {"name": "p2", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": "\t\tp2 = re.compile(r\"MemFree:\\s+(?P<mem>\\d+)\\skB.*\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L103_C2", "label": "p3 = compile()", "type": "assigned_variable", "loc": [103, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L98_C1", "vector": [14, 2, 0.2368, 0.0023, 2, 0.58, 0.6667, 80, 3, 1, 0, 0, 821, 10, 1], "semantic": {"name": "p3", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": "\t\tp3 = re.compile(r\"SwapTotal:\\s+(?P<mem>\\d+)\\skB.*\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L104_C2", "label": "p4 = compile()", "type": "assigned_variable", "loc": [104, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L98_C1", "vector": [14, 2, 0.2391, 0.0023, 2, 0.58, 0.8333, 80, 3, 1, 0, 0, 821, 10, 1], "semantic": {"name": "p4", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": "\t\tp4 = re.compile(r\"SwapFree:\\s+(?P<mem>\\d+)\\skB.*\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L105_C2", "label": "for d", "type": "for", "loc": [105, 117], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L98_C1", "vector": [6, 2, 0.2552, 0.0299, 2, 0.58, 1.0, 355, 2, 0, 0, 0, 0, 0, 8], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor d in data:\n\t\t\tm = p1.match(d)\n\t\t\tif (m):\n\t\t\t\tself.memTotal = m.group(1)\n\t\t\tm = p2.match(d)\n\t\t\tif (m):\n\t\t\t\tself.memFree = m.group(1)\n\t\t\tm = p3.match(d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L106_C3", "label": "m = match()", "type": "assigned_variable", "loc": [106, 106], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L105_C2", "vector": [14, 3, 0.2437, 0.0023, 3, 0.84, 0.0, 711, 3, 1, 0, 0, 36, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "match", "annotation": ""}, "snippet": "\t\t\tm = p1.match(d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L107_C3", "label": "if", "type": "if", "loc": [107, 108], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L105_C2", "vector": [4, 3, 0.2471, 0.0046, 3, 0.84, 0.1429, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif (m):\n\t\t\t\tself.memTotal = m.group(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L108_C4", "label": "self.memTotal = group()", "type": "assigned_variable", "loc": [108, 108], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L107_C3", "vector": [14, 4, 0.2483, 0.0023, 4, 0.46, 0.0, 502, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "self.memTotal", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\t\t\tself.memTotal = m.group(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L109_C3", "label": "m = match()", "type": "assigned_variable", "loc": [109, 109], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L105_C2", "vector": [14, 3, 0.2506, 0.0023, 3, 0.84, 0.2857, 711, 3, 1, 0, 0, 36, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "match", "annotation": ""}, "snippet": "\t\t\tm = p2.match(d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L110_C3", "label": "if", "type": "if", "loc": [110, 111], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L105_C2", "vector": [4, 3, 0.254, 0.0046, 3, 0.84, 0.4286, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif (m):\n\t\t\t\tself.memFree = m.group(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L111_C4", "label": "self.memFree = group()", "type": "assigned_variable", "loc": [111, 111], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L110_C3", "vector": [14, 4, 0.2552, 0.0023, 4, 0.5, 0.0, 695, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "self.memFree", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\t\t\tself.memFree = m.group(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L112_C3", "label": "m = match()", "type": "assigned_variable", "loc": [112, 112], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L105_C2", "vector": [14, 3, 0.2575, 0.0023, 3, 0.84, 0.5714, 711, 3, 1, 0, 0, 36, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "match", "annotation": ""}, "snippet": "\t\t\tm = p3.match(d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L113_C3", "label": "if", "type": "if", "loc": [113, 114], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L105_C2", "vector": [4, 3, 0.2609, 0.0046, 3, 0.84, 0.7143, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif (m):\n\t\t\t\tself.swapTotal = m.group(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L114_C4", "label": "self.swapTotal = group()", "type": "assigned_variable", "loc": [114, 114], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L113_C3", "vector": [14, 4, 0.2621, 0.0023, 4, 0.41, 0.0, 578, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "self.swapTotal", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\t\t\tself.swapTotal = m.group(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L115_C3", "label": "m = match()", "type": "assigned_variable", "loc": [115, 115], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L105_C2", "vector": [14, 3, 0.2644, 0.0023, 3, 0.84, 0.8571, 711, 3, 1, 0, 0, 36, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "match", "annotation": ""}, "snippet": "\t\t\tm = p4.match(d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L116_C3", "label": "if", "type": "if", "loc": [116, 117], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L105_C2", "vector": [4, 3, 0.2678, 0.0046, 3, 0.84, 1.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif (m):\n\t\t\t\tself.swapFree = m.group(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L117_C4", "label": "self.swapFree = group()", "type": "assigned_variable", "loc": [117, 117], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L116_C3", "vector": [14, 4, 0.269, 0.0023, 4, 0.61, 0.0, 357, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "self.swapFree", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\t\t\tself.swapFree = m.group(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L119_C0", "label": "cpu", "type": "class", "loc": [119, 138], "level": 0, "parent": null, "vector": [3, 0, 0.2954, 0.046, 0, 0.66, 0.48, 468, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "cpu", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class cpu():\n\tdef __init__(self, id, vendor_id, cpu_family, model_id, model_name):\n\t\tself.id = id\n\t\tself.vendor_id = vendor_id\n\t\tself.cpu_family = cpu_family\n\t\tself.model_id = model_id\n\t\tself.model_name = model_name\n\t\t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L120_C1", "label": "__init__", "type": "function", "loc": [120, 125], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L119_C0", "vector": [2, 1, 0.2816, 0.0138, 1, 0.12, 0.0, 555, 0, 6, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "id", "vendor_id", "cpu_family", "model_id", "model_name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __init__(self, id, vendor_id, cpu_family, model_id, model_name):\n\t\tself.id = id\n\t\tself.vendor_id = vendor_id\n\t\tself.cpu_family = cpu_family\n\t\tself.model_id = model_id\n\t\tself.model_name = model_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L121_C2", "label": "self.id =", "type": "assigned_variable", "loc": [121, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L120_C1", "vector": [14, 2, 0.2782, 0.0023, 2, 0.94, 0.0, 485, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.id = id"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L122_C2", "label": "self.vendor_id =", "type": "assigned_variable", "loc": [122, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L120_C1", "vector": [14, 2, 0.2805, 0.0023, 2, 0.94, 0.25, 864, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.vendor_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.vendor_id = vendor_id"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L123_C2", "label": "self.cpu_family =", "type": "assigned_variable", "loc": [123, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L120_C1", "vector": [14, 2, 0.2828, 0.0023, 2, 0.94, 0.5, 735, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.cpu_family", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.cpu_family = cpu_family"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L124_C2", "label": "self.model_id =", "type": "assigned_variable", "loc": [124, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L120_C1", "vector": [14, 2, 0.2851, 0.0023, 2, 0.94, 0.75, 240, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.model_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.model_id = model_id"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L125_C2", "label": "self.model_name =", "type": "assigned_variable", "loc": [125, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L120_C1", "vector": [14, 2, 0.2874, 0.0023, 2, 0.94, 1.0, 422, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.model_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.model_name = model_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L127_C1", "label": "__repr__", "type": "function", "loc": [127, 128], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L119_C0", "vector": [2, 1, 0.2931, 0.0046, 1, 0.12, 0.5, 204, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "__repr__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __repr__(self):\n\t\treturn \"%s,%s,%s,%s,%s\" % (self.id, self.vendor_id, self.cpu_family, self.model_id, self.model_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Return_L128_C2", "label": "return", "type": "return", "loc": [128, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L127_C1", "vector": [13, 2, 0.2943, 0.0023, 2, 0.24, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn \"%s,%s,%s,%s,%s\" % (self.id, self.vendor_id, self.cpu_family, self.model_id, self.model_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L129_C1", "label": "expression", "type": "expression", "loc": [129, 138], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L119_C0", "vector": [8, 1, 0.3069, 0.023, 1, 0.12, 1.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t'''\n\tdef xml(self, dom):\n\t\tcp = dom.createElement(\"cpu\")\n\t\tcp.id = self.id\n\t\tcp.vendor_id = vendor_id\n\t\tcp.cpu_family = cpu_family\n\t\tcp.model_id = model_id\n\t\tcp.model_name = model_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L139_C0", "label": "cpuInfo", "type": "class", "loc": [139, 174], "level": 0, "parent": null, "vector": [3, 0, 0.3598, 0.0828, 0, 0.66, 0.52, 934, 0, 3, 0, 0, 0, 0, 22], "semantic": {"name": "cpuInfo", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class cpuInfo():\n\tdef __init__(self):\n\t\tself.cpus = []\n\t\tself.checkInfo()\n\t\t\n\tdef checkInfo(self):\n\t\tdata = commands.getstatusoutput('cat /proc/cpuinfo')[1]\n\t\tdata = data.split('\\n\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L140_C1", "label": "__init__", "type": "function", "loc": [140, 142], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L139_C0", "vector": [2, 1, 0.3241, 0.0069, 1, 0.28, 0.0, 555, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __init__(self):\n\t\tself.cpus = []\n\t\tself.checkInfo()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L141_C2", "label": "self.cpus =", "type": "assigned_variable", "loc": [141, 141], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L140_C1", "vector": [14, 2, 0.3241, 0.0023, 2, 0.36, 0.0, 318, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.cpus", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.cpus = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L142_C2", "label": "checkInfo()", "type": "expression", "loc": [142, 142], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L140_C1", "vector": [8, 2, 0.3264, 0.0023, 2, 0.36, 1.0, 369, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "checkInfo", "arg_names": [], "import_names": [], "rhs_call_name": "checkInfo", "annotation": ""}, "snippet": "\t\tself.checkInfo()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L144_C1", "label": "checkInfo", "type": "function", "loc": [144, 148], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L139_C0", "vector": [2, 1, 0.3356, 0.0115, 1, 0.28, 0.5, 369, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "checkInfo", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef checkInfo(self):\n\t\tdata = commands.getstatusoutput('cat /proc/cpuinfo')[1]\n\t\tdata = data.split('\\n\\n')\n\t\tfor d in data:\n\t\t\tself.parseCpuData(d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L145_C2", "label": "data =", "type": "assigned_variable", "loc": [145, 145], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L144_C1", "vector": [14, 2, 0.3333, 0.0023, 2, 0.67, 0.0, 929, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tdata = commands.getstatusoutput('cat /proc/cpuinfo')[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L146_C2", "label": "data = split()", "type": "assigned_variable", "loc": [146, 146], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L144_C1", "vector": [14, 2, 0.3356, 0.0023, 2, 0.67, 0.5, 929, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": "\t\tdata = data.split('\\n\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L147_C2", "label": "for d", "type": "for", "loc": [147, 148], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L144_C1", "vector": [6, 2, 0.3391, 0.0046, 2, 0.67, 1.0, 355, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor d in data:\n\t\t\tself.parseCpuData(d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L148_C3", "label": "parseCpuData()", "type": "expression", "loc": [148, 148], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L147_C2", "vector": [8, 3, 0.3402, 0.0023, 3, 0.51, 0.0, 723, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "parseCpuData", "arg_names": [], "import_names": [], "rhs_call_name": "parseCpuData", "annotation": ""}, "snippet": "\t\t\tself.parseCpuData(d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L150_C1", "label": "parseCpuData", "type": "function", "loc": [150, 174], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L139_C0", "vector": [2, 1, 0.3724, 0.0575, 1, 0.28, 1.0, 723, 0, 2, 0, 0, 0, 0, 18], "semantic": {"name": "parseCpuData", "arg_names": ["self", "data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef parseCpuData(self, data):\n\t\tdata = data.split('\\n')\n\t\tp = re.compile(r\"([\\w\\s+]+)\\t: (?P<val>.*)\")\n\t\tm = p.match(data[0])\n\t\tid = m.group(2)\n\t\t\n\t\tp = re.compile(r\"([\\w\\s+]+)\\t: (?P<val>.*)\")\n\t\tm = p.match(data[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L151_C2", "label": "data = split()", "type": "assigned_variable", "loc": [151, 151], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L150_C1", "vector": [14, 2, 0.3471, 0.0023, 2, 0.94, 0.0, 929, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": "\t\tdata = data.split('\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L152_C2", "label": "p = compile()", "type": "assigned_variable", "loc": [152, 152], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L150_C1", "vector": [14, 2, 0.3494, 0.0023, 2, 0.94, 0.0588, 491, 3, 1, 0, 0, 821, 10, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": "\t\tp = re.compile(r\"([\\w\\s+]+)\\t: (?P<val>.*)\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L153_C2", "label": "m = match()", "type": "assigned_variable", "loc": [153, 153], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L150_C1", "vector": [14, 2, 0.3517, 0.0023, 2, 0.94, 0.1176, 711, 3, 1, 0, 0, 36, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "match", "annotation": ""}, "snippet": "\t\tm = p.match(data[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L154_C2", "label": "id = group()", "type": "assigned_variable", "loc": [154, 154], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L150_C1", "vector": [14, 2, 0.354, 0.0023, 2, 0.94, 0.1765, 941, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "id", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\tid = m.group(2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L156_C2", "label": "p = compile()", "type": "assigned_variable", "loc": [156, 156], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L150_C1", "vector": [14, 2, 0.3586, 0.0023, 2, 0.94, 0.2353, 491, 3, 1, 0, 0, 821, 10, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": "\t\tp = re.compile(r\"([\\w\\s+]+)\\t: (?P<val>.*)\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L157_C2", "label": "m = match()", "type": "assigned_variable", "loc": [157, 157], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L150_C1", "vector": [14, 2, 0.3609, 0.0023, 2, 0.94, 0.2941, 711, 3, 1, 0, 0, 36, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "match", "annotation": ""}, "snippet": "\t\tm = p.match(data[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L158_C2", "label": "vendor_id = group()", "type": "assigned_variable", "loc": [158, 158], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L150_C1", "vector": [14, 2, 0.3632, 0.0023, 2, 0.94, 0.3529, 36, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "vendor_id", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\tvendor_id = m.group(2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L160_C2", "label": "p = compile()", "type": "assigned_variable", "loc": [160, 160], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L150_C1", "vector": [14, 2, 0.3678, 0.0023, 2, 0.94, 0.4118, 491, 3, 1, 0, 0, 821, 10, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": "\t\tp = re.compile(r\"([\\w\\s+]+)\\t: (?P<val>.*)\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L161_C2", "label": "m = match()", "type": "assigned_variable", "loc": [161, 161], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L150_C1", "vector": [14, 2, 0.3701, 0.0023, 2, 0.94, 0.4706, 711, 3, 1, 0, 0, 36, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "match", "annotation": ""}, "snippet": "\t\tm = p.match(data[2])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L162_C2", "label": "cpu_family = group()", "type": "assigned_variable", "loc": [162, 162], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L150_C1", "vector": [14, 2, 0.3724, 0.0023, 2, 0.94, 0.5294, 602, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "cpu_family", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\tcpu_family = m.group(2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L164_C2", "label": "p = compile()", "type": "assigned_variable", "loc": [164, 164], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L150_C1", "vector": [14, 2, 0.377, 0.0023, 2, 0.94, 0.5882, 491, 3, 1, 0, 0, 821, 10, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": "\t\tp = re.compile(r\"([\\w\\s+]+)\\t: (?P<val>.*)\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L165_C2", "label": "m = match()", "type": "assigned_variable", "loc": [165, 165], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L150_C1", "vector": [14, 2, 0.3793, 0.0023, 2, 0.94, 0.6471, 711, 3, 1, 0, 0, 36, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "match", "annotation": ""}, "snippet": "\t\tm = p.match(data[3])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L166_C2", "label": "model_id = group()", "type": "assigned_variable", "loc": [166, 166], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L150_C1", "vector": [14, 2, 0.3816, 0.0023, 2, 0.94, 0.7059, 576, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "model_id", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\tmodel_id = m.group(2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L168_C2", "label": "p = compile()", "type": "assigned_variable", "loc": [168, 168], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L150_C1", "vector": [14, 2, 0.3862, 0.0023, 2, 0.94, 0.7647, 491, 3, 1, 0, 0, 821, 10, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": "\t\tp = re.compile(r\"([\\w\\s+]+)\\t: (?P<val>.*)\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L169_C2", "label": "m = match()", "type": "assigned_variable", "loc": [169, 169], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L150_C1", "vector": [14, 2, 0.3885, 0.0023, 2, 0.94, 0.8235, 711, 3, 1, 0, 0, 36, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "match", "annotation": ""}, "snippet": "\t\tm = p.match(data[4])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L170_C2", "label": "model_name = group()", "type": "assigned_variable", "loc": [170, 170], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L150_C1", "vector": [14, 2, 0.3908, 0.0023, 2, 0.94, 0.8824, 131, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "model_name", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\tmodel_name = m.group(2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L172_C2", "label": "cp = cpu()", "type": "assigned_variable", "loc": [172, 172], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L150_C1", "vector": [14, 2, 0.3954, 0.0023, 2, 0.94, 0.9412, 70, 3, 5, 0, 0, 468, 10, 1], "semantic": {"name": "cp", "arg_names": [], "import_names": [], "rhs_call_name": "cpu", "annotation": ""}, "snippet": "\t\tcp = cpu(id, vendor_id, cpu_family, model_id, model_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L174_C2", "label": "append()", "type": "expression", "loc": [174, 174], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L150_C1", "vector": [8, 2, 0.4, 0.0023, 2, 0.94, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": "\t\tself.cpus.append(cp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L176_C0", "label": "pciDev", "type": "class", "loc": [176, 186], "level": 0, "parent": null, "vector": [3, 0, 0.4161, 0.0253, 0, 0.66, 0.56, 769, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "pciDev", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class pciDev():\n\tdef __init__(self, device, dClass, vendor, deviceName, sVendor, sDevice):\n\t\tself.device = device\n\t\tself.dClass = dClass\n\t\tself.vendor = vendor\n\t\tself.deviceName = deviceName\n\t\tself.sVendor = sVendor\n\t\tself.sDevice = sDevice"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L177_C1", "label": "__init__", "type": "function", "loc": [177, 183], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L176_C0", "vector": [2, 1, 0.4138, 0.0161, 1, 0.87, 0.0, 555, 0, 7, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "device", "dClass", "vendor", "deviceName", "sVendor", "sDevice"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __init__(self, device, dClass, vendor, deviceName, sVendor, sDevice):\n\t\tself.device = device\n\t\tself.dClass = dClass\n\t\tself.vendor = vendor\n\t\tself.deviceName = deviceName\n\t\tself.sVendor = sVendor\n\t\tself.sDevice = sDevice"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L178_C2", "label": "self.device =", "type": "assigned_variable", "loc": [178, 178], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L177_C1", "vector": [14, 2, 0.4092, 0.0023, 2, 0.79, 0.0, 993, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.device", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.device = device"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L179_C2", "label": "self.dClass =", "type": "assigned_variable", "loc": [179, 179], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L177_C1", "vector": [14, 2, 0.4115, 0.0023, 2, 0.79, 0.2, 575, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.dClass", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.dClass = dClass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L180_C2", "label": "self.vendor =", "type": "assigned_variable", "loc": [180, 180], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L177_C1", "vector": [14, 2, 0.4138, 0.0023, 2, 0.79, 0.4, 933, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.vendor", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.vendor = vendor"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L181_C2", "label": "self.deviceName =", "type": "assigned_variable", "loc": [181, 181], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L177_C1", "vector": [14, 2, 0.4161, 0.0023, 2, 0.79, 0.6, 514, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.deviceName", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.deviceName = deviceName"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L182_C2", "label": "self.sVendor =", "type": "assigned_variable", "loc": [182, 182], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L177_C1", "vector": [14, 2, 0.4184, 0.0023, 2, 0.79, 0.8, 589, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.sVendor", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.sVendor = sVendor"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L183_C2", "label": "self.sDevice =", "type": "assigned_variable", "loc": [183, 183], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L177_C1", "vector": [14, 2, 0.4207, 0.0023, 2, 0.79, 1.0, 215, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.sDevice", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.sDevice = sDevice"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L185_C1", "label": "__repr__", "type": "function", "loc": [185, 186], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L176_C0", "vector": [2, 1, 0.4264, 0.0046, 1, 0.87, 1.0, 204, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "__repr__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __repr__(self):\n\t\treturn \"%s,%s,%s,%s,%s,%s\" % (self.device, self.dClass, self.vendor, self.deviceName, self.sVendor, self.sDevice)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Return_L186_C2", "label": "return", "type": "return", "loc": [186, 186], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L185_C1", "vector": [13, 2, 0.4276, 0.0023, 2, 0.05, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn \"%s,%s,%s,%s,%s,%s\" % (self.device, self.dClass, self.vendor, self.deviceName, self.sVendor, self.sDevice)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L188_C0", "label": "pciInfo", "type": "class", "loc": [188, 208], "level": 0, "parent": null, "vector": [3, 0, 0.4552, 0.0483, 0, 0.66, 0.6, 477, 0, 2, 0, 0, 0, 0, 12], "semantic": {"name": "pciInfo", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class pciInfo():\n\tdef __init__(self):\n\t\tself.devices = []\n\t\tself.checkInfo()\n\t\t\n\tdef checkInfo(self):\n\t\t\"\"\"Parse lspci info\"\"\"\n\t\tdata = commands.getstatusoutput('lspci -mm')[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L189_C1", "label": "__init__", "type": "function", "loc": [189, 191], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L188_C0", "vector": [2, 1, 0.4368, 0.0069, 1, 0.63, 0.0, 555, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __init__(self):\n\t\tself.devices = []\n\t\tself.checkInfo()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L190_C2", "label": "self.devices =", "type": "assigned_variable", "loc": [190, 190], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L189_C1", "vector": [14, 2, 0.4368, 0.0023, 2, 0.93, 0.0, 542, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.devices", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.devices = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L191_C2", "label": "checkInfo()", "type": "expression", "loc": [191, 191], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L189_C1", "vector": [8, 2, 0.4391, 0.0023, 2, 0.93, 1.0, 369, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "checkInfo", "arg_names": [], "import_names": [], "rhs_call_name": "checkInfo", "annotation": ""}, "snippet": "\t\tself.checkInfo()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L193_C1", "label": "checkInfo", "type": "function", "loc": [193, 208], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L188_C0", "vector": [2, 1, 0.4609, 0.0368, 1, 0.63, 1.0, 369, 0, 1, 0, 0, 0, 0, 11], "semantic": {"name": "checkInfo", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef checkInfo(self):\n\t\t\"\"\"Parse lspci info\"\"\"\n\t\tdata = commands.getstatusoutput('lspci -mm')[1]\n\t\tdata = data.split('\\n')\n\t\t#07:00.0 \"Ethernet controller\" \"Intel Corporation\" \"80003ES2LAN Gigabit Ethernet Controller (Copper)\" -r01 \"ASUSTeK Computer Inc.\" \"Device 8217\"\n\t\t#07:00.1 \"Ethernet controller\" \"Intel Corporation\" \"80003ES2LAN Gigabit Ethernet Controller (Copper)\" -r01 \"ASUSTeK Computer Inc.\" \"Device 8217\"\n\t\tfor d in data:\n\t\t\td = d.split(' \"')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L194_C2", "label": "expression", "type": "expression", "loc": [194, 194], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L193_C1", "vector": [8, 2, 0.446, 0.0023, 2, 0.27, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\"\"\"Parse lspci info\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L195_C2", "label": "data =", "type": "assigned_variable", "loc": [195, 195], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L193_C1", "vector": [14, 2, 0.4483, 0.0023, 2, 0.27, 0.3333, 929, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tdata = commands.getstatusoutput('lspci -mm')[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L196_C2", "label": "data = split()", "type": "assigned_variable", "loc": [196, 196], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L193_C1", "vector": [14, 2, 0.4506, 0.0023, 2, 0.27, 0.6667, 929, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": "\t\tdata = data.split('\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L199_C2", "label": "for d", "type": "for", "loc": [199, 208], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L193_C1", "vector": [6, 2, 0.4678, 0.023, 2, 0.27, 1.0, 355, 2, 0, 0, 0, 0, 0, 9], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor d in data:\n\t\t\td = d.split(' \"')\n\t\t\tdevice = d[0].replace('\"', '')\n\t\t\tdClass = d[1].replace('\"', '')\n\t\t\tvendor = d[2].replace('\"', '')\n\t\t\tdeviceName = d[3].replace('\"', '')\n\t\t\tsVendor = d[4].replace('\"', '')\n\t\t\tsDevice = d[5].replace('\"', '')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L200_C3", "label": "d = split()", "type": "assigned_variable", "loc": [200, 200], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L199_C2", "vector": [14, 3, 0.4598, 0.0023, 3, 0.17, 0.0, 355, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": "\t\t\td = d.split(' \"')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L201_C3", "label": "device = replace()", "type": "assigned_variable", "loc": [201, 201], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L199_C2", "vector": [14, 3, 0.4621, 0.0023, 3, 0.17, 0.125, 183, 3, 2, 0, 0, 293, 10, 1], "semantic": {"name": "device", "arg_names": [], "import_names": [], "rhs_call_name": "replace", "annotation": ""}, "snippet": "\t\t\tdevice = d[0].replace('\"', '')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L202_C3", "label": "dClass = replace()", "type": "assigned_variable", "loc": [202, 202], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L199_C2", "vector": [14, 3, 0.4644, 0.0023, 3, 0.17, 0.25, 898, 3, 2, 0, 0, 293, 10, 1], "semantic": {"name": "dClass", "arg_names": [], "import_names": [], "rhs_call_name": "replace", "annotation": ""}, "snippet": "\t\t\tdClass = d[1].replace('\"', '')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L203_C3", "label": "vendor = replace()", "type": "assigned_variable", "loc": [203, 203], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L199_C2", "vector": [14, 3, 0.4667, 0.0023, 3, 0.17, 0.375, 724, 3, 2, 0, 0, 293, 10, 1], "semantic": {"name": "vendor", "arg_names": [], "import_names": [], "rhs_call_name": "replace", "annotation": ""}, "snippet": "\t\t\tvendor = d[2].replace('\"', '')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L204_C3", "label": "deviceName = replace()", "type": "assigned_variable", "loc": [204, 204], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L199_C2", "vector": [14, 3, 0.469, 0.0023, 3, 0.17, 0.5, 769, 3, 2, 0, 0, 293, 10, 1], "semantic": {"name": "deviceName", "arg_names": [], "import_names": [], "rhs_call_name": "replace", "annotation": ""}, "snippet": "\t\t\tdeviceName = d[3].replace('\"', '')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L205_C3", "label": "sVendor = replace()", "type": "assigned_variable", "loc": [205, 205], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L199_C2", "vector": [14, 3, 0.4713, 0.0023, 3, 0.17, 0.625, 116, 3, 2, 0, 0, 293, 10, 1], "semantic": {"name": "sVendor", "arg_names": [], "import_names": [], "rhs_call_name": "replace", "annotation": ""}, "snippet": "\t\t\tsVendor = d[4].replace('\"', '')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L206_C3", "label": "sDevice = replace()", "type": "assigned_variable", "loc": [206, 206], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L199_C2", "vector": [14, 3, 0.4736, 0.0023, 3, 0.17, 0.75, 129, 3, 2, 0, 0, 293, 10, 1], "semantic": {"name": "sDevice", "arg_names": [], "import_names": [], "rhs_call_name": "replace", "annotation": ""}, "snippet": "\t\t\tsDevice = d[5].replace('\"', '')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L207_C3", "label": "pDev = pciDev()", "type": "assigned_variable", "loc": [207, 207], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L199_C2", "vector": [14, 3, 0.4759, 0.0023, 3, 0.17, 0.875, 182, 3, 6, 0, 0, 769, 10, 1], "semantic": {"name": "pDev", "arg_names": [], "import_names": [], "rhs_call_name": "pciDev", "annotation": ""}, "snippet": "\t\t\tpDev = pciDev(device, dClass, vendor, deviceName, sVendor, sDevice)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L208_C3", "label": "append()", "type": "expression", "loc": [208, 208], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L199_C2", "vector": [8, 3, 0.4782, 0.0023, 3, 0.17, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": "\t\t\tself.devices.append(pDev)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L210_C0", "label": "networkCard", "type": "class", "loc": [210, 233], "level": 0, "parent": null, "vector": [3, 0, 0.5092, 0.0552, 0, 0.66, 0.64, 44, 0, 3, 0, 0, 0, 0, 12], "semantic": {"name": "networkCard", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class networkCard():\n\tdef __init__(self, interface, neg):\n\t\tself.interface = interface\n\t\tself.neg = neg\n\t\tself.getRingParams()\n\n\tdef __repr__(self):\n\t\treturn \"%s,%s,%s,%s,%s,%s\" % (self.interface, self.neg, self.maxRX, self.maxTX, self.RX, self.TX)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L211_C1", "label": "__init__", "type": "function", "loc": [211, 214], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L210_C0", "vector": [2, 1, 0.4885, 0.0092, 1, 0.13, 0.0, 555, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "interface", "neg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __init__(self, interface, neg):\n\t\tself.interface = interface\n\t\tself.neg = neg\n\t\tself.getRingParams()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L212_C2", "label": "self.interface =", "type": "assigned_variable", "loc": [212, 212], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L211_C1", "vector": [14, 2, 0.4874, 0.0023, 2, 0.99, 0.0, 140, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.interface", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.interface = interface"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L213_C2", "label": "self.neg =", "type": "assigned_variable", "loc": [213, 213], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L211_C1", "vector": [14, 2, 0.4897, 0.0023, 2, 0.99, 0.5, 11, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.neg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.neg = neg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L214_C2", "label": "getRingParams()", "type": "expression", "loc": [214, 214], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L211_C1", "vector": [8, 2, 0.492, 0.0023, 2, 0.99, 1.0, 29, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "getRingParams", "arg_names": [], "import_names": [], "rhs_call_name": "getRingParams", "annotation": ""}, "snippet": "\t\tself.getRingParams()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L216_C1", "label": "__repr__", "type": "function", "loc": [216, 217], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L210_C0", "vector": [2, 1, 0.4977, 0.0046, 1, 0.13, 0.5, 204, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "__repr__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __repr__(self):\n\t\treturn \"%s,%s,%s,%s,%s,%s\" % (self.interface, self.neg, self.maxRX, self.maxTX, self.RX, self.TX)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Return_L217_C2", "label": "return", "type": "return", "loc": [217, 217], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L216_C1", "vector": [13, 2, 0.4989, 0.0023, 2, 0.43, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn \"%s,%s,%s,%s,%s,%s\" % (self.interface, self.neg, self.maxRX, self.maxTX, self.RX, self.TX)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L219_C1", "label": "getRingParams", "type": "function", "loc": [219, 233], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L210_C0", "vector": [2, 1, 0.5195, 0.0345, 1, 0.13, 1.0, 29, 0, 1, 0, 0, 0, 0, 11], "semantic": {"name": "getRingParams", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef getRingParams(self):\n\t\tdata = commands.getstatusoutput('ethtool -g %s' % self.interface)[1]\n\t\tdata = data.split('\\n')\n\t\tp = re.compile(r\"([\\w\\s+]+):([^\\d]+)(?P<val>\\d+)\")\n\t\tm = p.match(data[2])\n\t\tself.maxRX = m.group(3)\n\t\t\n\t\tm = p.match(data[5])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L220_C2", "label": "data =", "type": "assigned_variable", "loc": [220, 220], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L219_C1", "vector": [14, 2, 0.5057, 0.0023, 2, 0.53, 0.0, 929, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tdata = commands.getstatusoutput('ethtool -g %s' % self.interface)[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L221_C2", "label": "data = split()", "type": "assigned_variable", "loc": [221, 221], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L219_C1", "vector": [14, 2, 0.508, 0.0023, 2, 0.53, 0.1, 929, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": "\t\tdata = data.split('\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L222_C2", "label": "p = compile()", "type": "assigned_variable", "loc": [222, 222], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L219_C1", "vector": [14, 2, 0.5103, 0.0023, 2, 0.53, 0.2, 491, 3, 1, 0, 0, 821, 10, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": "\t\tp = re.compile(r\"([\\w\\s+]+):([^\\d]+)(?P<val>\\d+)\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L223_C2", "label": "m = match()", "type": "assigned_variable", "loc": [223, 223], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L219_C1", "vector": [14, 2, 0.5126, 0.0023, 2, 0.53, 0.3, 711, 3, 1, 0, 0, 36, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "match", "annotation": ""}, "snippet": "\t\tm = p.match(data[2])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L224_C2", "label": "self.maxRX = group()", "type": "assigned_variable", "loc": [224, 224], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L219_C1", "vector": [14, 2, 0.5149, 0.0023, 2, 0.53, 0.4, 555, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "self.maxRX", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\tself.maxRX = m.group(3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L226_C2", "label": "m = match()", "type": "assigned_variable", "loc": [226, 226], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L219_C1", "vector": [14, 2, 0.5195, 0.0023, 2, 0.53, 0.5, 711, 3, 1, 0, 0, 36, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "match", "annotation": ""}, "snippet": "\t\tm = p.match(data[5])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L227_C2", "label": "self.maxTX = group()", "type": "assigned_variable", "loc": [227, 227], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L219_C1", "vector": [14, 2, 0.5218, 0.0023, 2, 0.53, 0.6, 867, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "self.maxTX", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\tself.maxTX = m.group(3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L229_C2", "label": "m = match()", "type": "assigned_variable", "loc": [229, 229], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L219_C1", "vector": [14, 2, 0.5264, 0.0023, 2, 0.53, 0.7, 711, 3, 1, 0, 0, 36, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "match", "annotation": ""}, "snippet": "\t\tm = p.match(data[7])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L230_C2", "label": "self.RX = group()", "type": "assigned_variable", "loc": [230, 230], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L219_C1", "vector": [14, 2, 0.5287, 0.0023, 2, 0.53, 0.8, 979, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "self.RX", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\tself.RX = m.group(3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L232_C2", "label": "m = match()", "type": "assigned_variable", "loc": [232, 232], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L219_C1", "vector": [14, 2, 0.5333, 0.0023, 2, 0.53, 0.9, 711, 3, 1, 0, 0, 36, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "match", "annotation": ""}, "snippet": "\t\tm = p.match(data[10])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L233_C2", "label": "self.TX = group()", "type": "assigned_variable", "loc": [233, 233], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L219_C1", "vector": [14, 2, 0.5356, 0.0023, 2, 0.53, 1.0, 186, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "self.TX", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\tself.TX = m.group(3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L236_C0", "label": "networkInfo", "type": "class", "loc": [236, 253], "level": 0, "parent": null, "vector": [3, 0, 0.5621, 0.0414, 0, 0.66, 0.68, 40, 0, 2, 0, 0, 0, 0, 9], "semantic": {"name": "networkInfo", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class networkInfo():\n\tdef __init__(self):\n\t\tself.cards = []\n\t\tself.checkInfo()\n\t\t\n\tdef checkInfo(self):\n\t\t\"\"\"Parse Mii-tool and ethtool info\"\"\"\n\t\tdata = commands.getstatusoutput('mii-tool')[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L237_C1", "label": "__init__", "type": "function", "loc": [237, 239], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L236_C0", "vector": [2, 1, 0.5471, 0.0069, 1, 0.4, 0.0, 555, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __init__(self):\n\t\tself.cards = []\n\t\tself.checkInfo()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L238_C2", "label": "self.cards =", "type": "assigned_variable", "loc": [238, 238], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L237_C1", "vector": [14, 2, 0.5471, 0.0023, 2, 0.36, 0.0, 387, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.cards", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.cards = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L239_C2", "label": "checkInfo()", "type": "expression", "loc": [239, 239], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L237_C1", "vector": [8, 2, 0.5494, 0.0023, 2, 0.36, 1.0, 369, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "checkInfo", "arg_names": [], "import_names": [], "rhs_call_name": "checkInfo", "annotation": ""}, "snippet": "\t\tself.checkInfo()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L241_C1", "label": "checkInfo", "type": "function", "loc": [241, 253], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L236_C0", "vector": [2, 1, 0.5678, 0.0299, 1, 0.4, 1.0, 369, 0, 1, 0, 0, 0, 0, 8], "semantic": {"name": "checkInfo", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef checkInfo(self):\n\t\t\"\"\"Parse Mii-tool and ethtool info\"\"\"\n\t\tdata = commands.getstatusoutput('mii-tool')[1]\n\t\tdata = data.split('\\n')\n\t\t#eth0: negotiated 100baseTx-FD, link ok\n\t\tp = re.compile(r\"(?P<in>[\\d\\w]+): negotiated (?P<vel>[\\d\\.]+).*\")\n\t\tfor d in data:\n\t\t\tm = p.match(d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L242_C2", "label": "expression", "type": "expression", "loc": [242, 242], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L241_C1", "vector": [8, 2, 0.5563, 0.0023, 2, 0.08, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\"\"\"Parse Mii-tool and ethtool info\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L243_C2", "label": "data =", "type": "assigned_variable", "loc": [243, 243], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L241_C1", "vector": [14, 2, 0.5586, 0.0023, 2, 0.08, 0.25, 929, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tdata = commands.getstatusoutput('mii-tool')[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L244_C2", "label": "data = split()", "type": "assigned_variable", "loc": [244, 244], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L241_C1", "vector": [14, 2, 0.5609, 0.0023, 2, 0.08, 0.5, 929, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": "\t\tdata = data.split('\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L246_C2", "label": "p = compile()", "type": "assigned_variable", "loc": [246, 246], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L241_C1", "vector": [14, 2, 0.5655, 0.0023, 2, 0.08, 0.75, 491, 3, 1, 0, 0, 821, 10, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": "\t\tp = re.compile(r\"(?P<in>[\\d\\w]+): negotiated (?P<vel>[\\d\\.]+).*\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L247_C2", "label": "for d", "type": "for", "loc": [247, 253], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L241_C1", "vector": [6, 2, 0.5747, 0.0161, 2, 0.08, 1.0, 355, 2, 0, 0, 0, 0, 0, 5], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor d in data:\n\t\t\tm = p.match(d)\n\t\t\tif (m):\n\t\t\t\tinterface = m.group(1)\n\t\t\t\tneg = m.group(2)\n\t\t\t\tcard = networkCard(interface, neg)\n\t\t\t\tself.cards.append(card)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L248_C3", "label": "m = match()", "type": "assigned_variable", "loc": [248, 248], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L247_C2", "vector": [14, 3, 0.5701, 0.0023, 3, 0.75, 0.0, 711, 3, 1, 0, 0, 36, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "match", "annotation": ""}, "snippet": "\t\t\tm = p.match(d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L249_C3", "label": "if", "type": "if", "loc": [249, 253], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L247_C2", "vector": [4, 3, 0.577, 0.0115, 3, 0.75, 1.0, 0, 2, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif (m):\n\t\t\t\tinterface = m.group(1)\n\t\t\t\tneg = m.group(2)\n\t\t\t\tcard = networkCard(interface, neg)\n\t\t\t\tself.cards.append(card)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L250_C4", "label": "interface = group()", "type": "assigned_variable", "loc": [250, 250], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L249_C3", "vector": [14, 4, 0.5747, 0.0023, 4, 0.23, 0.0, 396, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "interface", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\t\t\tinterface = m.group(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L251_C4", "label": "neg = group()", "type": "assigned_variable", "loc": [251, 251], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L249_C3", "vector": [14, 4, 0.577, 0.0023, 4, 0.23, 0.3333, 801, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "neg", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\t\t\tneg = m.group(2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L252_C4", "label": "card = networkCard()", "type": "assigned_variable", "loc": [252, 252], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L249_C3", "vector": [14, 4, 0.5793, 0.0023, 4, 0.23, 0.6667, 447, 3, 2, 0, 0, 44, 10, 1], "semantic": {"name": "card", "arg_names": [], "import_names": [], "rhs_call_name": "networkCard", "annotation": ""}, "snippet": "\t\t\t\tcard = networkCard(interface, neg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L253_C4", "label": "append()", "type": "expression", "loc": [253, 253], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L249_C3", "vector": [8, 4, 0.5816, 0.0023, 4, 0.23, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": "\t\t\t\tself.cards.append(card)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L255_C0", "label": "pkt", "type": "class", "loc": [255, 262], "level": 0, "parent": null, "vector": [3, 0, 0.5943, 0.0184, 0, 0.66, 0.72, 180, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "pkt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class pkt():\n\tdef __init__(self, name, version, desc):\n\t\tself.name = name\n\t\tself.version = version\n\t\tself.desc = desc\n\n\tdef __repr__(self):\n\t\treturn \"%s,%s,%s\" % (self.name, self.version, self.desc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L256_C1", "label": "__init__", "type": "function", "loc": [256, 259], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L255_C0", "vector": [2, 1, 0.592, 0.0092, 1, 0.38, 0.0, 555, 0, 4, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "name", "version", "desc"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __init__(self, name, version, desc):\n\t\tself.name = name\n\t\tself.version = version\n\t\tself.desc = desc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L257_C2", "label": "self.name =", "type": "assigned_variable", "loc": [257, 257], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L256_C1", "vector": [14, 2, 0.5908, 0.0023, 2, 0.71, 0.0, 689, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.name = name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L258_C2", "label": "self.version =", "type": "assigned_variable", "loc": [258, 258], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L256_C1", "vector": [14, 2, 0.5931, 0.0023, 2, 0.71, 0.5, 686, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.version", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.version = version"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L259_C2", "label": "self.desc =", "type": "assigned_variable", "loc": [259, 259], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L256_C1", "vector": [14, 2, 0.5954, 0.0023, 2, 0.71, 1.0, 843, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.desc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.desc = desc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L261_C1", "label": "__repr__", "type": "function", "loc": [261, 262], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L255_C0", "vector": [2, 1, 0.6011, 0.0046, 1, 0.38, 1.0, 204, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "__repr__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __repr__(self):\n\t\treturn \"%s,%s,%s\" % (self.name, self.version, self.desc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Return_L262_C2", "label": "return", "type": "return", "loc": [262, 262], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L261_C1", "vector": [13, 2, 0.6023, 0.0023, 2, 0.89, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn \"%s,%s,%s\" % (self.name, self.version, self.desc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L264_C0", "label": "packageInfo", "type": "class", "loc": [264, 280], "level": 0, "parent": null, "vector": [3, 0, 0.6253, 0.0391, 0, 0.66, 0.76, 470, 0, 2, 0, 0, 0, 0, 10], "semantic": {"name": "packageInfo", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class packageInfo():\n\tdef __init__(self):\n\t\tself.packages = []\n\t\tself.checkInfo()\n\t\t\n\tdef checkInfo(self):\n\t\tdata = commands.getstatusoutput('dpkg -l')[1]\n\t\tdata = data.split('\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L265_C1", "label": "__init__", "type": "function", "loc": [265, 267], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L264_C0", "vector": [2, 1, 0.6115, 0.0069, 1, 0.24, 0.0, 555, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __init__(self):\n\t\tself.packages = []\n\t\tself.checkInfo()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L266_C2", "label": "self.packages =", "type": "assigned_variable", "loc": [266, 266], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L265_C1", "vector": [14, 2, 0.6115, 0.0023, 2, 0.95, 0.0, 473, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.packages", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.packages = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L267_C2", "label": "checkInfo()", "type": "expression", "loc": [267, 267], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L265_C1", "vector": [8, 2, 0.6138, 0.0023, 2, 0.95, 1.0, 369, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "checkInfo", "arg_names": [], "import_names": [], "rhs_call_name": "checkInfo", "annotation": ""}, "snippet": "\t\tself.checkInfo()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L269_C1", "label": "checkInfo", "type": "function", "loc": [269, 280], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L264_C0", "vector": [2, 1, 0.631, 0.0276, 1, 0.24, 1.0, 369, 0, 1, 0, 0, 0, 0, 9], "semantic": {"name": "checkInfo", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef checkInfo(self):\n\t\tdata = commands.getstatusoutput('dpkg -l')[1]\n\t\tdata = data.split('\\n')\n\t\tp = re.compile(r\".. (?P<name>\\S+)\\s+(?P<ver>\\S+)\\s+(?P<desc>.*)\")\n\t\tfor d in data:\n\t\t\tm = p.match(d)\n\t\t\tif m:\n\t\t\t\tname = m.group(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L270_C2", "label": "data =", "type": "assigned_variable", "loc": [270, 270], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L269_C1", "vector": [14, 2, 0.6207, 0.0023, 2, 0.3, 0.0, 929, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tdata = commands.getstatusoutput('dpkg -l')[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L271_C2", "label": "data = split()", "type": "assigned_variable", "loc": [271, 271], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L269_C1", "vector": [14, 2, 0.623, 0.0023, 2, 0.3, 0.3333, 929, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": "\t\tdata = data.split('\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L272_C2", "label": "p = compile()", "type": "assigned_variable", "loc": [272, 272], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L269_C1", "vector": [14, 2, 0.6253, 0.0023, 2, 0.3, 0.6667, 491, 3, 1, 0, 0, 821, 10, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": "\t\tp = re.compile(r\".. (?P<name>\\S+)\\s+(?P<ver>\\S+)\\s+(?P<desc>.*)\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L273_C2", "label": "for d", "type": "for", "loc": [273, 280], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L269_C1", "vector": [6, 2, 0.6356, 0.0184, 2, 0.3, 1.0, 355, 2, 0, 0, 0, 0, 0, 6], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor d in data:\n\t\t\tm = p.match(d)\n\t\t\tif m:\n\t\t\t\tname = m.group(1)\n\t\t\t\tversion = m.group(2)\n\t\t\t\tdesc = m.group(3)\n\t\t\t\tpk = pkt(name, version, desc)\n\t\t\t\tself.packages.append(pk)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L274_C3", "label": "m = match()", "type": "assigned_variable", "loc": [274, 274], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L273_C2", "vector": [14, 3, 0.6299, 0.0023, 3, 0.55, 0.0, 711, 3, 1, 0, 0, 36, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "match", "annotation": ""}, "snippet": "\t\t\tm = p.match(d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L275_C3", "label": "if", "type": "if", "loc": [275, 280], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L273_C2", "vector": [4, 3, 0.6379, 0.0138, 3, 0.55, 1.0, 0, 2, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif m:\n\t\t\t\tname = m.group(1)\n\t\t\t\tversion = m.group(2)\n\t\t\t\tdesc = m.group(3)\n\t\t\t\tpk = pkt(name, version, desc)\n\t\t\t\tself.packages.append(pk)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L276_C4", "label": "name = group()", "type": "assigned_variable", "loc": [276, 276], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L275_C3", "vector": [14, 4, 0.6345, 0.0023, 4, 0.44, 0.0, 57, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\t\t\tname = m.group(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L277_C4", "label": "version = group()", "type": "assigned_variable", "loc": [277, 277], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L275_C3", "vector": [14, 4, 0.6368, 0.0023, 4, 0.44, 0.25, 623, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "version", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\t\t\tversion = m.group(2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L278_C4", "label": "desc = group()", "type": "assigned_variable", "loc": [278, 278], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L275_C3", "vector": [14, 4, 0.6391, 0.0023, 4, 0.44, 0.5, 796, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "desc", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\t\t\tdesc = m.group(3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L279_C4", "label": "pk = pkt()", "type": "assigned_variable", "loc": [279, 279], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L275_C3", "vector": [14, 4, 0.6414, 0.0023, 4, 0.44, 0.75, 164, 3, 3, 0, 0, 180, 10, 1], "semantic": {"name": "pk", "arg_names": [], "import_names": [], "rhs_call_name": "pkt", "annotation": ""}, "snippet": "\t\t\t\tpk = pkt(name, version, desc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L280_C4", "label": "append()", "type": "expression", "loc": [280, 280], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L275_C3", "vector": [8, 4, 0.6437, 0.0023, 4, 0.44, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": "\t\t\t\tself.packages.append(pk)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L282_C0", "label": "pfringInfo", "type": "class", "loc": [282, 313], "level": 0, "parent": null, "vector": [3, 0, 0.6839, 0.0736, 0, 0.66, 0.8, 527, 0, 2, 0, 0, 0, 0, 21], "semantic": {"name": "pfringInfo", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class pfringInfo():\n\tdef __init__(self):\n\t\tself.checkInfo()\n\t\t\n\tdef checkInfo(self):\n\t\tdata = commands.getstatusoutput('cat /proc/net/pf_ring/info')[1]\n\t\tdata = data.split('\\n')\n\t\tif len(data) == 8:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L283_C1", "label": "__init__", "type": "function", "loc": [283, 284], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L282_C0", "vector": [2, 1, 0.6517, 0.0046, 1, 0.2, 0.0, 555, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __init__(self):\n\t\tself.checkInfo()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L284_C2", "label": "checkInfo()", "type": "expression", "loc": [284, 284], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L283_C1", "vector": [8, 2, 0.6529, 0.0023, 2, 0.37, 0.0, 369, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "checkInfo", "arg_names": [], "import_names": [], "rhs_call_name": "checkInfo", "annotation": ""}, "snippet": "\t\tself.checkInfo()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L286_C1", "label": "checkInfo", "type": "function", "loc": [286, 313], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L282_C0", "vector": [2, 1, 0.6885, 0.0644, 1, 0.2, 1.0, 369, 0, 1, 0, 0, 0, 0, 20], "semantic": {"name": "checkInfo", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef checkInfo(self):\n\t\tdata = commands.getstatusoutput('cat /proc/net/pf_ring/info')[1]\n\t\tdata = data.split('\\n')\n\t\tif len(data) == 8:\n\t\t\tp = re.compile(r\"[^:]+: (?P<val>.*)\")\n\t\t\tm = p.match(data[0])\n\t\t\tself.version = m.group(1)\n\t\t\t\t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L287_C2", "label": "data =", "type": "assigned_variable", "loc": [287, 287], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L286_C1", "vector": [14, 2, 0.6598, 0.0023, 2, 0.02, 0.0, 929, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tdata = commands.getstatusoutput('cat /proc/net/pf_ring/info')[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L288_C2", "label": "data = split()", "type": "assigned_variable", "loc": [288, 288], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L286_C1", "vector": [14, 2, 0.6621, 0.0023, 2, 0.02, 0.5, 929, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": "\t\tdata = data.split('\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L289_C2", "label": "if", "type": "if", "loc": [289, 313], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L286_C1", "vector": [4, 2, 0.692, 0.0575, 2, 0.02, 1.0, 0, 0, 0, 0, 0, 0, 0, 18], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif len(data) == 8:\n\t\t\tp = re.compile(r\"[^:]+: (?P<val>.*)\")\n\t\t\tm = p.match(data[0])\n\t\t\tself.version = m.group(1)\n\t\t\t\t\n\t\t\tm = p.match(data[1])\n\t\t\tself.slots = m.group(1)\n\t\t\t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L290_C3", "label": "p = compile()", "type": "assigned_variable", "loc": [290, 290], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L289_C2", "vector": [14, 3, 0.6667, 0.0023, 3, 0.6, 0.0, 491, 3, 1, 0, 0, 821, 10, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": "\t\t\tp = re.compile(r\"[^:]+: (?P<val>.*)\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L291_C3", "label": "m = match()", "type": "assigned_variable", "loc": [291, 291], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L289_C2", "vector": [14, 3, 0.669, 0.0023, 3, 0.6, 0.0625, 711, 3, 1, 0, 0, 36, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "match", "annotation": ""}, "snippet": "\t\t\tm = p.match(data[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L292_C3", "label": "self.version = group()", "type": "assigned_variable", "loc": [292, 292], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L289_C2", "vector": [14, 3, 0.6713, 0.0023, 3, 0.6, 0.125, 686, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "self.version", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\t\tself.version = m.group(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L294_C3", "label": "m = match()", "type": "assigned_variable", "loc": [294, 294], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L289_C2", "vector": [14, 3, 0.6759, 0.0023, 3, 0.6, 0.1875, 711, 3, 1, 0, 0, 36, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "match", "annotation": ""}, "snippet": "\t\t\tm = p.match(data[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L295_C3", "label": "self.slots = group()", "type": "assigned_variable", "loc": [295, 295], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L289_C2", "vector": [14, 3, 0.6782, 0.0023, 3, 0.6, 0.25, 377, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "self.slots", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\t\tself.slots = m.group(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L297_C3", "label": "m = match()", "type": "assigned_variable", "loc": [297, 297], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L289_C2", "vector": [14, 3, 0.6828, 0.0023, 3, 0.6, 0.3125, 711, 3, 1, 0, 0, 36, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "match", "annotation": ""}, "snippet": "\t\t\tm = p.match(data[2])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L298_C3", "label": "self.sVersion = group()", "type": "assigned_variable", "loc": [298, 298], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L289_C2", "vector": [14, 3, 0.6851, 0.0023, 3, 0.6, 0.375, 973, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "self.sVersion", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\t\tself.sVersion = m.group(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L300_C3", "label": "m = match()", "type": "assigned_variable", "loc": [300, 300], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L289_C2", "vector": [14, 3, 0.6897, 0.0023, 3, 0.6, 0.4375, 711, 3, 1, 0, 0, 36, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "match", "annotation": ""}, "snippet": "\t\t\tm = p.match(data[3])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L301_C3", "label": "self.cTX = group()", "type": "assigned_variable", "loc": [301, 301], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L289_C2", "vector": [14, 3, 0.692, 0.0023, 3, 0.6, 0.5, 366, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "self.cTX", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\t\tself.cTX = m.group(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L303_C3", "label": "m = match()", "type": "assigned_variable", "loc": [303, 303], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L289_C2", "vector": [14, 3, 0.6966, 0.0023, 3, 0.6, 0.5625, 711, 3, 1, 0, 0, 36, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "match", "annotation": ""}, "snippet": "\t\t\tm = p.match(data[4])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L304_C3", "label": "self.defrag = group()", "type": "assigned_variable", "loc": [304, 304], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L289_C2", "vector": [14, 3, 0.6989, 0.0023, 3, 0.6, 0.625, 659, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "self.defrag", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\t\tself.defrag = m.group(1)\t\t\t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L306_C3", "label": "m = match()", "type": "assigned_variable", "loc": [306, 306], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L289_C2", "vector": [14, 3, 0.7034, 0.0023, 3, 0.6, 0.6875, 711, 3, 1, 0, 0, 36, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "match", "annotation": ""}, "snippet": "\t\t\tm = p.match(data[5])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L307_C3", "label": "self.transparentMode = group()", "type": "assigned_variable", "loc": [307, 307], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L289_C2", "vector": [14, 3, 0.7057, 0.0023, 3, 0.6, 0.75, 832, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "self.transparentMode", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\t\tself.transparentMode = m.group(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L309_C3", "label": "m = match()", "type": "assigned_variable", "loc": [309, 309], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L289_C2", "vector": [14, 3, 0.7103, 0.0023, 3, 0.6, 0.8125, 711, 3, 1, 0, 0, 36, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "match", "annotation": ""}, "snippet": "\t\t\tm = p.match(data[6])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L310_C3", "label": "self.rings = group()", "type": "assigned_variable", "loc": [310, 310], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L289_C2", "vector": [14, 3, 0.7126, 0.0023, 3, 0.6, 0.875, 992, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "self.rings", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\t\tself.rings = m.group(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L312_C3", "label": "m = match()", "type": "assigned_variable", "loc": [312, 312], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L289_C2", "vector": [14, 3, 0.7172, 0.0023, 3, 0.6, 0.9375, 711, 3, 1, 0, 0, 36, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "match", "annotation": ""}, "snippet": "\t\t\tm = p.match(data[7])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L313_C3", "label": "self.plugins = group()", "type": "assigned_variable", "loc": [313, 313], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L289_C2", "vector": [14, 3, 0.7195, 0.0023, 3, 0.6, 1.0, 424, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "self.plugins", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\t\tself.plugins = m.group(1)\t\t\t\t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L316_C0", "label": "kParam", "type": "class", "loc": [316, 319], "level": 0, "parent": null, "vector": [3, 0, 0.7299, 0.0092, 0, 0.66, 0.84, 731, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "kParam", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class kParam():\n\tdef __init__(self, name, val):\n\t\tself.name = name\n\t\tself.val = val"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L317_C1", "label": "__init__", "type": "function", "loc": [317, 319], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L316_C0", "vector": [2, 1, 0.731, 0.0069, 1, 0.67, 0.0, 555, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "name", "val"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __init__(self, name, val):\n\t\tself.name = name\n\t\tself.val = val"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L318_C2", "label": "self.name =", "type": "assigned_variable", "loc": [318, 318], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L317_C1", "vector": [14, 2, 0.731, 0.0023, 2, 0.51, 0.0, 689, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.name = name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L319_C2", "label": "self.val =", "type": "assigned_variable", "loc": [319, 319], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L317_C1", "vector": [14, 2, 0.7333, 0.0023, 2, 0.51, 1.0, 305, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.val", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.val = val"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L321_C0", "label": "kernelInfo", "type": "class", "loc": [321, 337], "level": 0, "parent": null, "vector": [3, 0, 0.7563, 0.0391, 0, 0.66, 0.88, 251, 0, 2, 0, 0, 0, 0, 9], "semantic": {"name": "kernelInfo", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class kernelInfo():\n\tdef __init__(self):\n\t\tself.parametes = []\n\t\tself.version = ''\n\t\tself.checkInfo()\n\t\t\n\tdef checkInfo(self):\n\t\tdata = commands.getstatusoutput('sysctl -a')[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L322_C1", "label": "__init__", "type": "function", "loc": [322, 325], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L321_C0", "vector": [2, 1, 0.7437, 0.0092, 1, 0.16, 0.0, 555, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __init__(self):\n\t\tself.parametes = []\n\t\tself.version = ''\n\t\tself.checkInfo()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L323_C2", "label": "self.parametes =", "type": "assigned_variable", "loc": [323, 323], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L322_C1", "vector": [14, 2, 0.7425, 0.0023, 2, 0.41, 0.0, 125, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.parametes", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.parametes = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L324_C2", "label": "self.version =", "type": "assigned_variable", "loc": [324, 324], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L322_C1", "vector": [14, 2, 0.7448, 0.0023, 2, 0.41, 0.5, 686, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.version", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.version = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L325_C2", "label": "checkInfo()", "type": "expression", "loc": [325, 325], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L322_C1", "vector": [8, 2, 0.7471, 0.0023, 2, 0.41, 1.0, 369, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "checkInfo", "arg_names": [], "import_names": [], "rhs_call_name": "checkInfo", "annotation": ""}, "snippet": "\t\tself.checkInfo()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L327_C1", "label": "checkInfo", "type": "function", "loc": [327, 337], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L321_C0", "vector": [2, 1, 0.7632, 0.0253, 1, 0.16, 1.0, 369, 0, 1, 0, 0, 0, 0, 8], "semantic": {"name": "checkInfo", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef checkInfo(self):\n\t\tdata = commands.getstatusoutput('sysctl -a')[1]\n\t\tdata = data.split('\\n')\n\t\tp = re.compile(r\"(?P<name>[^\\s]+)\\s=\\s(?P<val>.*)\")\n\t\tfor d in data:\n\t\t\tm = p.match(d)\n\t\t\tif m:\n\t\t\t\tname = m.group(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L328_C2", "label": "data =", "type": "assigned_variable", "loc": [328, 328], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L327_C1", "vector": [14, 2, 0.754, 0.0023, 2, 0.56, 0.0, 929, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tdata = commands.getstatusoutput('sysctl -a')[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L329_C2", "label": "data = split()", "type": "assigned_variable", "loc": [329, 329], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L327_C1", "vector": [14, 2, 0.7563, 0.0023, 2, 0.56, 0.3333, 929, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": "\t\tdata = data.split('\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L330_C2", "label": "p = compile()", "type": "assigned_variable", "loc": [330, 330], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L327_C1", "vector": [14, 2, 0.7586, 0.0023, 2, 0.56, 0.6667, 491, 3, 1, 0, 0, 821, 10, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": "\t\tp = re.compile(r\"(?P<name>[^\\s]+)\\s=\\s(?P<val>.*)\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L331_C2", "label": "for d", "type": "for", "loc": [331, 337], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L327_C1", "vector": [6, 2, 0.7678, 0.0161, 2, 0.56, 1.0, 355, 2, 0, 0, 0, 0, 0, 5], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor d in data:\n\t\t\tm = p.match(d)\n\t\t\tif m:\n\t\t\t\tname = m.group(1)\n\t\t\t\tval = m.group(2)\n\t\t\t\tkP = kParam(name, val)\n\t\t\t\tself.parametes.append(kP)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L332_C3", "label": "m = match()", "type": "assigned_variable", "loc": [332, 332], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L331_C2", "vector": [14, 3, 0.7632, 0.0023, 3, 0.55, 0.0, 711, 3, 1, 0, 0, 36, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "match", "annotation": ""}, "snippet": "\t\t\tm = p.match(d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L333_C3", "label": "if", "type": "if", "loc": [333, 337], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L331_C2", "vector": [4, 3, 0.7701, 0.0115, 3, 0.55, 1.0, 0, 2, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif m:\n\t\t\t\tname = m.group(1)\n\t\t\t\tval = m.group(2)\n\t\t\t\tkP = kParam(name, val)\n\t\t\t\tself.parametes.append(kP)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L334_C4", "label": "name = group()", "type": "assigned_variable", "loc": [334, 334], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L333_C3", "vector": [14, 4, 0.7678, 0.0023, 4, 0.66, 0.0, 57, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\t\t\tname = m.group(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L335_C4", "label": "val = group()", "type": "assigned_variable", "loc": [335, 335], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L333_C3", "vector": [14, 4, 0.7701, 0.0023, 4, 0.66, 0.3333, 618, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "val", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\t\t\tval = m.group(2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L336_C4", "label": "kP = kParam()", "type": "assigned_variable", "loc": [336, 336], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L333_C3", "vector": [14, 4, 0.7724, 0.0023, 4, 0.66, 0.6667, 570, 3, 2, 0, 0, 731, 10, 1], "semantic": {"name": "kP", "arg_names": [], "import_names": [], "rhs_call_name": "kParam", "annotation": ""}, "snippet": "\t\t\t\tkP = kParam(name, val)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L337_C4", "label": "append()", "type": "expression", "loc": [337, 337], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L333_C3", "vector": [8, 4, 0.7747, 0.0023, 4, 0.66, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": "\t\t\t\tself.parametes.append(kP)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L339_C0", "label": "systemInfo", "type": "class", "loc": [339, 428], "level": 0, "parent": null, "vector": [3, 0, 0.8816, 0.2069, 0, 0.66, 0.92, 288, 0, 3, 0, 0, 0, 0, 49], "semantic": {"name": "systemInfo", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class systemInfo():\n\tdef __init__(self):\n\t\tself.disk = diskInfo()\n\t\tself.mem = memInfo()\n\t\tself.cpu = cpuInfo()\n\t\tself.pci = pciInfo()\n\t\tself.network = networkInfo()\n\t\tself.packages = packageInfo()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L340_C1", "label": "__init__", "type": "function", "loc": [340, 348], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L339_C0", "vector": [2, 1, 0.7908, 0.0207, 1, 0.9, 0.0, 555, 0, 1, 0, 0, 0, 0, 8], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __init__(self):\n\t\tself.disk = diskInfo()\n\t\tself.mem = memInfo()\n\t\tself.cpu = cpuInfo()\n\t\tself.pci = pciInfo()\n\t\tself.network = networkInfo()\n\t\tself.packages = packageInfo()\n\t\tself.pfring = pfringInfo()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L341_C2", "label": "self.disk = diskInfo()", "type": "assigned_variable", "loc": [341, 341], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L340_C1", "vector": [14, 2, 0.7839, 0.0023, 2, 0.14, 0.0, 81, 3, 0, 0, 0, 28, 10, 1], "semantic": {"name": "self.disk", "arg_names": [], "import_names": [], "rhs_call_name": "diskInfo", "annotation": ""}, "snippet": "\t\tself.disk = diskInfo()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L342_C2", "label": "self.mem = memInfo()", "type": "assigned_variable", "loc": [342, 342], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L340_C1", "vector": [14, 2, 0.7862, 0.0023, 2, 0.14, 0.1429, 725, 3, 0, 0, 0, 661, 10, 1], "semantic": {"name": "self.mem", "arg_names": [], "import_names": [], "rhs_call_name": "memInfo", "annotation": ""}, "snippet": "\t\tself.mem = memInfo()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L343_C2", "label": "self.cpu = cpuInfo()", "type": "assigned_variable", "loc": [343, 343], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L340_C1", "vector": [14, 2, 0.7885, 0.0023, 2, 0.14, 0.2857, 289, 3, 0, 0, 0, 934, 10, 1], "semantic": {"name": "self.cpu", "arg_names": [], "import_names": [], "rhs_call_name": "cpuInfo", "annotation": ""}, "snippet": "\t\tself.cpu = cpuInfo()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L344_C2", "label": "self.pci = pciInfo()", "type": "assigned_variable", "loc": [344, 344], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L340_C1", "vector": [14, 2, 0.7908, 0.0023, 2, 0.14, 0.4286, 714, 3, 0, 0, 0, 477, 10, 1], "semantic": {"name": "self.pci", "arg_names": [], "import_names": [], "rhs_call_name": "pciInfo", "annotation": ""}, "snippet": "\t\tself.pci = pciInfo()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L345_C2", "label": "self.network = networkInfo()", "type": "assigned_variable", "loc": [345, 345], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L340_C1", "vector": [14, 2, 0.7931, 0.0023, 2, 0.14, 0.5714, 703, 3, 0, 0, 0, 40, 10, 1], "semantic": {"name": "self.network", "arg_names": [], "import_names": [], "rhs_call_name": "networkInfo", "annotation": ""}, "snippet": "\t\tself.network = networkInfo()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L346_C2", "label": "self.packages = packageInfo()", "type": "assigned_variable", "loc": [346, 346], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L340_C1", "vector": [14, 2, 0.7954, 0.0023, 2, 0.14, 0.7143, 473, 3, 0, 0, 0, 470, 10, 1], "semantic": {"name": "self.packages", "arg_names": [], "import_names": [], "rhs_call_name": "packageInfo", "annotation": ""}, "snippet": "\t\tself.packages = packageInfo()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L347_C2", "label": "self.pfring = pfringInfo()", "type": "assigned_variable", "loc": [347, 347], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L340_C1", "vector": [14, 2, 0.7977, 0.0023, 2, 0.14, 0.8571, 460, 3, 0, 0, 0, 527, 10, 1], "semantic": {"name": "self.pfring", "arg_names": [], "import_names": [], "rhs_call_name": "pfringInfo", "annotation": ""}, "snippet": "\t\tself.pfring = pfringInfo()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L348_C2", "label": "self.kernel = kernelInfo()", "type": "assigned_variable", "loc": [348, 348], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L340_C1", "vector": [14, 2, 0.8, 0.0023, 2, 0.14, 1.0, 883, 3, 0, 0, 0, 251, 10, 1], "semantic": {"name": "self.kernel", "arg_names": [], "import_names": [], "rhs_call_name": "kernelInfo", "annotation": ""}, "snippet": "\t\tself.kernel = kernelInfo()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L350_C1", "label": "xmlOut", "type": "function", "loc": [350, 425], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L339_C0", "vector": [2, 1, 0.8908, 0.1747, 1, 0.9, 0.5, 747, 0, 2, 0, 0, 0, 0, 41], "semantic": {"name": "xmlOut", "arg_names": ["self", "fileName"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef xmlOut(self, fileName):\n\t\txmlStr = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>' \\\n\t\t '<system></system>'\n\t\tx = XMLFile(raw=xmlStr)\n\t\tsystem = x.root\n\t\t\n\t\t#CPU\n\t\txcp = system._addNode(\"cpuInfo\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L351_C2", "label": "xmlStr =", "type": "assigned_variable", "loc": [351, 352], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L350_C1", "vector": [14, 2, 0.808, 0.0046, 2, 0.88, 0.0, 453, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "xmlStr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\txmlStr = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>' \\\n\t\t '<system></system>'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L353_C2", "label": "x = XMLFile()", "type": "assigned_variable", "loc": [353, 353], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L350_C1", "vector": [14, 2, 0.8115, 0.0023, 2, 0.88, 0.0476, 190, 3, 1, 0, 0, 539, 10, 1], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "XMLFile", "annotation": ""}, "snippet": "\t\tx = XMLFile(raw=xmlStr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L354_C2", "label": "system =", "type": "assigned_variable", "loc": [354, 354], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L350_C1", "vector": [14, 2, 0.8138, 0.0023, 2, 0.88, 0.0952, 856, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "system", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tsystem = x.root"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L357_C2", "label": "xcp = _addNode()", "type": "assigned_variable", "loc": [357, 357], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L350_C1", "vector": [14, 2, 0.8207, 0.0023, 2, 0.88, 0.1429, 730, 3, 1, 0, 0, 843, 10, 1], "semantic": {"name": "xcp", "arg_names": [], "import_names": [], "rhs_call_name": "_addNode", "annotation": ""}, "snippet": "\t\txcp = system._addNode(\"cpuInfo\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L358_C2", "label": "for c", "type": "for", "loc": [358, 363], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L350_C1", "vector": [6, 2, 0.8287, 0.0138, 2, 0.88, 0.1905, 411, 7, 0, 0, 0, 0, 0, 4], "semantic": {"name": "c", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor c in self.cpu.cpus:\n\t\t\txc = xcp._addNode(\"cpu\")\n\t\t\tfor att in dir(c):\n\t\t\t\tif att[0] != '_':\n\t\t\t\t\texec(\"xc.%s = c.%s\" % (att, att))\n\t\t\txcp._addNode(xc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L359_C3", "label": "xc = _addNode()", "type": "assigned_variable", "loc": [359, 359], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L358_C2", "vector": [14, 3, 0.8253, 0.0023, 3, 0.86, 0.0, 132, 3, 1, 0, 0, 843, 10, 1], "semantic": {"name": "xc", "arg_names": [], "import_names": [], "rhs_call_name": "_addNode", "annotation": ""}, "snippet": "\t\t\txc = xcp._addNode(\"cpu\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L360_C3", "label": "for att", "type": "for", "loc": [360, 362], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L358_C2", "vector": [6, 3, 0.8299, 0.0069, 3, 0.86, 0.5, 734, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "att", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tfor att in dir(c):\n\t\t\t\tif att[0] != '_':\n\t\t\t\t\texec(\"xc.%s = c.%s\" % (att, att))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L361_C4", "label": "if", "type": "if", "loc": [361, 362], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L360_C3", "vector": [4, 4, 0.831, 0.0046, 4, 0.97, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tif att[0] != '_':\n\t\t\t\t\texec(\"xc.%s = c.%s\" % (att, att))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L362_C5", "label": "exec()", "type": "expression", "loc": [362, 362], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L361_C4", "vector": [8, 5, 0.8322, 0.0023, 5, 0.79, 0.0, 272, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "exec", "arg_names": [], "import_names": [], "rhs_call_name": "exec", "annotation": ""}, "snippet": "\t\t\t\t\texec(\"xc.%s = c.%s\" % (att, att))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L363_C3", "label": "_addNode()", "type": "expression", "loc": [363, 363], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L358_C2", "vector": [8, 3, 0.8345, 0.0023, 3, 0.86, 1.0, 843, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_addNode", "arg_names": [], "import_names": [], "rhs_call_name": "_addNode", "annotation": ""}, "snippet": "\t\t\txcp._addNode(xc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L366_C2", "label": "xme = _addNode()", "type": "assigned_variable", "loc": [366, 366], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L350_C1", "vector": [14, 2, 0.8414, 0.0023, 2, 0.88, 0.2381, 754, 3, 1, 0, 0, 843, 10, 1], "semantic": {"name": "xme", "arg_names": [], "import_names": [], "rhs_call_name": "_addNode", "annotation": ""}, "snippet": "\t\txme = system._addNode(\"memInfo\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L367_C2", "label": "for att", "type": "for", "loc": [367, 369], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L350_C1", "vector": [6, 2, 0.846, 0.0069, 2, 0.88, 0.2857, 734, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "att", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor att in dir(self.mem):\n\t\t\tif att[0] != '_' and att != \"checkInfo\":\n\t\t\t\texec(\"xme.%s = self.mem.%s\" % (att, att))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L368_C3", "label": "if", "type": "if", "loc": [368, 369], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L367_C2", "vector": [4, 3, 0.8471, 0.0046, 3, 0.33, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif att[0] != '_' and att != \"checkInfo\":\n\t\t\t\texec(\"xme.%s = self.mem.%s\" % (att, att))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L369_C4", "label": "exec()", "type": "expression", "loc": [369, 369], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L368_C3", "vector": [8, 4, 0.8483, 0.0023, 4, 0.45, 0.0, 272, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "exec", "arg_names": [], "import_names": [], "rhs_call_name": "exec", "annotation": ""}, "snippet": "\t\t\t\texec(\"xme.%s = self.mem.%s\" % (att, att))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L372_C2", "label": "xdi = _addNode()", "type": "assigned_variable", "loc": [372, 372], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L350_C1", "vector": [14, 2, 0.8552, 0.0023, 2, 0.88, 0.3333, 11, 3, 1, 0, 0, 843, 10, 1], "semantic": {"name": "xdi", "arg_names": [], "import_names": [], "rhs_call_name": "_addNode", "annotation": ""}, "snippet": "\t\txdi = system._addNode(\"diskInfo\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L373_C2", "label": "for d", "type": "for", "loc": [373, 378], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L350_C1", "vector": [6, 2, 0.8632, 0.0138, 2, 0.88, 0.381, 355, 7, 0, 0, 0, 0, 0, 4], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor d in self.disk.disks:\n\t\t\txdis = xdi._addNode(\"disk\")\n\t\t\tfor att in dir(d):\n\t\t\t\tif att[0] != '_' and att != \"timeRead\":\n\t\t\t\t\texec(\"xdis.%s = d.%s\" % (att, att))\n\t\t\t\txdi._addNode(xdis)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L374_C3", "label": "xdis = _addNode()", "type": "assigned_variable", "loc": [374, 374], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L373_C2", "vector": [14, 3, 0.8598, 0.0023, 3, 0.66, 0.0, 695, 3, 1, 0, 0, 843, 10, 1], "semantic": {"name": "xdis", "arg_names": [], "import_names": [], "rhs_call_name": "_addNode", "annotation": ""}, "snippet": "\t\t\txdis = xdi._addNode(\"disk\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L375_C3", "label": "for att", "type": "for", "loc": [375, 378], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L373_C2", "vector": [6, 3, 0.8655, 0.0092, 3, 0.66, 1.0, 734, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "att", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tfor att in dir(d):\n\t\t\t\tif att[0] != '_' and att != \"timeRead\":\n\t\t\t\t\texec(\"xdis.%s = d.%s\" % (att, att))\n\t\t\t\txdi._addNode(xdis)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L376_C4", "label": "if", "type": "if", "loc": [376, 377], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L375_C3", "vector": [4, 4, 0.8655, 0.0046, 4, 0.54, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tif att[0] != '_' and att != \"timeRead\":\n\t\t\t\t\texec(\"xdis.%s = d.%s\" % (att, att))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L377_C5", "label": "exec()", "type": "expression", "loc": [377, 377], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L376_C4", "vector": [8, 5, 0.8667, 0.0023, 5, 0.61, 0.0, 272, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "exec", "arg_names": [], "import_names": [], "rhs_call_name": "exec", "annotation": ""}, "snippet": "\t\t\t\t\texec(\"xdis.%s = d.%s\" % (att, att))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L378_C4", "label": "_addNode()", "type": "expression", "loc": [378, 378], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L375_C3", "vector": [8, 4, 0.869, 0.0023, 4, 0.54, 1.0, 843, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_addNode", "arg_names": [], "import_names": [], "rhs_call_name": "_addNode", "annotation": ""}, "snippet": "\t\t\t\txdi._addNode(xdis)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L381_C2", "label": "xpci = _addNode()", "type": "assigned_variable", "loc": [381, 381], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L350_C1", "vector": [14, 2, 0.8759, 0.0023, 2, 0.88, 0.4286, 646, 3, 1, 0, 0, 843, 10, 1], "semantic": {"name": "xpci", "arg_names": [], "import_names": [], "rhs_call_name": "_addNode", "annotation": ""}, "snippet": "\t\txpci = system._addNode(\"pciInfo\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L382_C2", "label": "for m", "type": "for", "loc": [382, 387], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L350_C1", "vector": [6, 2, 0.8839, 0.0138, 2, 0.88, 0.4762, 711, 7, 0, 0, 0, 0, 0, 4], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor m in self.pci.devices:\n\t\t\txp = xpci._addNode(\"pciModule\")\n\t\t\tfor att in dir(m):\n\t\t\t\tif att[0] != '_':\n\t\t\t\t\texec(\"xp.%s = m.%s\" % (att, att))\n\t\t\txpci._addNode(xp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L383_C3", "label": "xp = _addNode()", "type": "assigned_variable", "loc": [383, 383], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L382_C2", "vector": [14, 3, 0.8805, 0.0023, 3, 0.74, 0.0, 575, 3, 1, 0, 0, 843, 10, 1], "semantic": {"name": "xp", "arg_names": [], "import_names": [], "rhs_call_name": "_addNode", "annotation": ""}, "snippet": "\t\t\txp = xpci._addNode(\"pciModule\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L384_C3", "label": "for att", "type": "for", "loc": [384, 386], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L382_C2", "vector": [6, 3, 0.8851, 0.0069, 3, 0.74, 0.5, 734, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "att", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tfor att in dir(m):\n\t\t\t\tif att[0] != '_':\n\t\t\t\t\texec(\"xp.%s = m.%s\" % (att, att))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L385_C4", "label": "if", "type": "if", "loc": [385, 386], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L384_C3", "vector": [4, 4, 0.8862, 0.0046, 4, 0.85, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tif att[0] != '_':\n\t\t\t\t\texec(\"xp.%s = m.%s\" % (att, att))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L386_C5", "label": "exec()", "type": "expression", "loc": [386, 386], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L385_C4", "vector": [8, 5, 0.8874, 0.0023, 5, 0.19, 0.0, 272, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "exec", "arg_names": [], "import_names": [], "rhs_call_name": "exec", "annotation": ""}, "snippet": "\t\t\t\t\texec(\"xp.%s = m.%s\" % (att, att))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L387_C3", "label": "_addNode()", "type": "expression", "loc": [387, 387], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L382_C2", "vector": [8, 3, 0.8897, 0.0023, 3, 0.74, 1.0, 843, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_addNode", "arg_names": [], "import_names": [], "rhs_call_name": "_addNode", "annotation": ""}, "snippet": "\t\t\txpci._addNode(xp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L390_C2", "label": "xpac = _addNode()", "type": "assigned_variable", "loc": [390, 390], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L350_C1", "vector": [14, 2, 0.8966, 0.0023, 2, 0.88, 0.5238, 663, 3, 1, 0, 0, 843, 10, 1], "semantic": {"name": "xpac", "arg_names": [], "import_names": [], "rhs_call_name": "_addNode", "annotation": ""}, "snippet": "\t\txpac = system._addNode(\"packages\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L391_C2", "label": "for p", "type": "for", "loc": [391, 396], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L350_C1", "vector": [6, 2, 0.9046, 0.0138, 2, 0.88, 0.5714, 491, 7, 0, 0, 0, 0, 0, 4], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor p in self.packages.packages:\n\t\t\txpa = xpac._addNode(\"package\")\n\t\t\tfor att in dir(p):\n\t\t\t\tif att[0] != '_':\n\t\t\t\t\texec(\"xpa.%s = p.%s\" % (att,att))\n\t\t\txpac._addNode(xpa)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L392_C3", "label": "xpa = _addNode()", "type": "assigned_variable", "loc": [392, 392], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L391_C2", "vector": [14, 3, 0.9011, 0.0023, 3, 0.07, 0.0, 578, 3, 1, 0, 0, 843, 10, 1], "semantic": {"name": "xpa", "arg_names": [], "import_names": [], "rhs_call_name": "_addNode", "annotation": ""}, "snippet": "\t\t\txpa = xpac._addNode(\"package\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L393_C3", "label": "for att", "type": "for", "loc": [393, 395], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L391_C2", "vector": [6, 3, 0.9057, 0.0069, 3, 0.07, 0.5, 734, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "att", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tfor att in dir(p):\n\t\t\t\tif att[0] != '_':\n\t\t\t\t\texec(\"xpa.%s = p.%s\" % (att,att))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L394_C4", "label": "if", "type": "if", "loc": [394, 395], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L393_C3", "vector": [4, 4, 0.9069, 0.0046, 4, 0.48, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tif att[0] != '_':\n\t\t\t\t\texec(\"xpa.%s = p.%s\" % (att,att))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L395_C5", "label": "exec()", "type": "expression", "loc": [395, 395], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L394_C4", "vector": [8, 5, 0.908, 0.0023, 5, 0.89, 0.0, 272, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "exec", "arg_names": [], "import_names": [], "rhs_call_name": "exec", "annotation": ""}, "snippet": "\t\t\t\t\texec(\"xpa.%s = p.%s\" % (att,att))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L396_C3", "label": "_addNode()", "type": "expression", "loc": [396, 396], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L391_C2", "vector": [8, 3, 0.9103, 0.0023, 3, 0.07, 1.0, 843, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_addNode", "arg_names": [], "import_names": [], "rhs_call_name": "_addNode", "annotation": ""}, "snippet": "\t\t\txpac._addNode(xpa)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L399_C2", "label": "xker = _addNode()", "type": "assigned_variable", "loc": [399, 399], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L350_C1", "vector": [14, 2, 0.9172, 0.0023, 2, 0.88, 0.619, 617, 3, 1, 0, 0, 843, 10, 1], "semantic": {"name": "xker", "arg_names": [], "import_names": [], "rhs_call_name": "_addNode", "annotation": ""}, "snippet": "\t\txker = system._addNode(\"kernel\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L400_C2", "label": "for k", "type": "for", "loc": [400, 405], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L350_C1", "vector": [6, 2, 0.9253, 0.0138, 2, 0.88, 0.6667, 954, 7, 0, 0, 0, 0, 0, 4], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor k in self.kernel.parametes:\n\t\t\txke = xker._addNode(\"parameter\")\n\t\t\tfor att in dir(k):\n\t\t\t\tif att[0] != '_':\n\t\t\t\t\texec(\"xke.%s = k.%s\" % (att, att))\n\t\t\txker._addNode(xke)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L401_C3", "label": "xke = _addNode()", "type": "assigned_variable", "loc": [401, 401], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L400_C2", "vector": [14, 3, 0.9218, 0.0023, 3, 0.32, 0.0, 56, 3, 1, 0, 0, 843, 10, 1], "semantic": {"name": "xke", "arg_names": [], "import_names": [], "rhs_call_name": "_addNode", "annotation": ""}, "snippet": "\t\t\txke = xker._addNode(\"parameter\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L402_C3", "label": "for att", "type": "for", "loc": [402, 404], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L400_C2", "vector": [6, 3, 0.9264, 0.0069, 3, 0.32, 0.5, 734, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "att", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tfor att in dir(k):\n\t\t\t\tif att[0] != '_':\n\t\t\t\t\texec(\"xke.%s = k.%s\" % (att, att))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L403_C4", "label": "if", "type": "if", "loc": [403, 404], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L402_C3", "vector": [4, 4, 0.9276, 0.0046, 4, 0.85, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tif att[0] != '_':\n\t\t\t\t\texec(\"xke.%s = k.%s\" % (att, att))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L404_C5", "label": "exec()", "type": "expression", "loc": [404, 404], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L403_C4", "vector": [8, 5, 0.9287, 0.0023, 5, 0.66, 0.0, 272, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "exec", "arg_names": [], "import_names": [], "rhs_call_name": "exec", "annotation": ""}, "snippet": "\t\t\t\t\texec(\"xke.%s = k.%s\" % (att, att))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L405_C3", "label": "_addNode()", "type": "expression", "loc": [405, 405], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L400_C2", "vector": [8, 3, 0.931, 0.0023, 3, 0.32, 1.0, 843, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_addNode", "arg_names": [], "import_names": [], "rhs_call_name": "_addNode", "annotation": ""}, "snippet": "\t\t\txker._addNode(xke)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L408_C2", "label": "xpfr = _addNode()", "type": "assigned_variable", "loc": [408, 408], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L350_C1", "vector": [14, 2, 0.9379, 0.0023, 2, 0.88, 0.7143, 591, 3, 1, 0, 0, 843, 10, 1], "semantic": {"name": "xpfr", "arg_names": [], "import_names": [], "rhs_call_name": "_addNode", "annotation": ""}, "snippet": "\t\txpfr = system._addNode(\"pfring\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L409_C2", "label": "for att", "type": "for", "loc": [409, 411], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L350_C1", "vector": [6, 2, 0.9425, 0.0069, 2, 0.88, 0.7619, 734, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "att", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor att in dir(self.pfring):\n\t\t\tif att[0] != '_' and att != \"checkInfo\":\n\t\t\t\texec(\"xpfr.%s = self.pfring.%s\" % (att, att))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L410_C3", "label": "if", "type": "if", "loc": [410, 411], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L409_C2", "vector": [4, 3, 0.9437, 0.0046, 3, 0.71, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif att[0] != '_' and att != \"checkInfo\":\n\t\t\t\texec(\"xpfr.%s = self.pfring.%s\" % (att, att))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L411_C4", "label": "exec()", "type": "expression", "loc": [411, 411], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L410_C3", "vector": [8, 4, 0.9448, 0.0023, 4, 0.53, 0.0, 272, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "exec", "arg_names": [], "import_names": [], "rhs_call_name": "exec", "annotation": ""}, "snippet": "\t\t\t\texec(\"xpfr.%s = self.pfring.%s\" % (att, att))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L414_C2", "label": "xnet = _addNode()", "type": "assigned_variable", "loc": [414, 414], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L350_C1", "vector": [14, 2, 0.9517, 0.0023, 2, 0.88, 0.8095, 985, 3, 1, 0, 0, 843, 10, 1], "semantic": {"name": "xnet", "arg_names": [], "import_names": [], "rhs_call_name": "_addNode", "annotation": ""}, "snippet": "\t\txnet = system._addNode(\"network\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L415_C2", "label": "for nc", "type": "for", "loc": [415, 420], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L350_C1", "vector": [6, 2, 0.9598, 0.0138, 2, 0.88, 0.8571, 692, 7, 0, 0, 0, 0, 0, 4], "semantic": {"name": "nc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor nc in self.network.cards:\n\t\t\txn = xnet._addNode(\"card\")\n\t\t\tfor att in dir(nc):\n\t\t\t\tif att[0] != '_' and att != \"getRingParams\":\n\t\t\t\t\texec(\"xn.%s = nc.%s\" % (att,att))\n\t\t\txnet._addNode(xn)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L416_C3", "label": "xn = _addNode()", "type": "assigned_variable", "loc": [416, 416], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L415_C2", "vector": [14, 3, 0.9563, 0.0023, 3, 0.75, 0.0, 39, 3, 1, 0, 0, 843, 10, 1], "semantic": {"name": "xn", "arg_names": [], "import_names": [], "rhs_call_name": "_addNode", "annotation": ""}, "snippet": "\t\t\txn = xnet._addNode(\"card\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L417_C3", "label": "for att", "type": "for", "loc": [417, 419], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L415_C2", "vector": [6, 3, 0.9609, 0.0069, 3, 0.75, 0.5, 734, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "att", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tfor att in dir(nc):\n\t\t\t\tif att[0] != '_' and att != \"getRingParams\":\n\t\t\t\t\texec(\"xn.%s = nc.%s\" % (att,att))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L418_C4", "label": "if", "type": "if", "loc": [418, 419], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L417_C3", "vector": [4, 4, 0.9621, 0.0046, 4, 0.58, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tif att[0] != '_' and att != \"getRingParams\":\n\t\t\t\t\texec(\"xn.%s = nc.%s\" % (att,att))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L419_C5", "label": "exec()", "type": "expression", "loc": [419, 419], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L418_C4", "vector": [8, 5, 0.9632, 0.0023, 5, 0.35, 0.0, 272, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "exec", "arg_names": [], "import_names": [], "rhs_call_name": "exec", "annotation": ""}, "snippet": "\t\t\t\t\texec(\"xn.%s = nc.%s\" % (att,att))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L420_C3", "label": "_addNode()", "type": "expression", "loc": [420, 420], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L415_C2", "vector": [8, 3, 0.9655, 0.0023, 3, 0.75, 1.0, 843, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_addNode", "arg_names": [], "import_names": [], "rhs_call_name": "_addNode", "annotation": ""}, "snippet": "\t\t\txnet._addNode(xn)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L423_C2", "label": "f = open()", "type": "assigned_variable", "loc": [423, 423], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L350_C1", "vector": [14, 2, 0.9724, 0.0023, 2, 0.88, 0.9048, 899, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": "\t\tf = open(fileName, 'w')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L424_C2", "label": "write()", "type": "expression", "loc": [424, 424], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L350_C1", "vector": [8, 2, 0.9747, 0.0023, 2, 0.88, 0.9524, 837, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": "\t\tf.write(x.toxml())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L425_C2", "label": "close()", "type": "expression", "loc": [425, 425], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L350_C1", "vector": [8, 2, 0.977, 0.0023, 2, 0.88, 1.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": "\t\tf.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L427_C1", "label": "applyXSLT", "type": "function", "loc": [427, 428], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L339_C0", "vector": [2, 1, 0.9828, 0.0046, 1, 0.9, 1.0, 872, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "applyXSLT", "arg_names": ["self", "fileName"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef applyXSLT(self, fileName):\n\t\tpass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L430_C0", "label": "main", "type": "function", "loc": [430, 432], "level": 0, "parent": null, "vector": [2, 0, 0.9908, 0.0069, 0, 0.66, 0.96, 624, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "main", "arg_names": ["argv"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def main(argv=None):\n\ts = systemInfo()\n\ts.xmlOut(\"results.xml\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L431_C1", "label": "s = systemInfo()", "type": "assigned_variable", "loc": [431, 431], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L430_C0", "vector": [14, 1, 0.9908, 0.0023, 1, 0.72, 0.0, 553, 3, 0, 0, 0, 288, 10, 1], "semantic": {"name": "s", "arg_names": [], "import_names": [], "rhs_call_name": "systemInfo", "annotation": ""}, "snippet": "\ts = systemInfo()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L432_C1", "label": "xmlOut()", "type": "expression", "loc": [432, 432], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L430_C0", "vector": [8, 1, 0.9931, 0.0023, 1, 0.72, 1.0, 747, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "xmlOut", "arg_names": [], "import_names": [], "rhs_call_name": "xmlOut", "annotation": ""}, "snippet": "\ts.xmlOut(\"results.xml\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L434_C0", "label": "if", "type": "if", "loc": [434, 435], "level": 0, "parent": null, "vector": [4, 0, 0.9989, 0.0046, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == \"__main__\":\n\tsys.exit(main())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L435_C1", "label": "exit()", "type": "expression", "loc": [435, 435], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L434_C0", "vector": [8, 1, 1.0, 0.0023, 1, 0.79, 0.0, 436, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "exit", "arg_names": [], "import_names": [], "rhs_call_name": "exit", "annotation": ""}, "snippet": "\tsys.exit(main())"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L55_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L55_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L56_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L55_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L57_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L55_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L58_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L60_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L60_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L61_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L60_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L62_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L60_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L63_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L60_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L65_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L60_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L66_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L66_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L67_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L66_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L68_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L68_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Return_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L60_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Return_L70_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L73_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L73_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L74_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L73_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L75_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L77_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L77_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L78_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L77_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L79_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L77_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L81_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L77_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L82_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L82_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L83_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L82_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L84_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L84_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L85_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L84_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L86_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L84_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L87_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L84_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L88_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L90_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L91_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L91_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L92_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L91_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L93_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L91_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L94_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L91_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L95_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L91_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L96_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L90_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L98_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L98_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L99_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L98_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L100_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L98_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L101_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L98_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L102_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L98_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L103_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L98_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L104_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L98_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L105_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L105_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L106_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L105_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L107_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L107_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L108_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L105_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L109_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L105_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L110_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L110_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L111_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L105_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L112_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L105_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L113_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L113_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L114_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L105_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L115_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L105_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L116_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L116_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L117_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L119_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L120_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L120_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L121_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L120_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L122_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L120_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L123_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L120_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L124_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L120_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L125_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L119_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L127_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L127_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Return_L128_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L119_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L129_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L139_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L140_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L140_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L141_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L140_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L142_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L139_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L144_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L144_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L145_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L144_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L146_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L144_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L147_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L147_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L148_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L139_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L150_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L150_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L151_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L150_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L152_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L150_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L153_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L150_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L154_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L150_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L156_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L150_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L157_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L150_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L158_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L150_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L160_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L150_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L161_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L150_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L162_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L150_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L164_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L150_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L165_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L150_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L166_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L150_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L168_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L150_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L169_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L150_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L170_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L150_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L172_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L150_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L174_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L176_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L177_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L177_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L178_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L177_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L179_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L177_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L180_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L177_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L181_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L177_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L182_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L177_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L183_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L176_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L185_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L185_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Return_L186_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L188_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L189_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L189_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L190_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L189_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L191_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L188_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L193_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L193_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L194_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L193_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L195_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L193_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L196_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L193_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L199_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L199_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L200_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L199_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L201_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L199_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L202_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L199_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L203_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L199_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L204_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L199_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L205_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L199_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L206_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L199_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L207_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L199_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L208_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L210_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L211_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L211_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L212_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L211_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L213_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L211_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L214_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L210_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L216_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L216_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Return_L217_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L210_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L219_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L219_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L220_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L219_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L221_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L219_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L222_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L219_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L223_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L219_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L224_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L219_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L226_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L219_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L227_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L219_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L229_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L219_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L230_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L219_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L232_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L219_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L233_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L236_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L237_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L237_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L238_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L237_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L239_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L236_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L241_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L241_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L242_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L241_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L243_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L241_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L244_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L241_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L246_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L241_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L247_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L247_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L248_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L247_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L249_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L249_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L250_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L249_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L251_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L249_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L252_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L249_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L253_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L255_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L256_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L256_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L257_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L256_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L258_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L256_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L259_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L255_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L261_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L261_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Return_L262_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L264_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L265_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L265_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L266_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L265_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L267_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L264_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L269_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L269_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L270_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L269_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L271_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L269_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L272_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L269_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L273_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L273_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L274_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L273_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L275_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L275_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L276_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L275_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L277_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L275_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L278_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L275_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L279_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L275_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L280_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L282_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L283_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L283_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L284_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L282_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L286_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L286_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L287_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L286_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L288_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L286_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L289_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L289_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L290_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L289_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L291_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L289_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L292_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L289_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L294_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L289_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L295_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L289_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L297_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L289_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L298_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L289_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L300_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L289_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L301_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L289_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L303_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L289_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L304_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L289_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L306_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L289_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L307_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L289_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L309_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L289_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L310_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L289_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L312_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L289_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L313_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L316_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L317_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L317_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L318_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L317_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L319_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L321_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L322_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L322_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L323_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L322_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L324_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L322_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L325_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L321_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L327_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L327_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L328_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L327_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L329_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L327_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L330_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L327_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L331_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L331_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L332_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L331_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L333_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L333_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L334_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L333_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L335_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L333_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L336_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L333_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L337_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L339_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L340_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L340_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L341_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L340_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L342_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L340_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L343_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L340_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L344_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L340_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L345_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L340_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L346_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L340_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L347_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L340_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L348_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L339_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L350_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L350_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L351_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L350_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L353_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L350_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L354_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L350_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L357_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L350_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L358_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L358_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L359_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L358_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L360_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L360_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L361_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L361_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L362_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L358_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L363_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L350_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L366_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L350_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L367_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L367_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L368_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L368_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L369_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L350_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L372_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L350_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L373_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L373_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L374_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L373_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L375_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L375_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L376_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L376_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L377_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L375_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L378_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L350_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L381_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L350_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L382_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L382_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L383_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L382_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L384_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L384_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L385_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L385_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L386_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L382_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L387_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L350_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L390_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L350_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L391_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L391_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L392_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L391_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L393_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L393_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L394_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L394_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L395_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L391_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L396_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L350_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L399_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L350_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L400_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L400_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L401_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L400_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L402_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L402_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L403_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L403_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L404_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L400_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L405_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L350_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L408_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L350_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L409_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L409_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L410_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L410_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L411_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L350_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L414_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L350_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L415_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L415_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L416_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L415_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L417_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L417_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L418_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L418_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L419_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:For_L415_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L420_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L350_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L423_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L350_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L424_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L350_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L425_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:ClassDef_L339_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L427_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L430_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Assign_L431_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:FunctionDef_L430_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L432_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99990:If_L434_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99990:Expr_L435_C1"}] |
#!/usr/bin/env python
# encoding: utf-8
"""
Created by Jaime Blasco on 2009-09-15
Uploaed to Labs on 2011-09-26 <--- First contribution :P
License:
Copyright (c) 2009 AlienVault
All rights reserved.
This package is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 dated June, 1991.
You may not use, modify or distribute this program under any other version
of the GNU General Public License.
This package 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this package; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
MA 02110-1301 USA
On Debian GNU/Linux systems, the complete text of the GNU General
Public License can be found in `/usr/share/common-licenses/GPL-2'.
Otherwise you can read it here: http://www.gnu.org/licenses/gpl-2.0.txt
"""
import sys
import getopt
import fileinput
import commands
import re
from xmlobject import XMLFile
import libxml2
import libxslt
#Disks
#Memory
#CPU
#PCI devices
#tarjetas de red
#pfring
#Packages and versions
#Kernle parameters
class disk():
def __init__(self, id, size):
self.id = id
self.size = size
self.rVel = self.timeRead()
def timeRead(self):
print "Timing %s ..." % self.id
data = commands.getstatusoutput('hdparm -t /dev/%s' % self.id)[1]
data = data.split('\n')
# Timing buffered disk reads: 376 MB in 3.00 seconds = 125.18 MB/sec
p = re.compile(r".*= (?P<vel>[\d\.]+).*")
for d in data:
m = p.match(d)
if (m):
return float(m.group(1))
return None
class diskInfo():
def __init__(self):
self.disks = []
self.checkInfo()
def checkInfo(self):
data = commands.getstatusoutput('fdisk -l')[1]
data = data.split('\n')
#Disk /dev/sda: 73.4 GB, 73407488000 bytes
p = re.compile(r"Disk /dev/(?P<label>\S+):.*, (?P<cap>\d+)\sbytes.*")
for d in data:
m = p.match(d)
if (m):
label = m.group(1)
size = m.group(2)
di = disk(label, size)
self.disks.append(di)
class memInfo():
def __init__(self):
self.checkInfo()
self.memTotal = 0
self.memFree = 0
self.swapTotal = 0
self.swapFree = 0
def checkInfo(self):
data = commands.getstatusoutput('cat /proc/meminfo')[1]
data = data.split('\n')
p1 = re.compile(r"MemTotal:\s+(?P<mem>\d+)\skB.*")
p2 = re.compile(r"MemFree:\s+(?P<mem>\d+)\skB.*")
p3 = re.compile(r"SwapTotal:\s+(?P<mem>\d+)\skB.*")
p4 = re.compile(r"SwapFree:\s+(?P<mem>\d+)\skB.*")
for d in data:
m = p1.match(d)
if (m):
self.memTotal = m.group(1)
m = p2.match(d)
if (m):
self.memFree = m.group(1)
m = p3.match(d)
if (m):
self.swapTotal = m.group(1)
m = p4.match(d)
if (m):
self.swapFree = m.group(1)
class cpu():
def __init__(self, id, vendor_id, cpu_family, model_id, model_name):
self.id = id
self.vendor_id = vendor_id
self.cpu_family = cpu_family
self.model_id = model_id
self.model_name = model_name
def __repr__(self):
return "%s,%s,%s,%s,%s" % (self.id, self.vendor_id, self.cpu_family, self.model_id, self.model_name)
'''
def xml(self, dom):
cp = dom.createElement("cpu")
cp.id = self.id
cp.vendor_id = vendor_id
cp.cpu_family = cpu_family
cp.model_id = model_id
cp.model_name = model_name
return cp
'''
class cpuInfo():
def __init__(self):
self.cpus = []
self.checkInfo()
def checkInfo(self):
data = commands.getstatusoutput('cat /proc/cpuinfo')[1]
data = data.split('\n\n')
for d in data:
self.parseCpuData(d)
def parseCpuData(self, data):
data = data.split('\n')
p = re.compile(r"([\w\s+]+)\t: (?P<val>.*)")
m = p.match(data[0])
id = m.group(2)
p = re.compile(r"([\w\s+]+)\t: (?P<val>.*)")
m = p.match(data[1])
vendor_id = m.group(2)
p = re.compile(r"([\w\s+]+)\t: (?P<val>.*)")
m = p.match(data[2])
cpu_family = m.group(2)
p = re.compile(r"([\w\s+]+)\t: (?P<val>.*)")
m = p.match(data[3])
model_id = m.group(2)
p = re.compile(r"([\w\s+]+)\t: (?P<val>.*)")
m = p.match(data[4])
model_name = m.group(2)
cp = cpu(id, vendor_id, cpu_family, model_id, model_name)
#print cp
self.cpus.append(cp)
class pciDev():
def __init__(self, device, dClass, vendor, deviceName, sVendor, sDevice):
self.device = device
self.dClass = dClass
self.vendor = vendor
self.deviceName = deviceName
self.sVendor = sVendor
self.sDevice = sDevice
def __repr__(self):
return "%s,%s,%s,%s,%s,%s" % (self.device, self.dClass, self.vendor, self.deviceName, self.sVendor, self.sDevice)
class pciInfo():
def __init__(self):
self.devices = []
self.checkInfo()
def checkInfo(self):
"""Parse lspci info"""
data = commands.getstatusoutput('lspci -mm')[1]
data = data.split('\n')
#07:00.0 "Ethernet controller" "Intel Corporation" "80003ES2LAN Gigabit Ethernet Controller (Copper)" -r01 "ASUSTeK Computer Inc." "Device 8217"
#07:00.1 "Ethernet controller" "Intel Corporation" "80003ES2LAN Gigabit Ethernet Controller (Copper)" -r01 "ASUSTeK Computer Inc." "Device 8217"
for d in data:
d = d.split(' "')
device = d[0].replace('"', '')
dClass = d[1].replace('"', '')
vendor = d[2].replace('"', '')
deviceName = d[3].replace('"', '')
sVendor = d[4].replace('"', '')
sDevice = d[5].replace('"', '')
pDev = pciDev(device, dClass, vendor, deviceName, sVendor, sDevice)
self.devices.append(pDev)
class networkCard():
def __init__(self, interface, neg):
self.interface = interface
self.neg = neg
self.getRingParams()
def __repr__(self):
return "%s,%s,%s,%s,%s,%s" % (self.interface, self.neg, self.maxRX, self.maxTX, self.RX, self.TX)
def getRingParams(self):
data = commands.getstatusoutput('ethtool -g %s' % self.interface)[1]
data = data.split('\n')
p = re.compile(r"([\w\s+]+):([^\d]+)(?P<val>\d+)")
m = p.match(data[2])
self.maxRX = m.group(3)
m = p.match(data[5])
self.maxTX = m.group(3)
m = p.match(data[7])
self.RX = m.group(3)
m = p.match(data[10])
self.TX = m.group(3)
class networkInfo():
def __init__(self):
self.cards = []
self.checkInfo()
def checkInfo(self):
"""Parse Mii-tool and ethtool info"""
data = commands.getstatusoutput('mii-tool')[1]
data = data.split('\n')
#eth0: negotiated 100baseTx-FD, link ok
p = re.compile(r"(?P<in>[\d\w]+): negotiated (?P<vel>[\d\.]+).*")
for d in data:
m = p.match(d)
if (m):
interface = m.group(1)
neg = m.group(2)
card = networkCard(interface, neg)
self.cards.append(card)
class pkt():
def __init__(self, name, version, desc):
self.name = name
self.version = version
self.desc = desc
def __repr__(self):
return "%s,%s,%s" % (self.name, self.version, self.desc)
class packageInfo():
def __init__(self):
self.packages = []
self.checkInfo()
def checkInfo(self):
data = commands.getstatusoutput('dpkg -l')[1]
data = data.split('\n')
p = re.compile(r".. (?P<name>\S+)\s+(?P<ver>\S+)\s+(?P<desc>.*)")
for d in data:
m = p.match(d)
if m:
name = m.group(1)
version = m.group(2)
desc = m.group(3)
pk = pkt(name, version, desc)
self.packages.append(pk)
class pfringInfo():
def __init__(self):
self.checkInfo()
def checkInfo(self):
data = commands.getstatusoutput('cat /proc/net/pf_ring/info')[1]
data = data.split('\n')
if len(data) == 8:
p = re.compile(r"[^:]+: (?P<val>.*)")
m = p.match(data[0])
self.version = m.group(1)
m = p.match(data[1])
self.slots = m.group(1)
m = p.match(data[2])
self.sVersion = m.group(1)
m = p.match(data[3])
self.cTX = m.group(1)
m = p.match(data[4])
self.defrag = m.group(1)
m = p.match(data[5])
self.transparentMode = m.group(1)
m = p.match(data[6])
self.rings = m.group(1)
m = p.match(data[7])
self.plugins = m.group(1)
class kParam():
def __init__(self, name, val):
self.name = name
self.val = val
class kernelInfo():
def __init__(self):
self.parametes = []
self.version = ''
self.checkInfo()
def checkInfo(self):
data = commands.getstatusoutput('sysctl -a')[1]
data = data.split('\n')
p = re.compile(r"(?P<name>[^\s]+)\s=\s(?P<val>.*)")
for d in data:
m = p.match(d)
if m:
name = m.group(1)
val = m.group(2)
kP = kParam(name, val)
self.parametes.append(kP)
class systemInfo():
def __init__(self):
self.disk = diskInfo()
self.mem = memInfo()
self.cpu = cpuInfo()
self.pci = pciInfo()
self.network = networkInfo()
self.packages = packageInfo()
self.pfring = pfringInfo()
self.kernel = kernelInfo()
def xmlOut(self, fileName):
xmlStr = '<?xml version="1.0" encoding="UTF-8"?>' \
'<system></system>'
x = XMLFile(raw=xmlStr)
system = x.root
#CPU
xcp = system._addNode("cpuInfo")
for c in self.cpu.cpus:
xc = xcp._addNode("cpu")
for att in dir(c):
if att[0] != '_':
exec("xc.%s = c.%s" % (att, att))
xcp._addNode(xc)
#Memory
xme = system._addNode("memInfo")
for att in dir(self.mem):
if att[0] != '_' and att != "checkInfo":
exec("xme.%s = self.mem.%s" % (att, att))
#Disk
xdi = system._addNode("diskInfo")
for d in self.disk.disks:
xdis = xdi._addNode("disk")
for att in dir(d):
if att[0] != '_' and att != "timeRead":
exec("xdis.%s = d.%s" % (att, att))
xdi._addNode(xdis)
#PCI
xpci = system._addNode("pciInfo")
for m in self.pci.devices:
xp = xpci._addNode("pciModule")
for att in dir(m):
if att[0] != '_':
exec("xp.%s = m.%s" % (att, att))
xpci._addNode(xp)
#Packages
xpac = system._addNode("packages")
for p in self.packages.packages:
xpa = xpac._addNode("package")
for att in dir(p):
if att[0] != '_':
exec("xpa.%s = p.%s" % (att,att))
xpac._addNode(xpa)
#Kernel
xker = system._addNode("kernel")
for k in self.kernel.parametes:
xke = xker._addNode("parameter")
for att in dir(k):
if att[0] != '_':
exec("xke.%s = k.%s" % (att, att))
xker._addNode(xke)
#PFRING
xpfr = system._addNode("pfring")
for att in dir(self.pfring):
if att[0] != '_' and att != "checkInfo":
exec("xpfr.%s = self.pfring.%s" % (att, att))
#NETWORK
xnet = system._addNode("network")
for nc in self.network.cards:
xn = xnet._addNode("card")
for att in dir(nc):
if att[0] != '_' and att != "getRingParams":
exec("xn.%s = nc.%s" % (att,att))
xnet._addNode(xn)
#Write Results
f = open(fileName, 'w')
f.write(x.toxml())
f.close()
def applyXSLT(self, fileName):
pass
def main(argv=None):
s = systemInfo()
s.xmlOut("results.xml")
if __name__ == "__main__":
sys.exit(main())
| ajibawa-2023/Python-Code-Large/train/row_99991 | 307 | 435 | 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_99991:Expr_L4_C0", "label": "expression", "type": "expression", "loc": [4, 34], "level": 0, "parent": null, "vector": [8, 0, 0.0437, 0.0713, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\"\"\"\nCreated by Jaime Blasco on 2009-09-15\nUploaed to Labs on 2011-09-26 <--- First contribution :P\n\nLicense:\n\nCopyright (c) 2009 AlienVault\nAll rights reserved."}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Import_L36_C0", "label": "sys import sys", "type": "import", "loc": [36, 36], "level": 0, "parent": null, "vector": [1, 0, 0.0828, 0.0023, 0, 0.66, 0.04, 509, 0, 1, 0, 0, 509, 0, 0], "semantic": {"name": "sys", "arg_names": [], "import_names": ["sys"], "rhs_call_name": "", "annotation": ""}, "snippet": "import sys"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Import_L37_C0", "label": "getopt import getopt", "type": "import", "loc": [37, 37], "level": 0, "parent": null, "vector": [1, 0, 0.0851, 0.0023, 0, 0.66, 0.08, 588, 0, 1, 0, 0, 588, 0, 0], "semantic": {"name": "getopt", "arg_names": [], "import_names": ["getopt"], "rhs_call_name": "", "annotation": ""}, "snippet": "import getopt"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Import_L38_C0", "label": "fileinput import fileinput", "type": "import", "loc": [38, 38], "level": 0, "parent": null, "vector": [1, 0, 0.0874, 0.0023, 0, 0.66, 0.12, 286, 0, 1, 0, 0, 286, 0, 0], "semantic": {"name": "fileinput", "arg_names": [], "import_names": ["fileinput"], "rhs_call_name": "", "annotation": ""}, "snippet": "import fileinput"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Import_L39_C0", "label": "commands import commands", "type": "import", "loc": [39, 39], "level": 0, "parent": null, "vector": [1, 0, 0.0897, 0.0023, 0, 0.66, 0.16, 760, 0, 1, 0, 0, 760, 0, 0], "semantic": {"name": "commands", "arg_names": [], "import_names": ["commands"], "rhs_call_name": "", "annotation": ""}, "snippet": "import commands"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Import_L40_C0", "label": "re import re", "type": "import", "loc": [40, 40], "level": 0, "parent": null, "vector": [1, 0, 0.092, 0.0023, 0, 0.66, 0.2, 540, 0, 1, 0, 0, 540, 0, 0], "semantic": {"name": "re", "arg_names": [], "import_names": ["re"], "rhs_call_name": "", "annotation": ""}, "snippet": "import re"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:ImportFrom_L41_C0", "label": "from xmlobject import XMLFile", "type": "import", "loc": [41, 41], "level": 0, "parent": null, "vector": [1, 0, 0.0943, 0.0023, 0, 0.66, 0.24, 534, 0, 1, 0, 0, 534, 0, 0], "semantic": {"name": "xmlobject", "arg_names": [], "import_names": ["XMLFile"], "rhs_call_name": "", "annotation": ""}, "snippet": "from xmlobject import XMLFile"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Import_L42_C0", "label": "libxml2 import libxml2", "type": "import", "loc": [42, 42], "level": 0, "parent": null, "vector": [1, 0, 0.0966, 0.0023, 0, 0.66, 0.28, 256, 0, 1, 0, 0, 256, 0, 0], "semantic": {"name": "libxml2", "arg_names": [], "import_names": ["libxml2"], "rhs_call_name": "", "annotation": ""}, "snippet": "import libxml2"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Import_L43_C0", "label": "libxslt import libxslt", "type": "import", "loc": [43, 43], "level": 0, "parent": null, "vector": [1, 0, 0.0989, 0.0023, 0, 0.66, 0.32, 767, 0, 1, 0, 0, 767, 0, 0], "semantic": {"name": "libxslt", "arg_names": [], "import_names": ["libxslt"], "rhs_call_name": "", "annotation": ""}, "snippet": "import libxslt"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L54_C0", "label": "disk", "type": "class", "loc": [54, 70], "level": 0, "parent": null, "vector": [3, 0, 0.1425, 0.0391, 0, 0.66, 0.36, 3, 0, 2, 0, 0, 0, 0, 8], "semantic": {"name": "disk", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class disk():\n\tdef __init__(self, id, size):\n\t\tself.id = id\n\t\tself.size = size\n\t\tself.rVel = self.timeRead()\n\t\t\n\tdef timeRead(self):\n\t\tprint(\"Timing %s ...\" % self.id)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L55_C1", "label": "__init__", "type": "function", "loc": [55, 58], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L54_C0", "vector": [2, 1, 0.1299, 0.0092, 1, 0.51, 0.0, 555, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "id", "size"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __init__(self, id, size):\n\t\tself.id = id\n\t\tself.size = size\n\t\tself.rVel = self.timeRead()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L56_C2", "label": "self.id =", "type": "assigned_variable", "loc": [56, 56], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L55_C1", "vector": [14, 2, 0.1287, 0.0023, 2, 0.23, 0.0, 485, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.id = id"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L57_C2", "label": "self.size =", "type": "assigned_variable", "loc": [57, 57], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L55_C1", "vector": [14, 2, 0.131, 0.0023, 2, 0.23, 0.5, 183, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.size", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.size = size"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L58_C2", "label": "self.rVel = timeRead()", "type": "assigned_variable", "loc": [58, 58], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L55_C1", "vector": [14, 2, 0.1333, 0.0023, 2, 0.23, 1.0, 294, 3, 0, 0, 0, 719, 10, 1], "semantic": {"name": "self.rVel", "arg_names": [], "import_names": [], "rhs_call_name": "timeRead", "annotation": ""}, "snippet": "\t\tself.rVel = self.timeRead()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L60_C1", "label": "timeRead", "type": "function", "loc": [60, 70], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L54_C0", "vector": [2, 1, 0.1494, 0.0253, 1, 0.51, 1.0, 719, 0, 1, 1, 0, 0, 0, 7], "semantic": {"name": "timeRead", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef timeRead(self):\n\t\tprint(\"Timing %s ...\" % self.id)\n\t\tdata = commands.getstatusoutput('hdparm -t /dev/%s' % self.id)[1]\n\t\tdata = data.split('\\n')\n\t\t# Timing buffered disk reads: 376 MB in 3.00 seconds = 125.18 MB/sec\n\t\tp = re.compile(r\".*= (?P<vel>[\\d\\.]+).*\")\n\t\tfor d in data:\n\t\t\tm = p.match(d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L61_C2", "label": "print()", "type": "expression", "loc": [61, 61], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L60_C1", "vector": [8, 2, 0.1402, 0.0023, 2, 0.23, 0.0, 535, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "print", "arg_names": [], "import_names": [], "rhs_call_name": "print", "annotation": ""}, "snippet": "\t\tprint(\"Timing %s ...\" % self.id)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L62_C2", "label": "data =", "type": "assigned_variable", "loc": [62, 62], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L60_C1", "vector": [14, 2, 0.1425, 0.0023, 2, 0.23, 0.2, 929, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tdata = commands.getstatusoutput('hdparm -t /dev/%s' % self.id)[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L63_C2", "label": "data = split()", "type": "assigned_variable", "loc": [63, 63], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L60_C1", "vector": [14, 2, 0.1448, 0.0023, 2, 0.23, 0.4, 929, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": "\t\tdata = data.split('\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L65_C2", "label": "p = compile()", "type": "assigned_variable", "loc": [65, 65], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L60_C1", "vector": [14, 2, 0.1494, 0.0023, 2, 0.23, 0.6, 491, 3, 1, 0, 0, 821, 10, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": "\t\tp = re.compile(r\".*= (?P<vel>[\\d\\.]+).*\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L66_C2", "label": "for d", "type": "for", "loc": [66, 69], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L60_C1", "vector": [6, 2, 0.1552, 0.0092, 2, 0.23, 0.8, 355, 2, 0, 0, 0, 0, 0, 3], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor d in data:\n\t\t\tm = p.match(d)\n\t\t\tif (m):\n\t\t\t\treturn float(m.group(1))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L67_C3", "label": "m = match()", "type": "assigned_variable", "loc": [67, 67], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L66_C2", "vector": [14, 3, 0.154, 0.0023, 3, 0.9, 0.0, 711, 3, 1, 0, 0, 36, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "match", "annotation": ""}, "snippet": "\t\t\tm = p.match(d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L68_C3", "label": "if", "type": "if", "loc": [68, 69], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L66_C2", "vector": [4, 3, 0.1575, 0.0046, 3, 0.9, 1.0, 0, 2, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif (m):\n\t\t\t\treturn float(m.group(1))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Return_L69_C4", "label": "return", "type": "return", "loc": [69, 69], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L68_C3", "vector": [13, 4, 0.1586, 0.0023, 4, 0.74, 0.0, 0, 3, 0, 0, 0, 0, 10, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\treturn float(m.group(1))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Return_L70_C2", "label": "return", "type": "return", "loc": [70, 70], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L60_C1", "vector": [13, 2, 0.1609, 0.0023, 2, 0.23, 1.0, 0, 1, 0, 0, 0, 0, 9, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn None"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L72_C0", "label": "diskInfo", "type": "class", "loc": [72, 88], "level": 0, "parent": null, "vector": [3, 0, 0.1839, 0.0391, 0, 0.66, 0.4, 28, 0, 2, 0, 0, 0, 0, 9], "semantic": {"name": "diskInfo", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class diskInfo():\n\tdef __init__(self):\n\t\tself.disks = []\n\t\tself.checkInfo()\n\t\t\n\tdef checkInfo(self):\n\t\tdata = commands.getstatusoutput('fdisk -l')[1]\n\t\tdata = data.split('\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L73_C1", "label": "__init__", "type": "function", "loc": [73, 75], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L72_C0", "vector": [2, 1, 0.1701, 0.0069, 1, 0.33, 0.0, 555, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __init__(self):\n\t\tself.disks = []\n\t\tself.checkInfo()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L74_C2", "label": "self.disks =", "type": "assigned_variable", "loc": [74, 74], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L73_C1", "vector": [14, 2, 0.1701, 0.0023, 2, 0.3, 0.0, 186, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.disks", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.disks = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L75_C2", "label": "checkInfo()", "type": "expression", "loc": [75, 75], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L73_C1", "vector": [8, 2, 0.1724, 0.0023, 2, 0.3, 1.0, 369, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "checkInfo", "arg_names": [], "import_names": [], "rhs_call_name": "checkInfo", "annotation": ""}, "snippet": "\t\tself.checkInfo()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L77_C1", "label": "checkInfo", "type": "function", "loc": [77, 88], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L72_C0", "vector": [2, 1, 0.1897, 0.0276, 1, 0.33, 1.0, 369, 0, 1, 0, 0, 0, 0, 8], "semantic": {"name": "checkInfo", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef checkInfo(self):\n\t\tdata = commands.getstatusoutput('fdisk -l')[1]\n\t\tdata = data.split('\\n')\n\t\t#Disk /dev/sda: 73.4 GB, 73407488000 bytes\n\t\tp = re.compile(r\"Disk /dev/(?P<label>\\S+):.*, (?P<cap>\\d+)\\sbytes.*\")\n\t\tfor d in data:\n\t\t\tm = p.match(d)\n\t\t\tif (m):"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L78_C2", "label": "data =", "type": "assigned_variable", "loc": [78, 78], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L77_C1", "vector": [14, 2, 0.1793, 0.0023, 2, 0.66, 0.0, 929, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tdata = commands.getstatusoutput('fdisk -l')[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L79_C2", "label": "data = split()", "type": "assigned_variable", "loc": [79, 79], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L77_C1", "vector": [14, 2, 0.1816, 0.0023, 2, 0.66, 0.3333, 929, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": "\t\tdata = data.split('\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L81_C2", "label": "p = compile()", "type": "assigned_variable", "loc": [81, 81], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L77_C1", "vector": [14, 2, 0.1862, 0.0023, 2, 0.66, 0.6667, 491, 3, 1, 0, 0, 821, 10, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": "\t\tp = re.compile(r\"Disk /dev/(?P<label>\\S+):.*, (?P<cap>\\d+)\\sbytes.*\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L82_C2", "label": "for d", "type": "for", "loc": [82, 88], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L77_C1", "vector": [6, 2, 0.1954, 0.0161, 2, 0.66, 1.0, 355, 2, 0, 0, 0, 0, 0, 5], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor d in data:\n\t\t\tm = p.match(d)\n\t\t\tif (m):\n\t\t\t\tlabel = m.group(1)\n\t\t\t\tsize = m.group(2)\n\t\t\t\tdi = disk(label, size)\n\t\t\t\tself.disks.append(di)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L83_C3", "label": "m = match()", "type": "assigned_variable", "loc": [83, 83], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L82_C2", "vector": [14, 3, 0.1908, 0.0023, 3, 0.44, 0.0, 711, 3, 1, 0, 0, 36, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "match", "annotation": ""}, "snippet": "\t\t\tm = p.match(d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L84_C3", "label": "if", "type": "if", "loc": [84, 88], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L82_C2", "vector": [4, 3, 0.1977, 0.0115, 3, 0.44, 1.0, 0, 2, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif (m):\n\t\t\t\tlabel = m.group(1)\n\t\t\t\tsize = m.group(2)\n\t\t\t\tdi = disk(label, size)\n\t\t\t\tself.disks.append(di)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L85_C4", "label": "label = group()", "type": "assigned_variable", "loc": [85, 85], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L84_C3", "vector": [14, 4, 0.1954, 0.0023, 4, 0.04, 0.0, 811, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "label", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\t\t\tlabel = m.group(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L86_C4", "label": "size = group()", "type": "assigned_variable", "loc": [86, 86], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L84_C3", "vector": [14, 4, 0.1977, 0.0023, 4, 0.04, 0.3333, 714, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "size", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\t\t\tsize = m.group(2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L87_C4", "label": "di = disk()", "type": "assigned_variable", "loc": [87, 87], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L84_C3", "vector": [14, 4, 0.2, 0.0023, 4, 0.04, 0.6667, 700, 3, 2, 0, 0, 3, 10, 1], "semantic": {"name": "di", "arg_names": [], "import_names": [], "rhs_call_name": "disk", "annotation": ""}, "snippet": "\t\t\t\tdi = disk(label, size)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L88_C4", "label": "append()", "type": "expression", "loc": [88, 88], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L84_C3", "vector": [8, 4, 0.2023, 0.0023, 4, 0.04, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": "\t\t\t\tself.disks.append(di)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L90_C0", "label": "memInfo", "type": "class", "loc": [90, 117], "level": 0, "parent": null, "vector": [3, 0, 0.2379, 0.0644, 0, 0.66, 0.44, 661, 0, 2, 0, 0, 0, 0, 15], "semantic": {"name": "memInfo", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class memInfo():\n\tdef __init__(self):\n\t\tself.checkInfo()\n\t\tself.memTotal = 0\n\t\tself.memFree = 0\n\t\tself.swapTotal = 0\n\t\tself.swapFree = 0\n\t\t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L91_C1", "label": "__init__", "type": "function", "loc": [91, 96], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L90_C0", "vector": [2, 1, 0.2149, 0.0138, 1, 0.97, 0.0, 555, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __init__(self):\n\t\tself.checkInfo()\n\t\tself.memTotal = 0\n\t\tself.memFree = 0\n\t\tself.swapTotal = 0\n\t\tself.swapFree = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L92_C2", "label": "checkInfo()", "type": "expression", "loc": [92, 92], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L91_C1", "vector": [8, 2, 0.2115, 0.0023, 2, 0.02, 0.0, 369, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "checkInfo", "arg_names": [], "import_names": [], "rhs_call_name": "checkInfo", "annotation": ""}, "snippet": "\t\tself.checkInfo()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L93_C2", "label": "self.memTotal =", "type": "assigned_variable", "loc": [93, 93], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L91_C1", "vector": [14, 2, 0.2138, 0.0023, 2, 0.02, 0.25, 502, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.memTotal", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.memTotal = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L94_C2", "label": "self.memFree =", "type": "assigned_variable", "loc": [94, 94], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L91_C1", "vector": [14, 2, 0.2161, 0.0023, 2, 0.02, 0.5, 695, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.memFree", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.memFree = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L95_C2", "label": "self.swapTotal =", "type": "assigned_variable", "loc": [95, 95], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L91_C1", "vector": [14, 2, 0.2184, 0.0023, 2, 0.02, 0.75, 578, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.swapTotal", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.swapTotal = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L96_C2", "label": "self.swapFree =", "type": "assigned_variable", "loc": [96, 96], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L91_C1", "vector": [14, 2, 0.2207, 0.0023, 2, 0.02, 1.0, 357, 1, 0, 0, 0, 0, 1, 0], "semantic": {"name": "self.swapFree", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.swapFree = 0"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L98_C1", "label": "checkInfo", "type": "function", "loc": [98, 117], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L90_C0", "vector": [2, 1, 0.2471, 0.046, 1, 0.97, 1.0, 369, 0, 1, 0, 0, 0, 0, 14], "semantic": {"name": "checkInfo", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef checkInfo(self):\n\t\tdata = commands.getstatusoutput('cat /proc/meminfo')[1]\n\t\tdata = data.split('\\n')\n\t\tp1 = re.compile(r\"MemTotal:\\s+(?P<mem>\\d+)\\skB.*\")\n\t\tp2 = re.compile(r\"MemFree:\\s+(?P<mem>\\d+)\\skB.*\")\n\t\tp3 = re.compile(r\"SwapTotal:\\s+(?P<mem>\\d+)\\skB.*\")\n\t\tp4 = re.compile(r\"SwapFree:\\s+(?P<mem>\\d+)\\skB.*\")\n\t\tfor d in data:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L99_C2", "label": "data =", "type": "assigned_variable", "loc": [99, 99], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L98_C1", "vector": [14, 2, 0.2276, 0.0023, 2, 0.72, 0.0, 929, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tdata = commands.getstatusoutput('cat /proc/meminfo')[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L100_C2", "label": "data = split()", "type": "assigned_variable", "loc": [100, 100], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L98_C1", "vector": [14, 2, 0.2299, 0.0023, 2, 0.72, 0.1667, 929, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": "\t\tdata = data.split('\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L101_C2", "label": "p1 = compile()", "type": "assigned_variable", "loc": [101, 101], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L98_C1", "vector": [14, 2, 0.2322, 0.0023, 2, 0.72, 0.3333, 87, 3, 1, 0, 0, 821, 10, 1], "semantic": {"name": "p1", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": "\t\tp1 = re.compile(r\"MemTotal:\\s+(?P<mem>\\d+)\\skB.*\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L102_C2", "label": "p2 = compile()", "type": "assigned_variable", "loc": [102, 102], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L98_C1", "vector": [14, 2, 0.2345, 0.0023, 2, 0.72, 0.5, 843, 3, 1, 0, 0, 821, 10, 1], "semantic": {"name": "p2", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": "\t\tp2 = re.compile(r\"MemFree:\\s+(?P<mem>\\d+)\\skB.*\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L103_C2", "label": "p3 = compile()", "type": "assigned_variable", "loc": [103, 103], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L98_C1", "vector": [14, 2, 0.2368, 0.0023, 2, 0.72, 0.6667, 80, 3, 1, 0, 0, 821, 10, 1], "semantic": {"name": "p3", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": "\t\tp3 = re.compile(r\"SwapTotal:\\s+(?P<mem>\\d+)\\skB.*\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L104_C2", "label": "p4 = compile()", "type": "assigned_variable", "loc": [104, 104], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L98_C1", "vector": [14, 2, 0.2391, 0.0023, 2, 0.72, 0.8333, 80, 3, 1, 0, 0, 821, 10, 1], "semantic": {"name": "p4", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": "\t\tp4 = re.compile(r\"SwapFree:\\s+(?P<mem>\\d+)\\skB.*\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L105_C2", "label": "for d", "type": "for", "loc": [105, 117], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L98_C1", "vector": [6, 2, 0.2552, 0.0299, 2, 0.72, 1.0, 355, 2, 0, 0, 0, 0, 0, 8], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor d in data:\n\t\t\tm = p1.match(d)\n\t\t\tif (m):\n\t\t\t\tself.memTotal = m.group(1)\n\t\t\tm = p2.match(d)\n\t\t\tif (m):\n\t\t\t\tself.memFree = m.group(1)\n\t\t\tm = p3.match(d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L106_C3", "label": "m = match()", "type": "assigned_variable", "loc": [106, 106], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L105_C2", "vector": [14, 3, 0.2437, 0.0023, 3, 0.33, 0.0, 711, 3, 1, 0, 0, 36, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "match", "annotation": ""}, "snippet": "\t\t\tm = p1.match(d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L107_C3", "label": "if", "type": "if", "loc": [107, 108], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L105_C2", "vector": [4, 3, 0.2471, 0.0046, 3, 0.33, 0.1429, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif (m):\n\t\t\t\tself.memTotal = m.group(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L108_C4", "label": "self.memTotal = group()", "type": "assigned_variable", "loc": [108, 108], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L107_C3", "vector": [14, 4, 0.2483, 0.0023, 4, 0.59, 0.0, 502, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "self.memTotal", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\t\t\tself.memTotal = m.group(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L109_C3", "label": "m = match()", "type": "assigned_variable", "loc": [109, 109], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L105_C2", "vector": [14, 3, 0.2506, 0.0023, 3, 0.33, 0.2857, 711, 3, 1, 0, 0, 36, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "match", "annotation": ""}, "snippet": "\t\t\tm = p2.match(d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L110_C3", "label": "if", "type": "if", "loc": [110, 111], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L105_C2", "vector": [4, 3, 0.254, 0.0046, 3, 0.33, 0.4286, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif (m):\n\t\t\t\tself.memFree = m.group(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L111_C4", "label": "self.memFree = group()", "type": "assigned_variable", "loc": [111, 111], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L110_C3", "vector": [14, 4, 0.2552, 0.0023, 4, 0.53, 0.0, 695, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "self.memFree", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\t\t\tself.memFree = m.group(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L112_C3", "label": "m = match()", "type": "assigned_variable", "loc": [112, 112], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L105_C2", "vector": [14, 3, 0.2575, 0.0023, 3, 0.33, 0.5714, 711, 3, 1, 0, 0, 36, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "match", "annotation": ""}, "snippet": "\t\t\tm = p3.match(d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L113_C3", "label": "if", "type": "if", "loc": [113, 114], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L105_C2", "vector": [4, 3, 0.2609, 0.0046, 3, 0.33, 0.7143, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif (m):\n\t\t\t\tself.swapTotal = m.group(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L114_C4", "label": "self.swapTotal = group()", "type": "assigned_variable", "loc": [114, 114], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L113_C3", "vector": [14, 4, 0.2621, 0.0023, 4, 0.75, 0.0, 578, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "self.swapTotal", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\t\t\tself.swapTotal = m.group(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L115_C3", "label": "m = match()", "type": "assigned_variable", "loc": [115, 115], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L105_C2", "vector": [14, 3, 0.2644, 0.0023, 3, 0.33, 0.8571, 711, 3, 1, 0, 0, 36, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "match", "annotation": ""}, "snippet": "\t\t\tm = p4.match(d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L116_C3", "label": "if", "type": "if", "loc": [116, 117], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L105_C2", "vector": [4, 3, 0.2678, 0.0046, 3, 0.33, 1.0, 0, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif (m):\n\t\t\t\tself.swapFree = m.group(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L117_C4", "label": "self.swapFree = group()", "type": "assigned_variable", "loc": [117, 117], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L116_C3", "vector": [14, 4, 0.269, 0.0023, 4, 0.84, 0.0, 357, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "self.swapFree", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\t\t\tself.swapFree = m.group(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L119_C0", "label": "cpu", "type": "class", "loc": [119, 138], "level": 0, "parent": null, "vector": [3, 0, 0.2954, 0.046, 0, 0.66, 0.48, 468, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "cpu", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class cpu():\n\tdef __init__(self, id, vendor_id, cpu_family, model_id, model_name):\n\t\tself.id = id\n\t\tself.vendor_id = vendor_id\n\t\tself.cpu_family = cpu_family\n\t\tself.model_id = model_id\n\t\tself.model_name = model_name\n\t\t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L120_C1", "label": "__init__", "type": "function", "loc": [120, 125], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L119_C0", "vector": [2, 1, 0.2816, 0.0138, 1, 0.35, 0.0, 555, 0, 6, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "id", "vendor_id", "cpu_family", "model_id", "model_name"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __init__(self, id, vendor_id, cpu_family, model_id, model_name):\n\t\tself.id = id\n\t\tself.vendor_id = vendor_id\n\t\tself.cpu_family = cpu_family\n\t\tself.model_id = model_id\n\t\tself.model_name = model_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L121_C2", "label": "self.id =", "type": "assigned_variable", "loc": [121, 121], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L120_C1", "vector": [14, 2, 0.2782, 0.0023, 2, 0.91, 0.0, 485, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.id = id"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L122_C2", "label": "self.vendor_id =", "type": "assigned_variable", "loc": [122, 122], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L120_C1", "vector": [14, 2, 0.2805, 0.0023, 2, 0.91, 0.25, 864, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.vendor_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.vendor_id = vendor_id"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L123_C2", "label": "self.cpu_family =", "type": "assigned_variable", "loc": [123, 123], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L120_C1", "vector": [14, 2, 0.2828, 0.0023, 2, 0.91, 0.5, 735, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.cpu_family", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.cpu_family = cpu_family"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L124_C2", "label": "self.model_id =", "type": "assigned_variable", "loc": [124, 124], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L120_C1", "vector": [14, 2, 0.2851, 0.0023, 2, 0.91, 0.75, 240, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.model_id", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.model_id = model_id"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L125_C2", "label": "self.model_name =", "type": "assigned_variable", "loc": [125, 125], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L120_C1", "vector": [14, 2, 0.2874, 0.0023, 2, 0.91, 1.0, 422, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.model_name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.model_name = model_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L127_C1", "label": "__repr__", "type": "function", "loc": [127, 128], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L119_C0", "vector": [2, 1, 0.2931, 0.0046, 1, 0.35, 0.5, 204, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "__repr__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __repr__(self):\n\t\treturn \"%s,%s,%s,%s,%s\" % (self.id, self.vendor_id, self.cpu_family, self.model_id, self.model_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Return_L128_C2", "label": "return", "type": "return", "loc": [128, 128], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L127_C1", "vector": [13, 2, 0.2943, 0.0023, 2, 0.61, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn \"%s,%s,%s,%s,%s\" % (self.id, self.vendor_id, self.cpu_family, self.model_id, self.model_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L129_C1", "label": "expression", "type": "expression", "loc": [129, 138], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L119_C0", "vector": [8, 1, 0.3069, 0.023, 1, 0.35, 1.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t'''\n\tdef xml(self, dom):\n\t\tcp = dom.createElement(\"cpu\")\n\t\tcp.id = self.id\n\t\tcp.vendor_id = vendor_id\n\t\tcp.cpu_family = cpu_family\n\t\tcp.model_id = model_id\n\t\tcp.model_name = model_name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L139_C0", "label": "cpuInfo", "type": "class", "loc": [139, 174], "level": 0, "parent": null, "vector": [3, 0, 0.3598, 0.0828, 0, 0.66, 0.52, 934, 0, 3, 0, 0, 0, 0, 22], "semantic": {"name": "cpuInfo", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class cpuInfo():\n\tdef __init__(self):\n\t\tself.cpus = []\n\t\tself.checkInfo()\n\t\t\n\tdef checkInfo(self):\n\t\tdata = commands.getstatusoutput('cat /proc/cpuinfo')[1]\n\t\tdata = data.split('\\n\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L140_C1", "label": "__init__", "type": "function", "loc": [140, 142], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L139_C0", "vector": [2, 1, 0.3241, 0.0069, 1, 0.83, 0.0, 555, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __init__(self):\n\t\tself.cpus = []\n\t\tself.checkInfo()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L141_C2", "label": "self.cpus =", "type": "assigned_variable", "loc": [141, 141], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L140_C1", "vector": [14, 2, 0.3241, 0.0023, 2, 0.0, 0.0, 318, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.cpus", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.cpus = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L142_C2", "label": "checkInfo()", "type": "expression", "loc": [142, 142], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L140_C1", "vector": [8, 2, 0.3264, 0.0023, 2, 0.0, 1.0, 369, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "checkInfo", "arg_names": [], "import_names": [], "rhs_call_name": "checkInfo", "annotation": ""}, "snippet": "\t\tself.checkInfo()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L144_C1", "label": "checkInfo", "type": "function", "loc": [144, 148], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L139_C0", "vector": [2, 1, 0.3356, 0.0115, 1, 0.83, 0.5, 369, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "checkInfo", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef checkInfo(self):\n\t\tdata = commands.getstatusoutput('cat /proc/cpuinfo')[1]\n\t\tdata = data.split('\\n\\n')\n\t\tfor d in data:\n\t\t\tself.parseCpuData(d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L145_C2", "label": "data =", "type": "assigned_variable", "loc": [145, 145], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L144_C1", "vector": [14, 2, 0.3333, 0.0023, 2, 0.07, 0.0, 929, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tdata = commands.getstatusoutput('cat /proc/cpuinfo')[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L146_C2", "label": "data = split()", "type": "assigned_variable", "loc": [146, 146], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L144_C1", "vector": [14, 2, 0.3356, 0.0023, 2, 0.07, 0.5, 929, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": "\t\tdata = data.split('\\n\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L147_C2", "label": "for d", "type": "for", "loc": [147, 148], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L144_C1", "vector": [6, 2, 0.3391, 0.0046, 2, 0.07, 1.0, 355, 2, 0, 0, 0, 0, 0, 1], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor d in data:\n\t\t\tself.parseCpuData(d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L148_C3", "label": "parseCpuData()", "type": "expression", "loc": [148, 148], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L147_C2", "vector": [8, 3, 0.3402, 0.0023, 3, 0.41, 0.0, 723, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "parseCpuData", "arg_names": [], "import_names": [], "rhs_call_name": "parseCpuData", "annotation": ""}, "snippet": "\t\t\tself.parseCpuData(d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L150_C1", "label": "parseCpuData", "type": "function", "loc": [150, 174], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L139_C0", "vector": [2, 1, 0.3724, 0.0575, 1, 0.83, 1.0, 723, 0, 2, 0, 0, 0, 0, 18], "semantic": {"name": "parseCpuData", "arg_names": ["self", "data"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef parseCpuData(self, data):\n\t\tdata = data.split('\\n')\n\t\tp = re.compile(r\"([\\w\\s+]+)\\t: (?P<val>.*)\")\n\t\tm = p.match(data[0])\n\t\tid = m.group(2)\n\t\t\n\t\tp = re.compile(r\"([\\w\\s+]+)\\t: (?P<val>.*)\")\n\t\tm = p.match(data[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L151_C2", "label": "data = split()", "type": "assigned_variable", "loc": [151, 151], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L150_C1", "vector": [14, 2, 0.3471, 0.0023, 2, 0.1, 0.0, 929, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": "\t\tdata = data.split('\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L152_C2", "label": "p = compile()", "type": "assigned_variable", "loc": [152, 152], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L150_C1", "vector": [14, 2, 0.3494, 0.0023, 2, 0.1, 0.0588, 491, 3, 1, 0, 0, 821, 10, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": "\t\tp = re.compile(r\"([\\w\\s+]+)\\t: (?P<val>.*)\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L153_C2", "label": "m = match()", "type": "assigned_variable", "loc": [153, 153], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L150_C1", "vector": [14, 2, 0.3517, 0.0023, 2, 0.1, 0.1176, 711, 3, 1, 0, 0, 36, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "match", "annotation": ""}, "snippet": "\t\tm = p.match(data[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L154_C2", "label": "id = group()", "type": "assigned_variable", "loc": [154, 154], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L150_C1", "vector": [14, 2, 0.354, 0.0023, 2, 0.1, 0.1765, 941, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "id", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\tid = m.group(2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L156_C2", "label": "p = compile()", "type": "assigned_variable", "loc": [156, 156], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L150_C1", "vector": [14, 2, 0.3586, 0.0023, 2, 0.1, 0.2353, 491, 3, 1, 0, 0, 821, 10, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": "\t\tp = re.compile(r\"([\\w\\s+]+)\\t: (?P<val>.*)\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L157_C2", "label": "m = match()", "type": "assigned_variable", "loc": [157, 157], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L150_C1", "vector": [14, 2, 0.3609, 0.0023, 2, 0.1, 0.2941, 711, 3, 1, 0, 0, 36, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "match", "annotation": ""}, "snippet": "\t\tm = p.match(data[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L158_C2", "label": "vendor_id = group()", "type": "assigned_variable", "loc": [158, 158], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L150_C1", "vector": [14, 2, 0.3632, 0.0023, 2, 0.1, 0.3529, 36, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "vendor_id", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\tvendor_id = m.group(2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L160_C2", "label": "p = compile()", "type": "assigned_variable", "loc": [160, 160], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L150_C1", "vector": [14, 2, 0.3678, 0.0023, 2, 0.1, 0.4118, 491, 3, 1, 0, 0, 821, 10, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": "\t\tp = re.compile(r\"([\\w\\s+]+)\\t: (?P<val>.*)\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L161_C2", "label": "m = match()", "type": "assigned_variable", "loc": [161, 161], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L150_C1", "vector": [14, 2, 0.3701, 0.0023, 2, 0.1, 0.4706, 711, 3, 1, 0, 0, 36, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "match", "annotation": ""}, "snippet": "\t\tm = p.match(data[2])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L162_C2", "label": "cpu_family = group()", "type": "assigned_variable", "loc": [162, 162], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L150_C1", "vector": [14, 2, 0.3724, 0.0023, 2, 0.1, 0.5294, 602, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "cpu_family", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\tcpu_family = m.group(2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L164_C2", "label": "p = compile()", "type": "assigned_variable", "loc": [164, 164], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L150_C1", "vector": [14, 2, 0.377, 0.0023, 2, 0.1, 0.5882, 491, 3, 1, 0, 0, 821, 10, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": "\t\tp = re.compile(r\"([\\w\\s+]+)\\t: (?P<val>.*)\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L165_C2", "label": "m = match()", "type": "assigned_variable", "loc": [165, 165], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L150_C1", "vector": [14, 2, 0.3793, 0.0023, 2, 0.1, 0.6471, 711, 3, 1, 0, 0, 36, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "match", "annotation": ""}, "snippet": "\t\tm = p.match(data[3])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L166_C2", "label": "model_id = group()", "type": "assigned_variable", "loc": [166, 166], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L150_C1", "vector": [14, 2, 0.3816, 0.0023, 2, 0.1, 0.7059, 576, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "model_id", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\tmodel_id = m.group(2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L168_C2", "label": "p = compile()", "type": "assigned_variable", "loc": [168, 168], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L150_C1", "vector": [14, 2, 0.3862, 0.0023, 2, 0.1, 0.7647, 491, 3, 1, 0, 0, 821, 10, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": "\t\tp = re.compile(r\"([\\w\\s+]+)\\t: (?P<val>.*)\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L169_C2", "label": "m = match()", "type": "assigned_variable", "loc": [169, 169], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L150_C1", "vector": [14, 2, 0.3885, 0.0023, 2, 0.1, 0.8235, 711, 3, 1, 0, 0, 36, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "match", "annotation": ""}, "snippet": "\t\tm = p.match(data[4])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L170_C2", "label": "model_name = group()", "type": "assigned_variable", "loc": [170, 170], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L150_C1", "vector": [14, 2, 0.3908, 0.0023, 2, 0.1, 0.8824, 131, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "model_name", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\tmodel_name = m.group(2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L172_C2", "label": "cp = cpu()", "type": "assigned_variable", "loc": [172, 172], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L150_C1", "vector": [14, 2, 0.3954, 0.0023, 2, 0.1, 0.9412, 70, 3, 5, 0, 0, 468, 10, 1], "semantic": {"name": "cp", "arg_names": [], "import_names": [], "rhs_call_name": "cpu", "annotation": ""}, "snippet": "\t\tcp = cpu(id, vendor_id, cpu_family, model_id, model_name)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L174_C2", "label": "append()", "type": "expression", "loc": [174, 174], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L150_C1", "vector": [8, 2, 0.4, 0.0023, 2, 0.1, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": "\t\tself.cpus.append(cp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L176_C0", "label": "pciDev", "type": "class", "loc": [176, 186], "level": 0, "parent": null, "vector": [3, 0, 0.4161, 0.0253, 0, 0.66, 0.56, 769, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "pciDev", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class pciDev():\n\tdef __init__(self, device, dClass, vendor, deviceName, sVendor, sDevice):\n\t\tself.device = device\n\t\tself.dClass = dClass\n\t\tself.vendor = vendor\n\t\tself.deviceName = deviceName\n\t\tself.sVendor = sVendor\n\t\tself.sDevice = sDevice"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L177_C1", "label": "__init__", "type": "function", "loc": [177, 183], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L176_C0", "vector": [2, 1, 0.4138, 0.0161, 1, 0.13, 0.0, 555, 0, 7, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "device", "dClass", "vendor", "deviceName", "sVendor", "sDevice"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __init__(self, device, dClass, vendor, deviceName, sVendor, sDevice):\n\t\tself.device = device\n\t\tself.dClass = dClass\n\t\tself.vendor = vendor\n\t\tself.deviceName = deviceName\n\t\tself.sVendor = sVendor\n\t\tself.sDevice = sDevice"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L178_C2", "label": "self.device =", "type": "assigned_variable", "loc": [178, 178], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L177_C1", "vector": [14, 2, 0.4092, 0.0023, 2, 0.1, 0.0, 993, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.device", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.device = device"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L179_C2", "label": "self.dClass =", "type": "assigned_variable", "loc": [179, 179], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L177_C1", "vector": [14, 2, 0.4115, 0.0023, 2, 0.1, 0.2, 575, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.dClass", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.dClass = dClass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L180_C2", "label": "self.vendor =", "type": "assigned_variable", "loc": [180, 180], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L177_C1", "vector": [14, 2, 0.4138, 0.0023, 2, 0.1, 0.4, 933, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.vendor", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.vendor = vendor"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L181_C2", "label": "self.deviceName =", "type": "assigned_variable", "loc": [181, 181], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L177_C1", "vector": [14, 2, 0.4161, 0.0023, 2, 0.1, 0.6, 514, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.deviceName", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.deviceName = deviceName"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L182_C2", "label": "self.sVendor =", "type": "assigned_variable", "loc": [182, 182], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L177_C1", "vector": [14, 2, 0.4184, 0.0023, 2, 0.1, 0.8, 589, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.sVendor", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.sVendor = sVendor"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L183_C2", "label": "self.sDevice =", "type": "assigned_variable", "loc": [183, 183], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L177_C1", "vector": [14, 2, 0.4207, 0.0023, 2, 0.1, 1.0, 215, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.sDevice", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.sDevice = sDevice"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L185_C1", "label": "__repr__", "type": "function", "loc": [185, 186], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L176_C0", "vector": [2, 1, 0.4264, 0.0046, 1, 0.13, 1.0, 204, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "__repr__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __repr__(self):\n\t\treturn \"%s,%s,%s,%s,%s,%s\" % (self.device, self.dClass, self.vendor, self.deviceName, self.sVendor, self.sDevice)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Return_L186_C2", "label": "return", "type": "return", "loc": [186, 186], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L185_C1", "vector": [13, 2, 0.4276, 0.0023, 2, 0.88, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn \"%s,%s,%s,%s,%s,%s\" % (self.device, self.dClass, self.vendor, self.deviceName, self.sVendor, self.sDevice)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L188_C0", "label": "pciInfo", "type": "class", "loc": [188, 208], "level": 0, "parent": null, "vector": [3, 0, 0.4552, 0.0483, 0, 0.66, 0.6, 477, 0, 2, 0, 0, 0, 0, 12], "semantic": {"name": "pciInfo", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class pciInfo():\n\tdef __init__(self):\n\t\tself.devices = []\n\t\tself.checkInfo()\n\t\t\n\tdef checkInfo(self):\n\t\t\"\"\"Parse lspci info\"\"\"\n\t\tdata = commands.getstatusoutput('lspci -mm')[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L189_C1", "label": "__init__", "type": "function", "loc": [189, 191], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L188_C0", "vector": [2, 1, 0.4368, 0.0069, 1, 0.07, 0.0, 555, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __init__(self):\n\t\tself.devices = []\n\t\tself.checkInfo()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L190_C2", "label": "self.devices =", "type": "assigned_variable", "loc": [190, 190], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L189_C1", "vector": [14, 2, 0.4368, 0.0023, 2, 0.09, 0.0, 542, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.devices", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.devices = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L191_C2", "label": "checkInfo()", "type": "expression", "loc": [191, 191], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L189_C1", "vector": [8, 2, 0.4391, 0.0023, 2, 0.09, 1.0, 369, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "checkInfo", "arg_names": [], "import_names": [], "rhs_call_name": "checkInfo", "annotation": ""}, "snippet": "\t\tself.checkInfo()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L193_C1", "label": "checkInfo", "type": "function", "loc": [193, 208], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L188_C0", "vector": [2, 1, 0.4609, 0.0368, 1, 0.07, 1.0, 369, 0, 1, 0, 0, 0, 0, 11], "semantic": {"name": "checkInfo", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef checkInfo(self):\n\t\t\"\"\"Parse lspci info\"\"\"\n\t\tdata = commands.getstatusoutput('lspci -mm')[1]\n\t\tdata = data.split('\\n')\n\t\t#07:00.0 \"Ethernet controller\" \"Intel Corporation\" \"80003ES2LAN Gigabit Ethernet Controller (Copper)\" -r01 \"ASUSTeK Computer Inc.\" \"Device 8217\"\n\t\t#07:00.1 \"Ethernet controller\" \"Intel Corporation\" \"80003ES2LAN Gigabit Ethernet Controller (Copper)\" -r01 \"ASUSTeK Computer Inc.\" \"Device 8217\"\n\t\tfor d in data:\n\t\t\td = d.split(' \"')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L194_C2", "label": "expression", "type": "expression", "loc": [194, 194], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L193_C1", "vector": [8, 2, 0.446, 0.0023, 2, 0.21, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\"\"\"Parse lspci info\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L195_C2", "label": "data =", "type": "assigned_variable", "loc": [195, 195], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L193_C1", "vector": [14, 2, 0.4483, 0.0023, 2, 0.21, 0.3333, 929, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tdata = commands.getstatusoutput('lspci -mm')[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L196_C2", "label": "data = split()", "type": "assigned_variable", "loc": [196, 196], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L193_C1", "vector": [14, 2, 0.4506, 0.0023, 2, 0.21, 0.6667, 929, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": "\t\tdata = data.split('\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L199_C2", "label": "for d", "type": "for", "loc": [199, 208], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L193_C1", "vector": [6, 2, 0.4678, 0.023, 2, 0.21, 1.0, 355, 2, 0, 0, 0, 0, 0, 9], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor d in data:\n\t\t\td = d.split(' \"')\n\t\t\tdevice = d[0].replace('\"', '')\n\t\t\tdClass = d[1].replace('\"', '')\n\t\t\tvendor = d[2].replace('\"', '')\n\t\t\tdeviceName = d[3].replace('\"', '')\n\t\t\tsVendor = d[4].replace('\"', '')\n\t\t\tsDevice = d[5].replace('\"', '')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L200_C3", "label": "d = split()", "type": "assigned_variable", "loc": [200, 200], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L199_C2", "vector": [14, 3, 0.4598, 0.0023, 3, 0.93, 0.0, 355, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": "\t\t\td = d.split(' \"')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L201_C3", "label": "device = replace()", "type": "assigned_variable", "loc": [201, 201], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L199_C2", "vector": [14, 3, 0.4621, 0.0023, 3, 0.93, 0.125, 183, 3, 2, 0, 0, 293, 10, 1], "semantic": {"name": "device", "arg_names": [], "import_names": [], "rhs_call_name": "replace", "annotation": ""}, "snippet": "\t\t\tdevice = d[0].replace('\"', '')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L202_C3", "label": "dClass = replace()", "type": "assigned_variable", "loc": [202, 202], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L199_C2", "vector": [14, 3, 0.4644, 0.0023, 3, 0.93, 0.25, 898, 3, 2, 0, 0, 293, 10, 1], "semantic": {"name": "dClass", "arg_names": [], "import_names": [], "rhs_call_name": "replace", "annotation": ""}, "snippet": "\t\t\tdClass = d[1].replace('\"', '')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L203_C3", "label": "vendor = replace()", "type": "assigned_variable", "loc": [203, 203], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L199_C2", "vector": [14, 3, 0.4667, 0.0023, 3, 0.93, 0.375, 724, 3, 2, 0, 0, 293, 10, 1], "semantic": {"name": "vendor", "arg_names": [], "import_names": [], "rhs_call_name": "replace", "annotation": ""}, "snippet": "\t\t\tvendor = d[2].replace('\"', '')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L204_C3", "label": "deviceName = replace()", "type": "assigned_variable", "loc": [204, 204], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L199_C2", "vector": [14, 3, 0.469, 0.0023, 3, 0.93, 0.5, 769, 3, 2, 0, 0, 293, 10, 1], "semantic": {"name": "deviceName", "arg_names": [], "import_names": [], "rhs_call_name": "replace", "annotation": ""}, "snippet": "\t\t\tdeviceName = d[3].replace('\"', '')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L205_C3", "label": "sVendor = replace()", "type": "assigned_variable", "loc": [205, 205], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L199_C2", "vector": [14, 3, 0.4713, 0.0023, 3, 0.93, 0.625, 116, 3, 2, 0, 0, 293, 10, 1], "semantic": {"name": "sVendor", "arg_names": [], "import_names": [], "rhs_call_name": "replace", "annotation": ""}, "snippet": "\t\t\tsVendor = d[4].replace('\"', '')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L206_C3", "label": "sDevice = replace()", "type": "assigned_variable", "loc": [206, 206], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L199_C2", "vector": [14, 3, 0.4736, 0.0023, 3, 0.93, 0.75, 129, 3, 2, 0, 0, 293, 10, 1], "semantic": {"name": "sDevice", "arg_names": [], "import_names": [], "rhs_call_name": "replace", "annotation": ""}, "snippet": "\t\t\tsDevice = d[5].replace('\"', '')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L207_C3", "label": "pDev = pciDev()", "type": "assigned_variable", "loc": [207, 207], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L199_C2", "vector": [14, 3, 0.4759, 0.0023, 3, 0.93, 0.875, 182, 3, 6, 0, 0, 769, 10, 1], "semantic": {"name": "pDev", "arg_names": [], "import_names": [], "rhs_call_name": "pciDev", "annotation": ""}, "snippet": "\t\t\tpDev = pciDev(device, dClass, vendor, deviceName, sVendor, sDevice)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L208_C3", "label": "append()", "type": "expression", "loc": [208, 208], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L199_C2", "vector": [8, 3, 0.4782, 0.0023, 3, 0.93, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": "\t\t\tself.devices.append(pDev)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L210_C0", "label": "networkCard", "type": "class", "loc": [210, 233], "level": 0, "parent": null, "vector": [3, 0, 0.5092, 0.0552, 0, 0.66, 0.64, 44, 0, 3, 0, 0, 0, 0, 12], "semantic": {"name": "networkCard", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class networkCard():\n\tdef __init__(self, interface, neg):\n\t\tself.interface = interface\n\t\tself.neg = neg\n\t\tself.getRingParams()\n\n\tdef __repr__(self):\n\t\treturn \"%s,%s,%s,%s,%s,%s\" % (self.interface, self.neg, self.maxRX, self.maxTX, self.RX, self.TX)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L211_C1", "label": "__init__", "type": "function", "loc": [211, 214], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L210_C0", "vector": [2, 1, 0.4885, 0.0092, 1, 0.41, 0.0, 555, 0, 3, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self", "interface", "neg"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __init__(self, interface, neg):\n\t\tself.interface = interface\n\t\tself.neg = neg\n\t\tself.getRingParams()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L212_C2", "label": "self.interface =", "type": "assigned_variable", "loc": [212, 212], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L211_C1", "vector": [14, 2, 0.4874, 0.0023, 2, 0.16, 0.0, 140, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.interface", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.interface = interface"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L213_C2", "label": "self.neg =", "type": "assigned_variable", "loc": [213, 213], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L211_C1", "vector": [14, 2, 0.4897, 0.0023, 2, 0.16, 0.5, 11, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.neg", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.neg = neg"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L214_C2", "label": "getRingParams()", "type": "expression", "loc": [214, 214], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L211_C1", "vector": [8, 2, 0.492, 0.0023, 2, 0.16, 1.0, 29, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "getRingParams", "arg_names": [], "import_names": [], "rhs_call_name": "getRingParams", "annotation": ""}, "snippet": "\t\tself.getRingParams()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L216_C1", "label": "__repr__", "type": "function", "loc": [216, 217], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L210_C0", "vector": [2, 1, 0.4977, 0.0046, 1, 0.41, 0.5, 204, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "__repr__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __repr__(self):\n\t\treturn \"%s,%s,%s,%s,%s,%s\" % (self.interface, self.neg, self.maxRX, self.maxTX, self.RX, self.TX)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Return_L217_C2", "label": "return", "type": "return", "loc": [217, 217], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L216_C1", "vector": [13, 2, 0.4989, 0.0023, 2, 0.76, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn \"%s,%s,%s,%s,%s,%s\" % (self.interface, self.neg, self.maxRX, self.maxTX, self.RX, self.TX)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L219_C1", "label": "getRingParams", "type": "function", "loc": [219, 233], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L210_C0", "vector": [2, 1, 0.5195, 0.0345, 1, 0.41, 1.0, 29, 0, 1, 0, 0, 0, 0, 11], "semantic": {"name": "getRingParams", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef getRingParams(self):\n\t\tdata = commands.getstatusoutput('ethtool -g %s' % self.interface)[1]\n\t\tdata = data.split('\\n')\n\t\tp = re.compile(r\"([\\w\\s+]+):([^\\d]+)(?P<val>\\d+)\")\n\t\tm = p.match(data[2])\n\t\tself.maxRX = m.group(3)\n\t\t\n\t\tm = p.match(data[5])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L220_C2", "label": "data =", "type": "assigned_variable", "loc": [220, 220], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L219_C1", "vector": [14, 2, 0.5057, 0.0023, 2, 0.08, 0.0, 929, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tdata = commands.getstatusoutput('ethtool -g %s' % self.interface)[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L221_C2", "label": "data = split()", "type": "assigned_variable", "loc": [221, 221], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L219_C1", "vector": [14, 2, 0.508, 0.0023, 2, 0.08, 0.1, 929, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": "\t\tdata = data.split('\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L222_C2", "label": "p = compile()", "type": "assigned_variable", "loc": [222, 222], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L219_C1", "vector": [14, 2, 0.5103, 0.0023, 2, 0.08, 0.2, 491, 3, 1, 0, 0, 821, 10, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": "\t\tp = re.compile(r\"([\\w\\s+]+):([^\\d]+)(?P<val>\\d+)\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L223_C2", "label": "m = match()", "type": "assigned_variable", "loc": [223, 223], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L219_C1", "vector": [14, 2, 0.5126, 0.0023, 2, 0.08, 0.3, 711, 3, 1, 0, 0, 36, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "match", "annotation": ""}, "snippet": "\t\tm = p.match(data[2])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L224_C2", "label": "self.maxRX = group()", "type": "assigned_variable", "loc": [224, 224], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L219_C1", "vector": [14, 2, 0.5149, 0.0023, 2, 0.08, 0.4, 555, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "self.maxRX", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\tself.maxRX = m.group(3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L226_C2", "label": "m = match()", "type": "assigned_variable", "loc": [226, 226], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L219_C1", "vector": [14, 2, 0.5195, 0.0023, 2, 0.08, 0.5, 711, 3, 1, 0, 0, 36, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "match", "annotation": ""}, "snippet": "\t\tm = p.match(data[5])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L227_C2", "label": "self.maxTX = group()", "type": "assigned_variable", "loc": [227, 227], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L219_C1", "vector": [14, 2, 0.5218, 0.0023, 2, 0.08, 0.6, 867, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "self.maxTX", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\tself.maxTX = m.group(3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L229_C2", "label": "m = match()", "type": "assigned_variable", "loc": [229, 229], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L219_C1", "vector": [14, 2, 0.5264, 0.0023, 2, 0.08, 0.7, 711, 3, 1, 0, 0, 36, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "match", "annotation": ""}, "snippet": "\t\tm = p.match(data[7])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L230_C2", "label": "self.RX = group()", "type": "assigned_variable", "loc": [230, 230], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L219_C1", "vector": [14, 2, 0.5287, 0.0023, 2, 0.08, 0.8, 979, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "self.RX", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\tself.RX = m.group(3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L232_C2", "label": "m = match()", "type": "assigned_variable", "loc": [232, 232], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L219_C1", "vector": [14, 2, 0.5333, 0.0023, 2, 0.08, 0.9, 711, 3, 1, 0, 0, 36, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "match", "annotation": ""}, "snippet": "\t\tm = p.match(data[10])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L233_C2", "label": "self.TX = group()", "type": "assigned_variable", "loc": [233, 233], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L219_C1", "vector": [14, 2, 0.5356, 0.0023, 2, 0.08, 1.0, 186, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "self.TX", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\tself.TX = m.group(3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L236_C0", "label": "networkInfo", "type": "class", "loc": [236, 253], "level": 0, "parent": null, "vector": [3, 0, 0.5621, 0.0414, 0, 0.66, 0.68, 40, 0, 2, 0, 0, 0, 0, 9], "semantic": {"name": "networkInfo", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class networkInfo():\n\tdef __init__(self):\n\t\tself.cards = []\n\t\tself.checkInfo()\n\t\t\n\tdef checkInfo(self):\n\t\t\"\"\"Parse Mii-tool and ethtool info\"\"\"\n\t\tdata = commands.getstatusoutput('mii-tool')[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L237_C1", "label": "__init__", "type": "function", "loc": [237, 239], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L236_C0", "vector": [2, 1, 0.5471, 0.0069, 1, 0.46, 0.0, 555, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __init__(self):\n\t\tself.cards = []\n\t\tself.checkInfo()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L238_C2", "label": "self.cards =", "type": "assigned_variable", "loc": [238, 238], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L237_C1", "vector": [14, 2, 0.5471, 0.0023, 2, 0.95, 0.0, 387, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.cards", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.cards = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L239_C2", "label": "checkInfo()", "type": "expression", "loc": [239, 239], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L237_C1", "vector": [8, 2, 0.5494, 0.0023, 2, 0.95, 1.0, 369, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "checkInfo", "arg_names": [], "import_names": [], "rhs_call_name": "checkInfo", "annotation": ""}, "snippet": "\t\tself.checkInfo()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L241_C1", "label": "checkInfo", "type": "function", "loc": [241, 253], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L236_C0", "vector": [2, 1, 0.5678, 0.0299, 1, 0.46, 1.0, 369, 0, 1, 0, 0, 0, 0, 8], "semantic": {"name": "checkInfo", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef checkInfo(self):\n\t\t\"\"\"Parse Mii-tool and ethtool info\"\"\"\n\t\tdata = commands.getstatusoutput('mii-tool')[1]\n\t\tdata = data.split('\\n')\n\t\t#eth0: negotiated 100baseTx-FD, link ok\n\t\tp = re.compile(r\"(?P<in>[\\d\\w]+): negotiated (?P<vel>[\\d\\.]+).*\")\n\t\tfor d in data:\n\t\t\tm = p.match(d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L242_C2", "label": "expression", "type": "expression", "loc": [242, 242], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L241_C1", "vector": [8, 2, 0.5563, 0.0023, 2, 0.99, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\"\"\"Parse Mii-tool and ethtool info\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L243_C2", "label": "data =", "type": "assigned_variable", "loc": [243, 243], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L241_C1", "vector": [14, 2, 0.5586, 0.0023, 2, 0.99, 0.25, 929, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tdata = commands.getstatusoutput('mii-tool')[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L244_C2", "label": "data = split()", "type": "assigned_variable", "loc": [244, 244], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L241_C1", "vector": [14, 2, 0.5609, 0.0023, 2, 0.99, 0.5, 929, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": "\t\tdata = data.split('\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L246_C2", "label": "p = compile()", "type": "assigned_variable", "loc": [246, 246], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L241_C1", "vector": [14, 2, 0.5655, 0.0023, 2, 0.99, 0.75, 491, 3, 1, 0, 0, 821, 10, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": "\t\tp = re.compile(r\"(?P<in>[\\d\\w]+): negotiated (?P<vel>[\\d\\.]+).*\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L247_C2", "label": "for d", "type": "for", "loc": [247, 253], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L241_C1", "vector": [6, 2, 0.5747, 0.0161, 2, 0.99, 1.0, 355, 2, 0, 0, 0, 0, 0, 5], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor d in data:\n\t\t\tm = p.match(d)\n\t\t\tif (m):\n\t\t\t\tinterface = m.group(1)\n\t\t\t\tneg = m.group(2)\n\t\t\t\tcard = networkCard(interface, neg)\n\t\t\t\tself.cards.append(card)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L248_C3", "label": "m = match()", "type": "assigned_variable", "loc": [248, 248], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L247_C2", "vector": [14, 3, 0.5701, 0.0023, 3, 0.11, 0.0, 711, 3, 1, 0, 0, 36, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "match", "annotation": ""}, "snippet": "\t\t\tm = p.match(d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L249_C3", "label": "if", "type": "if", "loc": [249, 253], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L247_C2", "vector": [4, 3, 0.577, 0.0115, 3, 0.11, 1.0, 0, 2, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif (m):\n\t\t\t\tinterface = m.group(1)\n\t\t\t\tneg = m.group(2)\n\t\t\t\tcard = networkCard(interface, neg)\n\t\t\t\tself.cards.append(card)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L250_C4", "label": "interface = group()", "type": "assigned_variable", "loc": [250, 250], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L249_C3", "vector": [14, 4, 0.5747, 0.0023, 4, 0.64, 0.0, 396, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "interface", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\t\t\tinterface = m.group(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L251_C4", "label": "neg = group()", "type": "assigned_variable", "loc": [251, 251], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L249_C3", "vector": [14, 4, 0.577, 0.0023, 4, 0.64, 0.3333, 801, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "neg", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\t\t\tneg = m.group(2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L252_C4", "label": "card = networkCard()", "type": "assigned_variable", "loc": [252, 252], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L249_C3", "vector": [14, 4, 0.5793, 0.0023, 4, 0.64, 0.6667, 447, 3, 2, 0, 0, 44, 10, 1], "semantic": {"name": "card", "arg_names": [], "import_names": [], "rhs_call_name": "networkCard", "annotation": ""}, "snippet": "\t\t\t\tcard = networkCard(interface, neg)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L253_C4", "label": "append()", "type": "expression", "loc": [253, 253], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L249_C3", "vector": [8, 4, 0.5816, 0.0023, 4, 0.64, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": "\t\t\t\tself.cards.append(card)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L255_C0", "label": "pkt", "type": "class", "loc": [255, 262], "level": 0, "parent": null, "vector": [3, 0, 0.5943, 0.0184, 0, 0.66, 0.72, 180, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "pkt", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class pkt():\n\tdef __init__(self, name, version, desc):\n\t\tself.name = name\n\t\tself.version = version\n\t\tself.desc = desc\n\n\tdef __repr__(self):\n\t\treturn \"%s,%s,%s\" % (self.name, self.version, self.desc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L256_C1", "label": "__init__", "type": "function", "loc": [256, 259], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L255_C0", "vector": [2, 1, 0.592, 0.0092, 1, 0.16, 0.0, 555, 0, 4, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "name", "version", "desc"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __init__(self, name, version, desc):\n\t\tself.name = name\n\t\tself.version = version\n\t\tself.desc = desc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L257_C2", "label": "self.name =", "type": "assigned_variable", "loc": [257, 257], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L256_C1", "vector": [14, 2, 0.5908, 0.0023, 2, 0.37, 0.0, 689, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.name = name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L258_C2", "label": "self.version =", "type": "assigned_variable", "loc": [258, 258], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L256_C1", "vector": [14, 2, 0.5931, 0.0023, 2, 0.37, 0.5, 686, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.version", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.version = version"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L259_C2", "label": "self.desc =", "type": "assigned_variable", "loc": [259, 259], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L256_C1", "vector": [14, 2, 0.5954, 0.0023, 2, 0.37, 1.0, 843, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.desc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.desc = desc"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L261_C1", "label": "__repr__", "type": "function", "loc": [261, 262], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L255_C0", "vector": [2, 1, 0.6011, 0.0046, 1, 0.16, 1.0, 204, 0, 1, 1, 0, 0, 0, 0], "semantic": {"name": "__repr__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __repr__(self):\n\t\treturn \"%s,%s,%s\" % (self.name, self.version, self.desc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Return_L262_C2", "label": "return", "type": "return", "loc": [262, 262], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L261_C1", "vector": [13, 2, 0.6023, 0.0023, 2, 0.51, 0.0, 0, 4, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\treturn \"%s,%s,%s\" % (self.name, self.version, self.desc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L264_C0", "label": "packageInfo", "type": "class", "loc": [264, 280], "level": 0, "parent": null, "vector": [3, 0, 0.6253, 0.0391, 0, 0.66, 0.76, 470, 0, 2, 0, 0, 0, 0, 10], "semantic": {"name": "packageInfo", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class packageInfo():\n\tdef __init__(self):\n\t\tself.packages = []\n\t\tself.checkInfo()\n\t\t\n\tdef checkInfo(self):\n\t\tdata = commands.getstatusoutput('dpkg -l')[1]\n\t\tdata = data.split('\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L265_C1", "label": "__init__", "type": "function", "loc": [265, 267], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L264_C0", "vector": [2, 1, 0.6115, 0.0069, 1, 0.9, 0.0, 555, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __init__(self):\n\t\tself.packages = []\n\t\tself.checkInfo()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L266_C2", "label": "self.packages =", "type": "assigned_variable", "loc": [266, 266], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L265_C1", "vector": [14, 2, 0.6115, 0.0023, 2, 0.56, 0.0, 473, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.packages", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.packages = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L267_C2", "label": "checkInfo()", "type": "expression", "loc": [267, 267], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L265_C1", "vector": [8, 2, 0.6138, 0.0023, 2, 0.56, 1.0, 369, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "checkInfo", "arg_names": [], "import_names": [], "rhs_call_name": "checkInfo", "annotation": ""}, "snippet": "\t\tself.checkInfo()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L269_C1", "label": "checkInfo", "type": "function", "loc": [269, 280], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L264_C0", "vector": [2, 1, 0.631, 0.0276, 1, 0.9, 1.0, 369, 0, 1, 0, 0, 0, 0, 9], "semantic": {"name": "checkInfo", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef checkInfo(self):\n\t\tdata = commands.getstatusoutput('dpkg -l')[1]\n\t\tdata = data.split('\\n')\n\t\tp = re.compile(r\".. (?P<name>\\S+)\\s+(?P<ver>\\S+)\\s+(?P<desc>.*)\")\n\t\tfor d in data:\n\t\t\tm = p.match(d)\n\t\t\tif m:\n\t\t\t\tname = m.group(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L270_C2", "label": "data =", "type": "assigned_variable", "loc": [270, 270], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L269_C1", "vector": [14, 2, 0.6207, 0.0023, 2, 0.4, 0.0, 929, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tdata = commands.getstatusoutput('dpkg -l')[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L271_C2", "label": "data = split()", "type": "assigned_variable", "loc": [271, 271], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L269_C1", "vector": [14, 2, 0.623, 0.0023, 2, 0.4, 0.3333, 929, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": "\t\tdata = data.split('\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L272_C2", "label": "p = compile()", "type": "assigned_variable", "loc": [272, 272], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L269_C1", "vector": [14, 2, 0.6253, 0.0023, 2, 0.4, 0.6667, 491, 3, 1, 0, 0, 821, 10, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": "\t\tp = re.compile(r\".. (?P<name>\\S+)\\s+(?P<ver>\\S+)\\s+(?P<desc>.*)\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L273_C2", "label": "for d", "type": "for", "loc": [273, 280], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L269_C1", "vector": [6, 2, 0.6356, 0.0184, 2, 0.4, 1.0, 355, 2, 0, 0, 0, 0, 0, 6], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor d in data:\n\t\t\tm = p.match(d)\n\t\t\tif m:\n\t\t\t\tname = m.group(1)\n\t\t\t\tversion = m.group(2)\n\t\t\t\tdesc = m.group(3)\n\t\t\t\tpk = pkt(name, version, desc)\n\t\t\t\tself.packages.append(pk)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L274_C3", "label": "m = match()", "type": "assigned_variable", "loc": [274, 274], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L273_C2", "vector": [14, 3, 0.6299, 0.0023, 3, 0.15, 0.0, 711, 3, 1, 0, 0, 36, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "match", "annotation": ""}, "snippet": "\t\t\tm = p.match(d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L275_C3", "label": "if", "type": "if", "loc": [275, 280], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L273_C2", "vector": [4, 3, 0.6379, 0.0138, 3, 0.15, 1.0, 0, 2, 0, 0, 0, 0, 0, 5], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif m:\n\t\t\t\tname = m.group(1)\n\t\t\t\tversion = m.group(2)\n\t\t\t\tdesc = m.group(3)\n\t\t\t\tpk = pkt(name, version, desc)\n\t\t\t\tself.packages.append(pk)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L276_C4", "label": "name = group()", "type": "assigned_variable", "loc": [276, 276], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L275_C3", "vector": [14, 4, 0.6345, 0.0023, 4, 0.3, 0.0, 57, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\t\t\tname = m.group(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L277_C4", "label": "version = group()", "type": "assigned_variable", "loc": [277, 277], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L275_C3", "vector": [14, 4, 0.6368, 0.0023, 4, 0.3, 0.25, 623, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "version", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\t\t\tversion = m.group(2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L278_C4", "label": "desc = group()", "type": "assigned_variable", "loc": [278, 278], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L275_C3", "vector": [14, 4, 0.6391, 0.0023, 4, 0.3, 0.5, 796, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "desc", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\t\t\tdesc = m.group(3)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L279_C4", "label": "pk = pkt()", "type": "assigned_variable", "loc": [279, 279], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L275_C3", "vector": [14, 4, 0.6414, 0.0023, 4, 0.3, 0.75, 164, 3, 3, 0, 0, 180, 10, 1], "semantic": {"name": "pk", "arg_names": [], "import_names": [], "rhs_call_name": "pkt", "annotation": ""}, "snippet": "\t\t\t\tpk = pkt(name, version, desc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L280_C4", "label": "append()", "type": "expression", "loc": [280, 280], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L275_C3", "vector": [8, 4, 0.6437, 0.0023, 4, 0.3, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": "\t\t\t\tself.packages.append(pk)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L282_C0", "label": "pfringInfo", "type": "class", "loc": [282, 313], "level": 0, "parent": null, "vector": [3, 0, 0.6839, 0.0736, 0, 0.66, 0.8, 527, 0, 2, 0, 0, 0, 0, 21], "semantic": {"name": "pfringInfo", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class pfringInfo():\n\tdef __init__(self):\n\t\tself.checkInfo()\n\t\t\n\tdef checkInfo(self):\n\t\tdata = commands.getstatusoutput('cat /proc/net/pf_ring/info')[1]\n\t\tdata = data.split('\\n')\n\t\tif len(data) == 8:"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L283_C1", "label": "__init__", "type": "function", "loc": [283, 284], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L282_C0", "vector": [2, 1, 0.6517, 0.0046, 1, 0.57, 0.0, 555, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __init__(self):\n\t\tself.checkInfo()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L284_C2", "label": "checkInfo()", "type": "expression", "loc": [284, 284], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L283_C1", "vector": [8, 2, 0.6529, 0.0023, 2, 0.03, 0.0, 369, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "checkInfo", "arg_names": [], "import_names": [], "rhs_call_name": "checkInfo", "annotation": ""}, "snippet": "\t\tself.checkInfo()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L286_C1", "label": "checkInfo", "type": "function", "loc": [286, 313], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L282_C0", "vector": [2, 1, 0.6885, 0.0644, 1, 0.57, 1.0, 369, 0, 1, 0, 0, 0, 0, 20], "semantic": {"name": "checkInfo", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef checkInfo(self):\n\t\tdata = commands.getstatusoutput('cat /proc/net/pf_ring/info')[1]\n\t\tdata = data.split('\\n')\n\t\tif len(data) == 8:\n\t\t\tp = re.compile(r\"[^:]+: (?P<val>.*)\")\n\t\t\tm = p.match(data[0])\n\t\t\tself.version = m.group(1)\n\t\t\t\t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L287_C2", "label": "data =", "type": "assigned_variable", "loc": [287, 287], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L286_C1", "vector": [14, 2, 0.6598, 0.0023, 2, 0.62, 0.0, 929, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tdata = commands.getstatusoutput('cat /proc/net/pf_ring/info')[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L288_C2", "label": "data = split()", "type": "assigned_variable", "loc": [288, 288], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L286_C1", "vector": [14, 2, 0.6621, 0.0023, 2, 0.62, 0.5, 929, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": "\t\tdata = data.split('\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L289_C2", "label": "if", "type": "if", "loc": [289, 313], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L286_C1", "vector": [4, 2, 0.692, 0.0575, 2, 0.62, 1.0, 0, 0, 0, 0, 0, 0, 0, 18], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tif len(data) == 8:\n\t\t\tp = re.compile(r\"[^:]+: (?P<val>.*)\")\n\t\t\tm = p.match(data[0])\n\t\t\tself.version = m.group(1)\n\t\t\t\t\n\t\t\tm = p.match(data[1])\n\t\t\tself.slots = m.group(1)\n\t\t\t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L290_C3", "label": "p = compile()", "type": "assigned_variable", "loc": [290, 290], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L289_C2", "vector": [14, 3, 0.6667, 0.0023, 3, 0.28, 0.0, 491, 3, 1, 0, 0, 821, 10, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": "\t\t\tp = re.compile(r\"[^:]+: (?P<val>.*)\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L291_C3", "label": "m = match()", "type": "assigned_variable", "loc": [291, 291], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L289_C2", "vector": [14, 3, 0.669, 0.0023, 3, 0.28, 0.0625, 711, 3, 1, 0, 0, 36, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "match", "annotation": ""}, "snippet": "\t\t\tm = p.match(data[0])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L292_C3", "label": "self.version = group()", "type": "assigned_variable", "loc": [292, 292], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L289_C2", "vector": [14, 3, 0.6713, 0.0023, 3, 0.28, 0.125, 686, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "self.version", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\t\tself.version = m.group(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L294_C3", "label": "m = match()", "type": "assigned_variable", "loc": [294, 294], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L289_C2", "vector": [14, 3, 0.6759, 0.0023, 3, 0.28, 0.1875, 711, 3, 1, 0, 0, 36, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "match", "annotation": ""}, "snippet": "\t\t\tm = p.match(data[1])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L295_C3", "label": "self.slots = group()", "type": "assigned_variable", "loc": [295, 295], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L289_C2", "vector": [14, 3, 0.6782, 0.0023, 3, 0.28, 0.25, 377, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "self.slots", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\t\tself.slots = m.group(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L297_C3", "label": "m = match()", "type": "assigned_variable", "loc": [297, 297], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L289_C2", "vector": [14, 3, 0.6828, 0.0023, 3, 0.28, 0.3125, 711, 3, 1, 0, 0, 36, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "match", "annotation": ""}, "snippet": "\t\t\tm = p.match(data[2])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L298_C3", "label": "self.sVersion = group()", "type": "assigned_variable", "loc": [298, 298], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L289_C2", "vector": [14, 3, 0.6851, 0.0023, 3, 0.28, 0.375, 973, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "self.sVersion", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\t\tself.sVersion = m.group(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L300_C3", "label": "m = match()", "type": "assigned_variable", "loc": [300, 300], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L289_C2", "vector": [14, 3, 0.6897, 0.0023, 3, 0.28, 0.4375, 711, 3, 1, 0, 0, 36, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "match", "annotation": ""}, "snippet": "\t\t\tm = p.match(data[3])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L301_C3", "label": "self.cTX = group()", "type": "assigned_variable", "loc": [301, 301], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L289_C2", "vector": [14, 3, 0.692, 0.0023, 3, 0.28, 0.5, 366, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "self.cTX", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\t\tself.cTX = m.group(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L303_C3", "label": "m = match()", "type": "assigned_variable", "loc": [303, 303], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L289_C2", "vector": [14, 3, 0.6966, 0.0023, 3, 0.28, 0.5625, 711, 3, 1, 0, 0, 36, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "match", "annotation": ""}, "snippet": "\t\t\tm = p.match(data[4])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L304_C3", "label": "self.defrag = group()", "type": "assigned_variable", "loc": [304, 304], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L289_C2", "vector": [14, 3, 0.6989, 0.0023, 3, 0.28, 0.625, 659, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "self.defrag", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\t\tself.defrag = m.group(1)\t\t\t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L306_C3", "label": "m = match()", "type": "assigned_variable", "loc": [306, 306], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L289_C2", "vector": [14, 3, 0.7034, 0.0023, 3, 0.28, 0.6875, 711, 3, 1, 0, 0, 36, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "match", "annotation": ""}, "snippet": "\t\t\tm = p.match(data[5])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L307_C3", "label": "self.transparentMode = group()", "type": "assigned_variable", "loc": [307, 307], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L289_C2", "vector": [14, 3, 0.7057, 0.0023, 3, 0.28, 0.75, 832, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "self.transparentMode", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\t\tself.transparentMode = m.group(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L309_C3", "label": "m = match()", "type": "assigned_variable", "loc": [309, 309], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L289_C2", "vector": [14, 3, 0.7103, 0.0023, 3, 0.28, 0.8125, 711, 3, 1, 0, 0, 36, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "match", "annotation": ""}, "snippet": "\t\t\tm = p.match(data[6])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L310_C3", "label": "self.rings = group()", "type": "assigned_variable", "loc": [310, 310], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L289_C2", "vector": [14, 3, 0.7126, 0.0023, 3, 0.28, 0.875, 992, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "self.rings", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\t\tself.rings = m.group(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L312_C3", "label": "m = match()", "type": "assigned_variable", "loc": [312, 312], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L289_C2", "vector": [14, 3, 0.7172, 0.0023, 3, 0.28, 0.9375, 711, 3, 1, 0, 0, 36, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "match", "annotation": ""}, "snippet": "\t\t\tm = p.match(data[7])"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L313_C3", "label": "self.plugins = group()", "type": "assigned_variable", "loc": [313, 313], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L289_C2", "vector": [14, 3, 0.7195, 0.0023, 3, 0.28, 1.0, 424, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "self.plugins", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\t\tself.plugins = m.group(1)\t\t\t\t"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L316_C0", "label": "kParam", "type": "class", "loc": [316, 319], "level": 0, "parent": null, "vector": [3, 0, 0.7299, 0.0092, 0, 0.66, 0.84, 731, 0, 1, 0, 0, 0, 0, 0], "semantic": {"name": "kParam", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class kParam():\n\tdef __init__(self, name, val):\n\t\tself.name = name\n\t\tself.val = val"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L317_C1", "label": "__init__", "type": "function", "loc": [317, 319], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L316_C0", "vector": [2, 1, 0.731, 0.0069, 1, 0.6, 0.0, 555, 0, 3, 0, 0, 0, 0, 0], "semantic": {"name": "__init__", "arg_names": ["self", "name", "val"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __init__(self, name, val):\n\t\tself.name = name\n\t\tself.val = val"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L318_C2", "label": "self.name =", "type": "assigned_variable", "loc": [318, 318], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L317_C1", "vector": [14, 2, 0.731, 0.0023, 2, 0.94, 0.0, 689, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.name", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.name = name"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L319_C2", "label": "self.val =", "type": "assigned_variable", "loc": [319, 319], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L317_C1", "vector": [14, 2, 0.7333, 0.0023, 2, 0.94, 1.0, 305, 2, 0, 0, 0, 0, 0, 0], "semantic": {"name": "self.val", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.val = val"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L321_C0", "label": "kernelInfo", "type": "class", "loc": [321, 337], "level": 0, "parent": null, "vector": [3, 0, 0.7563, 0.0391, 0, 0.66, 0.88, 251, 0, 2, 0, 0, 0, 0, 9], "semantic": {"name": "kernelInfo", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class kernelInfo():\n\tdef __init__(self):\n\t\tself.parametes = []\n\t\tself.version = ''\n\t\tself.checkInfo()\n\t\t\n\tdef checkInfo(self):\n\t\tdata = commands.getstatusoutput('sysctl -a')[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L322_C1", "label": "__init__", "type": "function", "loc": [322, 325], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L321_C0", "vector": [2, 1, 0.7437, 0.0092, 1, 0.28, 0.0, 555, 0, 1, 0, 0, 0, 0, 1], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __init__(self):\n\t\tself.parametes = []\n\t\tself.version = ''\n\t\tself.checkInfo()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L323_C2", "label": "self.parametes =", "type": "assigned_variable", "loc": [323, 323], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L322_C1", "vector": [14, 2, 0.7425, 0.0023, 2, 0.7, 0.0, 125, 0, 0, 0, 0, 0, 5, 0], "semantic": {"name": "self.parametes", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.parametes = []"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L324_C2", "label": "self.version =", "type": "assigned_variable", "loc": [324, 324], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L322_C1", "vector": [14, 2, 0.7448, 0.0023, 2, 0.7, 0.5, 686, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "self.version", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tself.version = ''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L325_C2", "label": "checkInfo()", "type": "expression", "loc": [325, 325], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L322_C1", "vector": [8, 2, 0.7471, 0.0023, 2, 0.7, 1.0, 369, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "checkInfo", "arg_names": [], "import_names": [], "rhs_call_name": "checkInfo", "annotation": ""}, "snippet": "\t\tself.checkInfo()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L327_C1", "label": "checkInfo", "type": "function", "loc": [327, 337], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L321_C0", "vector": [2, 1, 0.7632, 0.0253, 1, 0.28, 1.0, 369, 0, 1, 0, 0, 0, 0, 8], "semantic": {"name": "checkInfo", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef checkInfo(self):\n\t\tdata = commands.getstatusoutput('sysctl -a')[1]\n\t\tdata = data.split('\\n')\n\t\tp = re.compile(r\"(?P<name>[^\\s]+)\\s=\\s(?P<val>.*)\")\n\t\tfor d in data:\n\t\t\tm = p.match(d)\n\t\t\tif m:\n\t\t\t\tname = m.group(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L328_C2", "label": "data =", "type": "assigned_variable", "loc": [328, 328], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L327_C1", "vector": [14, 2, 0.754, 0.0023, 2, 0.21, 0.0, 929, 6, 0, 0, 0, 0, 0, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tdata = commands.getstatusoutput('sysctl -a')[1]"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L329_C2", "label": "data = split()", "type": "assigned_variable", "loc": [329, 329], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L327_C1", "vector": [14, 2, 0.7563, 0.0023, 2, 0.21, 0.3333, 929, 3, 1, 0, 0, 908, 10, 1], "semantic": {"name": "data", "arg_names": [], "import_names": [], "rhs_call_name": "split", "annotation": ""}, "snippet": "\t\tdata = data.split('\\n')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L330_C2", "label": "p = compile()", "type": "assigned_variable", "loc": [330, 330], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L327_C1", "vector": [14, 2, 0.7586, 0.0023, 2, 0.21, 0.6667, 491, 3, 1, 0, 0, 821, 10, 1], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "compile", "annotation": ""}, "snippet": "\t\tp = re.compile(r\"(?P<name>[^\\s]+)\\s=\\s(?P<val>.*)\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L331_C2", "label": "for d", "type": "for", "loc": [331, 337], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L327_C1", "vector": [6, 2, 0.7678, 0.0161, 2, 0.21, 1.0, 355, 2, 0, 0, 0, 0, 0, 5], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor d in data:\n\t\t\tm = p.match(d)\n\t\t\tif m:\n\t\t\t\tname = m.group(1)\n\t\t\t\tval = m.group(2)\n\t\t\t\tkP = kParam(name, val)\n\t\t\t\tself.parametes.append(kP)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L332_C3", "label": "m = match()", "type": "assigned_variable", "loc": [332, 332], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L331_C2", "vector": [14, 3, 0.7632, 0.0023, 3, 0.79, 0.0, 711, 3, 1, 0, 0, 36, 10, 1], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "match", "annotation": ""}, "snippet": "\t\t\tm = p.match(d)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L333_C3", "label": "if", "type": "if", "loc": [333, 337], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L331_C2", "vector": [4, 3, 0.7701, 0.0115, 3, 0.79, 1.0, 0, 2, 0, 0, 0, 0, 0, 4], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif m:\n\t\t\t\tname = m.group(1)\n\t\t\t\tval = m.group(2)\n\t\t\t\tkP = kParam(name, val)\n\t\t\t\tself.parametes.append(kP)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L334_C4", "label": "name = group()", "type": "assigned_variable", "loc": [334, 334], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L333_C3", "vector": [14, 4, 0.7678, 0.0023, 4, 0.53, 0.0, 57, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "name", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\t\t\tname = m.group(1)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L335_C4", "label": "val = group()", "type": "assigned_variable", "loc": [335, 335], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L333_C3", "vector": [14, 4, 0.7701, 0.0023, 4, 0.53, 0.3333, 618, 3, 1, 0, 0, 43, 10, 1], "semantic": {"name": "val", "arg_names": [], "import_names": [], "rhs_call_name": "group", "annotation": ""}, "snippet": "\t\t\t\tval = m.group(2)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L336_C4", "label": "kP = kParam()", "type": "assigned_variable", "loc": [336, 336], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L333_C3", "vector": [14, 4, 0.7724, 0.0023, 4, 0.53, 0.6667, 570, 3, 2, 0, 0, 731, 10, 1], "semantic": {"name": "kP", "arg_names": [], "import_names": [], "rhs_call_name": "kParam", "annotation": ""}, "snippet": "\t\t\t\tkP = kParam(name, val)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L337_C4", "label": "append()", "type": "expression", "loc": [337, 337], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L333_C3", "vector": [8, 4, 0.7747, 0.0023, 4, 0.53, 1.0, 243, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "append", "arg_names": [], "import_names": [], "rhs_call_name": "append", "annotation": ""}, "snippet": "\t\t\t\tself.parametes.append(kP)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L339_C0", "label": "systemInfo", "type": "class", "loc": [339, 428], "level": 0, "parent": null, "vector": [3, 0, 0.8816, 0.2069, 0, 0.66, 0.92, 288, 0, 3, 0, 0, 0, 0, 49], "semantic": {"name": "systemInfo", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class systemInfo():\n\tdef __init__(self):\n\t\tself.disk = diskInfo()\n\t\tself.mem = memInfo()\n\t\tself.cpu = cpuInfo()\n\t\tself.pci = pciInfo()\n\t\tself.network = networkInfo()\n\t\tself.packages = packageInfo()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L340_C1", "label": "__init__", "type": "function", "loc": [340, 348], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L339_C0", "vector": [2, 1, 0.7908, 0.0207, 1, 0.86, 0.0, 555, 0, 1, 0, 0, 0, 0, 8], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef __init__(self):\n\t\tself.disk = diskInfo()\n\t\tself.mem = memInfo()\n\t\tself.cpu = cpuInfo()\n\t\tself.pci = pciInfo()\n\t\tself.network = networkInfo()\n\t\tself.packages = packageInfo()\n\t\tself.pfring = pfringInfo()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L341_C2", "label": "self.disk = diskInfo()", "type": "assigned_variable", "loc": [341, 341], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L340_C1", "vector": [14, 2, 0.7839, 0.0023, 2, 0.33, 0.0, 81, 3, 0, 0, 0, 28, 10, 1], "semantic": {"name": "self.disk", "arg_names": [], "import_names": [], "rhs_call_name": "diskInfo", "annotation": ""}, "snippet": "\t\tself.disk = diskInfo()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L342_C2", "label": "self.mem = memInfo()", "type": "assigned_variable", "loc": [342, 342], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L340_C1", "vector": [14, 2, 0.7862, 0.0023, 2, 0.33, 0.1429, 725, 3, 0, 0, 0, 661, 10, 1], "semantic": {"name": "self.mem", "arg_names": [], "import_names": [], "rhs_call_name": "memInfo", "annotation": ""}, "snippet": "\t\tself.mem = memInfo()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L343_C2", "label": "self.cpu = cpuInfo()", "type": "assigned_variable", "loc": [343, 343], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L340_C1", "vector": [14, 2, 0.7885, 0.0023, 2, 0.33, 0.2857, 289, 3, 0, 0, 0, 934, 10, 1], "semantic": {"name": "self.cpu", "arg_names": [], "import_names": [], "rhs_call_name": "cpuInfo", "annotation": ""}, "snippet": "\t\tself.cpu = cpuInfo()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L344_C2", "label": "self.pci = pciInfo()", "type": "assigned_variable", "loc": [344, 344], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L340_C1", "vector": [14, 2, 0.7908, 0.0023, 2, 0.33, 0.4286, 714, 3, 0, 0, 0, 477, 10, 1], "semantic": {"name": "self.pci", "arg_names": [], "import_names": [], "rhs_call_name": "pciInfo", "annotation": ""}, "snippet": "\t\tself.pci = pciInfo()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L345_C2", "label": "self.network = networkInfo()", "type": "assigned_variable", "loc": [345, 345], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L340_C1", "vector": [14, 2, 0.7931, 0.0023, 2, 0.33, 0.5714, 703, 3, 0, 0, 0, 40, 10, 1], "semantic": {"name": "self.network", "arg_names": [], "import_names": [], "rhs_call_name": "networkInfo", "annotation": ""}, "snippet": "\t\tself.network = networkInfo()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L346_C2", "label": "self.packages = packageInfo()", "type": "assigned_variable", "loc": [346, 346], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L340_C1", "vector": [14, 2, 0.7954, 0.0023, 2, 0.33, 0.7143, 473, 3, 0, 0, 0, 470, 10, 1], "semantic": {"name": "self.packages", "arg_names": [], "import_names": [], "rhs_call_name": "packageInfo", "annotation": ""}, "snippet": "\t\tself.packages = packageInfo()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L347_C2", "label": "self.pfring = pfringInfo()", "type": "assigned_variable", "loc": [347, 347], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L340_C1", "vector": [14, 2, 0.7977, 0.0023, 2, 0.33, 0.8571, 460, 3, 0, 0, 0, 527, 10, 1], "semantic": {"name": "self.pfring", "arg_names": [], "import_names": [], "rhs_call_name": "pfringInfo", "annotation": ""}, "snippet": "\t\tself.pfring = pfringInfo()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L348_C2", "label": "self.kernel = kernelInfo()", "type": "assigned_variable", "loc": [348, 348], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L340_C1", "vector": [14, 2, 0.8, 0.0023, 2, 0.33, 1.0, 883, 3, 0, 0, 0, 251, 10, 1], "semantic": {"name": "self.kernel", "arg_names": [], "import_names": [], "rhs_call_name": "kernelInfo", "annotation": ""}, "snippet": "\t\tself.kernel = kernelInfo()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L350_C1", "label": "xmlOut", "type": "function", "loc": [350, 425], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L339_C0", "vector": [2, 1, 0.8908, 0.1747, 1, 0.86, 0.5, 747, 0, 2, 0, 0, 0, 0, 41], "semantic": {"name": "xmlOut", "arg_names": ["self", "fileName"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef xmlOut(self, fileName):\n\t\txmlStr = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>' \\\n\t\t '<system></system>'\n\t\tx = XMLFile(raw=xmlStr)\n\t\tsystem = x.root\n\t\t\n\t\t#CPU\n\t\txcp = system._addNode(\"cpuInfo\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L351_C2", "label": "xmlStr =", "type": "assigned_variable", "loc": [351, 352], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L350_C1", "vector": [14, 2, 0.808, 0.0046, 2, 0.5, 0.0, 453, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "xmlStr", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\txmlStr = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>' \\\n\t\t '<system></system>'"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L353_C2", "label": "x = XMLFile()", "type": "assigned_variable", "loc": [353, 353], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L350_C1", "vector": [14, 2, 0.8115, 0.0023, 2, 0.5, 0.0476, 190, 3, 1, 0, 0, 539, 10, 1], "semantic": {"name": "x", "arg_names": [], "import_names": [], "rhs_call_name": "XMLFile", "annotation": ""}, "snippet": "\t\tx = XMLFile(raw=xmlStr)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L354_C2", "label": "system =", "type": "assigned_variable", "loc": [354, 354], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L350_C1", "vector": [14, 2, 0.8138, 0.0023, 2, 0.5, 0.0952, 856, 7, 0, 0, 0, 0, 0, 0], "semantic": {"name": "system", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tsystem = x.root"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L357_C2", "label": "xcp = _addNode()", "type": "assigned_variable", "loc": [357, 357], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L350_C1", "vector": [14, 2, 0.8207, 0.0023, 2, 0.5, 0.1429, 730, 3, 1, 0, 0, 843, 10, 1], "semantic": {"name": "xcp", "arg_names": [], "import_names": [], "rhs_call_name": "_addNode", "annotation": ""}, "snippet": "\t\txcp = system._addNode(\"cpuInfo\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L358_C2", "label": "for c", "type": "for", "loc": [358, 363], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L350_C1", "vector": [6, 2, 0.8287, 0.0138, 2, 0.5, 0.1905, 411, 7, 0, 0, 0, 0, 0, 4], "semantic": {"name": "c", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor c in self.cpu.cpus:\n\t\t\txc = xcp._addNode(\"cpu\")\n\t\t\tfor att in dir(c):\n\t\t\t\tif att[0] != '_':\n\t\t\t\t\texec(\"xc.%s = c.%s\" % (att, att))\n\t\t\txcp._addNode(xc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L359_C3", "label": "xc = _addNode()", "type": "assigned_variable", "loc": [359, 359], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L358_C2", "vector": [14, 3, 0.8253, 0.0023, 3, 0.07, 0.0, 132, 3, 1, 0, 0, 843, 10, 1], "semantic": {"name": "xc", "arg_names": [], "import_names": [], "rhs_call_name": "_addNode", "annotation": ""}, "snippet": "\t\t\txc = xcp._addNode(\"cpu\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L360_C3", "label": "for att", "type": "for", "loc": [360, 362], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L358_C2", "vector": [6, 3, 0.8299, 0.0069, 3, 0.07, 0.5, 734, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "att", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tfor att in dir(c):\n\t\t\t\tif att[0] != '_':\n\t\t\t\t\texec(\"xc.%s = c.%s\" % (att, att))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L361_C4", "label": "if", "type": "if", "loc": [361, 362], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L360_C3", "vector": [4, 4, 0.831, 0.0046, 4, 0.56, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tif att[0] != '_':\n\t\t\t\t\texec(\"xc.%s = c.%s\" % (att, att))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L362_C5", "label": "exec()", "type": "expression", "loc": [362, 362], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L361_C4", "vector": [8, 5, 0.8322, 0.0023, 5, 0.14, 0.0, 272, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "exec", "arg_names": [], "import_names": [], "rhs_call_name": "exec", "annotation": ""}, "snippet": "\t\t\t\t\texec(\"xc.%s = c.%s\" % (att, att))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L363_C3", "label": "_addNode()", "type": "expression", "loc": [363, 363], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L358_C2", "vector": [8, 3, 0.8345, 0.0023, 3, 0.07, 1.0, 843, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_addNode", "arg_names": [], "import_names": [], "rhs_call_name": "_addNode", "annotation": ""}, "snippet": "\t\t\txcp._addNode(xc)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L366_C2", "label": "xme = _addNode()", "type": "assigned_variable", "loc": [366, 366], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L350_C1", "vector": [14, 2, 0.8414, 0.0023, 2, 0.5, 0.2381, 754, 3, 1, 0, 0, 843, 10, 1], "semantic": {"name": "xme", "arg_names": [], "import_names": [], "rhs_call_name": "_addNode", "annotation": ""}, "snippet": "\t\txme = system._addNode(\"memInfo\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L367_C2", "label": "for att", "type": "for", "loc": [367, 369], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L350_C1", "vector": [6, 2, 0.846, 0.0069, 2, 0.5, 0.2857, 734, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "att", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor att in dir(self.mem):\n\t\t\tif att[0] != '_' and att != \"checkInfo\":\n\t\t\t\texec(\"xme.%s = self.mem.%s\" % (att, att))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L368_C3", "label": "if", "type": "if", "loc": [368, 369], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L367_C2", "vector": [4, 3, 0.8471, 0.0046, 3, 0.73, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif att[0] != '_' and att != \"checkInfo\":\n\t\t\t\texec(\"xme.%s = self.mem.%s\" % (att, att))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L369_C4", "label": "exec()", "type": "expression", "loc": [369, 369], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L368_C3", "vector": [8, 4, 0.8483, 0.0023, 4, 0.52, 0.0, 272, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "exec", "arg_names": [], "import_names": [], "rhs_call_name": "exec", "annotation": ""}, "snippet": "\t\t\t\texec(\"xme.%s = self.mem.%s\" % (att, att))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L372_C2", "label": "xdi = _addNode()", "type": "assigned_variable", "loc": [372, 372], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L350_C1", "vector": [14, 2, 0.8552, 0.0023, 2, 0.5, 0.3333, 11, 3, 1, 0, 0, 843, 10, 1], "semantic": {"name": "xdi", "arg_names": [], "import_names": [], "rhs_call_name": "_addNode", "annotation": ""}, "snippet": "\t\txdi = system._addNode(\"diskInfo\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L373_C2", "label": "for d", "type": "for", "loc": [373, 378], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L350_C1", "vector": [6, 2, 0.8632, 0.0138, 2, 0.5, 0.381, 355, 7, 0, 0, 0, 0, 0, 4], "semantic": {"name": "d", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor d in self.disk.disks:\n\t\t\txdis = xdi._addNode(\"disk\")\n\t\t\tfor att in dir(d):\n\t\t\t\tif att[0] != '_' and att != \"timeRead\":\n\t\t\t\t\texec(\"xdis.%s = d.%s\" % (att, att))\n\t\t\t\txdi._addNode(xdis)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L374_C3", "label": "xdis = _addNode()", "type": "assigned_variable", "loc": [374, 374], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L373_C2", "vector": [14, 3, 0.8598, 0.0023, 3, 0.42, 0.0, 695, 3, 1, 0, 0, 843, 10, 1], "semantic": {"name": "xdis", "arg_names": [], "import_names": [], "rhs_call_name": "_addNode", "annotation": ""}, "snippet": "\t\t\txdis = xdi._addNode(\"disk\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L375_C3", "label": "for att", "type": "for", "loc": [375, 378], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L373_C2", "vector": [6, 3, 0.8655, 0.0092, 3, 0.42, 1.0, 734, 3, 0, 0, 0, 0, 0, 3], "semantic": {"name": "att", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tfor att in dir(d):\n\t\t\t\tif att[0] != '_' and att != \"timeRead\":\n\t\t\t\t\texec(\"xdis.%s = d.%s\" % (att, att))\n\t\t\t\txdi._addNode(xdis)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L376_C4", "label": "if", "type": "if", "loc": [376, 377], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L375_C3", "vector": [4, 4, 0.8655, 0.0046, 4, 0.36, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tif att[0] != '_' and att != \"timeRead\":\n\t\t\t\t\texec(\"xdis.%s = d.%s\" % (att, att))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L377_C5", "label": "exec()", "type": "expression", "loc": [377, 377], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L376_C4", "vector": [8, 5, 0.8667, 0.0023, 5, 0.4, 0.0, 272, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "exec", "arg_names": [], "import_names": [], "rhs_call_name": "exec", "annotation": ""}, "snippet": "\t\t\t\t\texec(\"xdis.%s = d.%s\" % (att, att))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L378_C4", "label": "_addNode()", "type": "expression", "loc": [378, 378], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L375_C3", "vector": [8, 4, 0.869, 0.0023, 4, 0.36, 1.0, 843, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_addNode", "arg_names": [], "import_names": [], "rhs_call_name": "_addNode", "annotation": ""}, "snippet": "\t\t\t\txdi._addNode(xdis)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L381_C2", "label": "xpci = _addNode()", "type": "assigned_variable", "loc": [381, 381], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L350_C1", "vector": [14, 2, 0.8759, 0.0023, 2, 0.5, 0.4286, 646, 3, 1, 0, 0, 843, 10, 1], "semantic": {"name": "xpci", "arg_names": [], "import_names": [], "rhs_call_name": "_addNode", "annotation": ""}, "snippet": "\t\txpci = system._addNode(\"pciInfo\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L382_C2", "label": "for m", "type": "for", "loc": [382, 387], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L350_C1", "vector": [6, 2, 0.8839, 0.0138, 2, 0.5, 0.4762, 711, 7, 0, 0, 0, 0, 0, 4], "semantic": {"name": "m", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor m in self.pci.devices:\n\t\t\txp = xpci._addNode(\"pciModule\")\n\t\t\tfor att in dir(m):\n\t\t\t\tif att[0] != '_':\n\t\t\t\t\texec(\"xp.%s = m.%s\" % (att, att))\n\t\t\txpci._addNode(xp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L383_C3", "label": "xp = _addNode()", "type": "assigned_variable", "loc": [383, 383], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L382_C2", "vector": [14, 3, 0.8805, 0.0023, 3, 0.38, 0.0, 575, 3, 1, 0, 0, 843, 10, 1], "semantic": {"name": "xp", "arg_names": [], "import_names": [], "rhs_call_name": "_addNode", "annotation": ""}, "snippet": "\t\t\txp = xpci._addNode(\"pciModule\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L384_C3", "label": "for att", "type": "for", "loc": [384, 386], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L382_C2", "vector": [6, 3, 0.8851, 0.0069, 3, 0.38, 0.5, 734, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "att", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tfor att in dir(m):\n\t\t\t\tif att[0] != '_':\n\t\t\t\t\texec(\"xp.%s = m.%s\" % (att, att))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L385_C4", "label": "if", "type": "if", "loc": [385, 386], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L384_C3", "vector": [4, 4, 0.8862, 0.0046, 4, 0.71, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tif att[0] != '_':\n\t\t\t\t\texec(\"xp.%s = m.%s\" % (att, att))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L386_C5", "label": "exec()", "type": "expression", "loc": [386, 386], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L385_C4", "vector": [8, 5, 0.8874, 0.0023, 5, 0.65, 0.0, 272, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "exec", "arg_names": [], "import_names": [], "rhs_call_name": "exec", "annotation": ""}, "snippet": "\t\t\t\t\texec(\"xp.%s = m.%s\" % (att, att))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L387_C3", "label": "_addNode()", "type": "expression", "loc": [387, 387], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L382_C2", "vector": [8, 3, 0.8897, 0.0023, 3, 0.38, 1.0, 843, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_addNode", "arg_names": [], "import_names": [], "rhs_call_name": "_addNode", "annotation": ""}, "snippet": "\t\t\txpci._addNode(xp)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L390_C2", "label": "xpac = _addNode()", "type": "assigned_variable", "loc": [390, 390], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L350_C1", "vector": [14, 2, 0.8966, 0.0023, 2, 0.5, 0.5238, 663, 3, 1, 0, 0, 843, 10, 1], "semantic": {"name": "xpac", "arg_names": [], "import_names": [], "rhs_call_name": "_addNode", "annotation": ""}, "snippet": "\t\txpac = system._addNode(\"packages\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L391_C2", "label": "for p", "type": "for", "loc": [391, 396], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L350_C1", "vector": [6, 2, 0.9046, 0.0138, 2, 0.5, 0.5714, 491, 7, 0, 0, 0, 0, 0, 4], "semantic": {"name": "p", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor p in self.packages.packages:\n\t\t\txpa = xpac._addNode(\"package\")\n\t\t\tfor att in dir(p):\n\t\t\t\tif att[0] != '_':\n\t\t\t\t\texec(\"xpa.%s = p.%s\" % (att,att))\n\t\t\txpac._addNode(xpa)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L392_C3", "label": "xpa = _addNode()", "type": "assigned_variable", "loc": [392, 392], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L391_C2", "vector": [14, 3, 0.9011, 0.0023, 3, 0.39, 0.0, 578, 3, 1, 0, 0, 843, 10, 1], "semantic": {"name": "xpa", "arg_names": [], "import_names": [], "rhs_call_name": "_addNode", "annotation": ""}, "snippet": "\t\t\txpa = xpac._addNode(\"package\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L393_C3", "label": "for att", "type": "for", "loc": [393, 395], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L391_C2", "vector": [6, 3, 0.9057, 0.0069, 3, 0.39, 0.5, 734, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "att", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tfor att in dir(p):\n\t\t\t\tif att[0] != '_':\n\t\t\t\t\texec(\"xpa.%s = p.%s\" % (att,att))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L394_C4", "label": "if", "type": "if", "loc": [394, 395], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L393_C3", "vector": [4, 4, 0.9069, 0.0046, 4, 0.09, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tif att[0] != '_':\n\t\t\t\t\texec(\"xpa.%s = p.%s\" % (att,att))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L395_C5", "label": "exec()", "type": "expression", "loc": [395, 395], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L394_C4", "vector": [8, 5, 0.908, 0.0023, 5, 0.47, 0.0, 272, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "exec", "arg_names": [], "import_names": [], "rhs_call_name": "exec", "annotation": ""}, "snippet": "\t\t\t\t\texec(\"xpa.%s = p.%s\" % (att,att))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L396_C3", "label": "_addNode()", "type": "expression", "loc": [396, 396], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L391_C2", "vector": [8, 3, 0.9103, 0.0023, 3, 0.39, 1.0, 843, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_addNode", "arg_names": [], "import_names": [], "rhs_call_name": "_addNode", "annotation": ""}, "snippet": "\t\t\txpac._addNode(xpa)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L399_C2", "label": "xker = _addNode()", "type": "assigned_variable", "loc": [399, 399], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L350_C1", "vector": [14, 2, 0.9172, 0.0023, 2, 0.5, 0.619, 617, 3, 1, 0, 0, 843, 10, 1], "semantic": {"name": "xker", "arg_names": [], "import_names": [], "rhs_call_name": "_addNode", "annotation": ""}, "snippet": "\t\txker = system._addNode(\"kernel\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L400_C2", "label": "for k", "type": "for", "loc": [400, 405], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L350_C1", "vector": [6, 2, 0.9253, 0.0138, 2, 0.5, 0.6667, 954, 7, 0, 0, 0, 0, 0, 4], "semantic": {"name": "k", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor k in self.kernel.parametes:\n\t\t\txke = xker._addNode(\"parameter\")\n\t\t\tfor att in dir(k):\n\t\t\t\tif att[0] != '_':\n\t\t\t\t\texec(\"xke.%s = k.%s\" % (att, att))\n\t\t\txker._addNode(xke)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L401_C3", "label": "xke = _addNode()", "type": "assigned_variable", "loc": [401, 401], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L400_C2", "vector": [14, 3, 0.9218, 0.0023, 3, 0.01, 0.0, 56, 3, 1, 0, 0, 843, 10, 1], "semantic": {"name": "xke", "arg_names": [], "import_names": [], "rhs_call_name": "_addNode", "annotation": ""}, "snippet": "\t\t\txke = xker._addNode(\"parameter\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L402_C3", "label": "for att", "type": "for", "loc": [402, 404], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L400_C2", "vector": [6, 3, 0.9264, 0.0069, 3, 0.01, 0.5, 734, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "att", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tfor att in dir(k):\n\t\t\t\tif att[0] != '_':\n\t\t\t\t\texec(\"xke.%s = k.%s\" % (att, att))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L403_C4", "label": "if", "type": "if", "loc": [403, 404], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L402_C3", "vector": [4, 4, 0.9276, 0.0046, 4, 0.1, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tif att[0] != '_':\n\t\t\t\t\texec(\"xke.%s = k.%s\" % (att, att))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L404_C5", "label": "exec()", "type": "expression", "loc": [404, 404], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L403_C4", "vector": [8, 5, 0.9287, 0.0023, 5, 0.44, 0.0, 272, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "exec", "arg_names": [], "import_names": [], "rhs_call_name": "exec", "annotation": ""}, "snippet": "\t\t\t\t\texec(\"xke.%s = k.%s\" % (att, att))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L405_C3", "label": "_addNode()", "type": "expression", "loc": [405, 405], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L400_C2", "vector": [8, 3, 0.931, 0.0023, 3, 0.01, 1.0, 843, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_addNode", "arg_names": [], "import_names": [], "rhs_call_name": "_addNode", "annotation": ""}, "snippet": "\t\t\txker._addNode(xke)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L408_C2", "label": "xpfr = _addNode()", "type": "assigned_variable", "loc": [408, 408], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L350_C1", "vector": [14, 2, 0.9379, 0.0023, 2, 0.5, 0.7143, 591, 3, 1, 0, 0, 843, 10, 1], "semantic": {"name": "xpfr", "arg_names": [], "import_names": [], "rhs_call_name": "_addNode", "annotation": ""}, "snippet": "\t\txpfr = system._addNode(\"pfring\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L409_C2", "label": "for att", "type": "for", "loc": [409, 411], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L350_C1", "vector": [6, 2, 0.9425, 0.0069, 2, 0.5, 0.7619, 734, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "att", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor att in dir(self.pfring):\n\t\t\tif att[0] != '_' and att != \"checkInfo\":\n\t\t\t\texec(\"xpfr.%s = self.pfring.%s\" % (att, att))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L410_C3", "label": "if", "type": "if", "loc": [410, 411], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L409_C2", "vector": [4, 3, 0.9437, 0.0046, 3, 0.98, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tif att[0] != '_' and att != \"checkInfo\":\n\t\t\t\texec(\"xpfr.%s = self.pfring.%s\" % (att, att))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L411_C4", "label": "exec()", "type": "expression", "loc": [411, 411], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L410_C3", "vector": [8, 4, 0.9448, 0.0023, 4, 0.42, 0.0, 272, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "exec", "arg_names": [], "import_names": [], "rhs_call_name": "exec", "annotation": ""}, "snippet": "\t\t\t\texec(\"xpfr.%s = self.pfring.%s\" % (att, att))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L414_C2", "label": "xnet = _addNode()", "type": "assigned_variable", "loc": [414, 414], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L350_C1", "vector": [14, 2, 0.9517, 0.0023, 2, 0.5, 0.8095, 985, 3, 1, 0, 0, 843, 10, 1], "semantic": {"name": "xnet", "arg_names": [], "import_names": [], "rhs_call_name": "_addNode", "annotation": ""}, "snippet": "\t\txnet = system._addNode(\"network\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L415_C2", "label": "for nc", "type": "for", "loc": [415, 420], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L350_C1", "vector": [6, 2, 0.9598, 0.0138, 2, 0.5, 0.8571, 692, 7, 0, 0, 0, 0, 0, 4], "semantic": {"name": "nc", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\tfor nc in self.network.cards:\n\t\t\txn = xnet._addNode(\"card\")\n\t\t\tfor att in dir(nc):\n\t\t\t\tif att[0] != '_' and att != \"getRingParams\":\n\t\t\t\t\texec(\"xn.%s = nc.%s\" % (att,att))\n\t\t\txnet._addNode(xn)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L416_C3", "label": "xn = _addNode()", "type": "assigned_variable", "loc": [416, 416], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L415_C2", "vector": [14, 3, 0.9563, 0.0023, 3, 0.44, 0.0, 39, 3, 1, 0, 0, 843, 10, 1], "semantic": {"name": "xn", "arg_names": [], "import_names": [], "rhs_call_name": "_addNode", "annotation": ""}, "snippet": "\t\t\txn = xnet._addNode(\"card\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L417_C3", "label": "for att", "type": "for", "loc": [417, 419], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L415_C2", "vector": [6, 3, 0.9609, 0.0069, 3, 0.44, 0.5, 734, 3, 0, 0, 0, 0, 0, 2], "semantic": {"name": "att", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\tfor att in dir(nc):\n\t\t\t\tif att[0] != '_' and att != \"getRingParams\":\n\t\t\t\t\texec(\"xn.%s = nc.%s\" % (att,att))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L418_C4", "label": "if", "type": "if", "loc": [418, 419], "level": 4, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L417_C3", "vector": [4, 4, 0.9621, 0.0046, 4, 0.29, 0.0, 0, 0, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\t\t\t\tif att[0] != '_' and att != \"getRingParams\":\n\t\t\t\t\texec(\"xn.%s = nc.%s\" % (att,att))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L419_C5", "label": "exec()", "type": "expression", "loc": [419, 419], "level": 5, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L418_C4", "vector": [8, 5, 0.9632, 0.0023, 5, 0.16, 0.0, 272, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "exec", "arg_names": [], "import_names": [], "rhs_call_name": "exec", "annotation": ""}, "snippet": "\t\t\t\t\texec(\"xn.%s = nc.%s\" % (att,att))"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L420_C3", "label": "_addNode()", "type": "expression", "loc": [420, 420], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L415_C2", "vector": [8, 3, 0.9655, 0.0023, 3, 0.44, 1.0, 843, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "_addNode", "arg_names": [], "import_names": [], "rhs_call_name": "_addNode", "annotation": ""}, "snippet": "\t\t\txnet._addNode(xn)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L423_C2", "label": "f = open()", "type": "assigned_variable", "loc": [423, 423], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L350_C1", "vector": [14, 2, 0.9724, 0.0023, 2, 0.5, 0.9048, 899, 3, 2, 0, 0, 693, 10, 1], "semantic": {"name": "f", "arg_names": [], "import_names": [], "rhs_call_name": "open", "annotation": ""}, "snippet": "\t\tf = open(fileName, 'w')"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L424_C2", "label": "write()", "type": "expression", "loc": [424, 424], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L350_C1", "vector": [8, 2, 0.9747, 0.0023, 2, 0.5, 0.9524, 837, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "write", "arg_names": [], "import_names": [], "rhs_call_name": "write", "annotation": ""}, "snippet": "\t\tf.write(x.toxml())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L425_C2", "label": "close()", "type": "expression", "loc": [425, 425], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L350_C1", "vector": [8, 2, 0.977, 0.0023, 2, 0.5, 1.0, 77, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "close", "arg_names": [], "import_names": [], "rhs_call_name": "close", "annotation": ""}, "snippet": "\t\tf.close()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L427_C1", "label": "applyXSLT", "type": "function", "loc": [427, 428], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L339_C0", "vector": [2, 1, 0.9828, 0.0046, 1, 0.86, 1.0, 872, 0, 2, 0, 0, 0, 0, 0], "semantic": {"name": "applyXSLT", "arg_names": ["self", "fileName"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "\tdef applyXSLT(self, fileName):\n\t\tpass"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L430_C0", "label": "main", "type": "function", "loc": [430, 432], "level": 0, "parent": null, "vector": [2, 0, 0.9908, 0.0069, 0, 0.66, 0.96, 624, 0, 1, 0, 0, 0, 0, 2], "semantic": {"name": "main", "arg_names": ["argv"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "def main(argv=None):\n\ts = systemInfo()\n\ts.xmlOut(\"results.xml\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L431_C1", "label": "s = systemInfo()", "type": "assigned_variable", "loc": [431, 431], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L430_C0", "vector": [14, 1, 0.9908, 0.0023, 1, 0.92, 0.0, 553, 3, 0, 0, 0, 288, 10, 1], "semantic": {"name": "s", "arg_names": [], "import_names": [], "rhs_call_name": "systemInfo", "annotation": ""}, "snippet": "\ts = systemInfo()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L432_C1", "label": "xmlOut()", "type": "expression", "loc": [432, 432], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L430_C0", "vector": [8, 1, 0.9931, 0.0023, 1, 0.92, 1.0, 747, 3, 1, 0, 0, 0, 0, 1], "semantic": {"name": "xmlOut", "arg_names": [], "import_names": [], "rhs_call_name": "xmlOut", "annotation": ""}, "snippet": "\ts.xmlOut(\"results.xml\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L434_C0", "label": "if", "type": "if", "loc": [434, 435], "level": 0, "parent": null, "vector": [4, 0, 0.9989, 0.0046, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == \"__main__\":\n\tsys.exit(main())"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L435_C1", "label": "exit()", "type": "expression", "loc": [435, 435], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L434_C0", "vector": [8, 1, 1.0, 0.0023, 1, 0.7, 0.0, 436, 3, 1, 0, 0, 0, 0, 2], "semantic": {"name": "exit", "arg_names": [], "import_names": [], "rhs_call_name": "exit", "annotation": ""}, "snippet": "\tsys.exit(main())"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L55_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L55_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L56_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L55_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L57_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L55_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L58_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L54_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L60_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L60_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L61_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L60_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L62_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L60_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L63_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L60_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L65_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L60_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L66_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L66_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L67_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L66_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L68_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L68_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Return_L69_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L60_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Return_L70_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L73_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L73_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L74_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L73_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L75_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L72_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L77_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L77_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L78_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L77_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L79_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L77_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L81_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L77_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L82_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L82_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L83_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L82_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L84_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L84_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L85_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L84_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L86_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L84_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L87_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L84_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L88_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L90_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L91_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L91_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L92_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L91_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L93_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L91_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L94_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L91_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L95_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L91_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L96_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L90_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L98_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L98_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L99_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L98_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L100_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L98_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L101_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L98_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L102_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L98_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L103_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L98_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L104_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L98_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L105_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L105_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L106_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L105_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L107_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L107_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L108_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L105_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L109_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L105_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L110_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L110_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L111_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L105_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L112_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L105_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L113_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L113_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L114_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L105_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L115_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L105_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L116_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L116_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L117_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L119_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L120_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L120_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L121_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L120_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L122_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L120_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L123_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L120_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L124_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L120_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L125_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L119_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L127_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L127_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Return_L128_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L119_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L129_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L139_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L140_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L140_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L141_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L140_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L142_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L139_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L144_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L144_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L145_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L144_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L146_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L144_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L147_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L147_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L148_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L139_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L150_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L150_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L151_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L150_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L152_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L150_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L153_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L150_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L154_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L150_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L156_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L150_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L157_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L150_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L158_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L150_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L160_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L150_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L161_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L150_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L162_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L150_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L164_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L150_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L165_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L150_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L166_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L150_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L168_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L150_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L169_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L150_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L170_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L150_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L172_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L150_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L174_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L176_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L177_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L177_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L178_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L177_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L179_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L177_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L180_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L177_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L181_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L177_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L182_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L177_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L183_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L176_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L185_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L185_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Return_L186_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L188_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L189_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L189_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L190_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L189_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L191_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L188_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L193_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L193_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L194_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L193_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L195_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L193_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L196_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L193_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L199_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L199_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L200_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L199_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L201_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L199_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L202_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L199_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L203_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L199_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L204_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L199_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L205_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L199_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L206_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L199_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L207_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L199_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L208_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L210_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L211_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L211_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L212_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L211_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L213_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L211_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L214_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L210_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L216_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L216_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Return_L217_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L210_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L219_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L219_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L220_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L219_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L221_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L219_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L222_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L219_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L223_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L219_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L224_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L219_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L226_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L219_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L227_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L219_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L229_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L219_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L230_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L219_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L232_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L219_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L233_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L236_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L237_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L237_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L238_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L237_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L239_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L236_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L241_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L241_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L242_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L241_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L243_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L241_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L244_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L241_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L246_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L241_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L247_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L247_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L248_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L247_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L249_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L249_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L250_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L249_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L251_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L249_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L252_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L249_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L253_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L255_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L256_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L256_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L257_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L256_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L258_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L256_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L259_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L255_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L261_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L261_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Return_L262_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L264_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L265_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L265_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L266_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L265_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L267_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L264_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L269_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L269_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L270_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L269_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L271_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L269_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L272_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L269_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L273_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L273_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L274_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L273_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L275_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L275_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L276_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L275_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L277_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L275_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L278_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L275_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L279_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L275_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L280_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L282_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L283_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L283_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L284_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L282_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L286_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L286_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L287_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L286_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L288_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L286_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L289_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L289_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L290_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L289_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L291_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L289_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L292_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L289_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L294_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L289_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L295_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L289_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L297_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L289_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L298_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L289_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L300_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L289_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L301_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L289_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L303_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L289_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L304_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L289_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L306_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L289_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L307_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L289_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L309_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L289_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L310_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L289_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L312_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L289_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L313_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L316_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L317_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L317_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L318_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L317_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L319_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L321_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L322_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L322_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L323_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L322_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L324_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L322_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L325_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L321_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L327_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L327_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L328_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L327_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L329_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L327_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L330_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L327_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L331_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L331_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L332_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L331_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L333_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L333_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L334_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L333_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L335_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L333_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L336_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L333_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L337_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L339_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L340_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L340_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L341_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L340_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L342_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L340_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L343_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L340_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L344_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L340_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L345_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L340_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L346_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L340_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L347_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L340_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L348_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L339_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L350_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L350_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L351_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L350_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L353_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L350_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L354_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L350_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L357_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L350_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L358_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L358_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L359_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L358_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L360_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L360_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L361_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L361_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L362_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L358_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L363_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L350_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L366_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L350_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L367_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L367_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L368_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L368_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L369_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L350_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L372_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L350_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L373_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L373_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L374_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L373_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L375_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L375_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L376_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L376_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L377_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L375_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L378_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L350_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L381_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L350_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L382_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L382_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L383_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L382_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L384_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L384_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L385_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L385_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L386_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L382_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L387_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L350_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L390_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L350_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L391_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L391_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L392_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L391_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L393_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L393_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L394_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L394_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L395_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L391_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L396_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L350_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L399_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L350_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L400_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L400_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L401_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L400_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L402_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L402_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L403_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L403_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L404_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L400_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L405_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L350_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L408_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L350_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L409_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L409_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L410_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L410_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L411_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L350_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L414_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L350_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L415_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L415_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L416_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L415_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L417_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L417_C3", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L418_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L418_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L419_C5"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:For_L415_C2", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L420_C3"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L350_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L423_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L350_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L424_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L350_C1", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L425_C2"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:ClassDef_L339_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L427_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L430_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Assign_L431_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:FunctionDef_L430_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L432_C1"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99991:If_L434_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99991:Expr_L435_C1"}] |
'''GTK User Interface code for ClearCutter'''
__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 gtk, gtk.glade, pygtk
class ClearCutterUI:
"""ClearCutter GTK frontend"""
gladefile = ""
wTree = ""
def __init__(self):
self.wTree = gtk.glade.XML("ccui.glade")
#Get the Main Window, and connect the "destroy" event
self.window = self.wTree.get_widget("MainWindow")
if (self.window):
self.window.connect("destroy", gtk.main_quit)
if __name__ == "__main__":
hwg = ClearCutterUI()
gtk.main() | ajibawa-2023/Python-Code-Large/train/row_99992 | 22 | 32 | 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_99992:Expr_L1_C0", "label": "expression", "type": "expression", "loc": [1, 1], "level": 0, "parent": null, "vector": [8, 0, 0.0312, 0.0312, 0, 0.66, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "'''GTK User Interface code for ClearCutter'''"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99992:Assign_L3_C0", "label": "__author__ =", "type": "assigned_variable", "loc": [3, 3], "level": 0, "parent": null, "vector": [14, 0, 0.0938, 0.0312, 0, 0.66, 0.0909, 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_99992:Assign_L4_C0", "label": "__email__ =", "type": "assigned_variable", "loc": [4, 4], "level": 0, "parent": null, "vector": [14, 0, 0.125, 0.0312, 0, 0.66, 0.1818, 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_99992:Assign_L5_C0", "label": "__copyright__ =", "type": "assigned_variable", "loc": [5, 5], "level": 0, "parent": null, "vector": [14, 0, 0.1562, 0.0312, 0, 0.66, 0.2727, 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_99992:Assign_L6_C0", "label": "__credits__ =", "type": "assigned_variable", "loc": [6, 6], "level": 0, "parent": null, "vector": [14, 0, 0.1875, 0.0312, 0, 0.66, 0.3636, 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_99992:Assign_L7_C0", "label": "__version__ =", "type": "assigned_variable", "loc": [7, 7], "level": 0, "parent": null, "vector": [14, 0, 0.2188, 0.0312, 0, 0.66, 0.4545, 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_99992:Assign_L8_C0", "label": "__license__ =", "type": "assigned_variable", "loc": [8, 8], "level": 0, "parent": null, "vector": [14, 0, 0.25, 0.0312, 0, 0.66, 0.5455, 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_99992:Assign_L9_C0", "label": "__status__ =", "type": "assigned_variable", "loc": [9, 9], "level": 0, "parent": null, "vector": [14, 0, 0.2812, 0.0312, 0, 0.66, 0.6364, 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_99992:Assign_L10_C0", "label": "__maintainer__ =", "type": "assigned_variable", "loc": [10, 10], "level": 0, "parent": null, "vector": [14, 0, 0.3125, 0.0312, 0, 0.66, 0.7273, 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_99992:Import_L13_C0", "label": "gtk import gtk, gtk.glade, pygtk", "type": "import", "loc": [13, 13], "level": 0, "parent": null, "vector": [1, 0, 0.4062, 0.0312, 0, 0.66, 0.8182, 166, 0, 3, 0, 0, 166, 0, 0], "semantic": {"name": "gtk", "arg_names": [], "import_names": ["gtk", "gtk.glade", "pygtk"], "rhs_call_name": "", "annotation": ""}, "snippet": "import gtk, gtk.glade, pygtk"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99992:ClassDef_L15_C0", "label": "ClearCutterUI", "type": "class", "loc": [15, 27], "level": 0, "parent": null, "vector": [3, 0, 0.6562, 0.4062, 0, 0.66, 0.9091, 685, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "ClearCutterUI", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "class ClearCutterUI:\n \"\"\"ClearCutter GTK frontend\"\"\"\n\n gladefile = \"\"\n wTree = \"\"\n def __init__(self):\n \n self.wTree = gtk.glade.XML(\"ccui.glade\") "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99992:Expr_L16_C4", "label": "expression", "type": "expression", "loc": [16, 16], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99992:ClassDef_L15_C0", "vector": [8, 1, 0.5, 0.0312, 1, 0.3, 0.0, 0, 1, 0, 0, 0, 0, 0, 0], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " \"\"\"ClearCutter GTK frontend\"\"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99992:Assign_L18_C4", "label": "gladefile =", "type": "assigned_variable", "loc": [18, 18], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99992:ClassDef_L15_C0", "vector": [14, 1, 0.5625, 0.0312, 1, 0.3, 0.3333, 132, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "gladefile", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " gladefile = \"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99992:Assign_L19_C4", "label": "wTree =", "type": "assigned_variable", "loc": [19, 19], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99992:ClassDef_L15_C0", "vector": [14, 1, 0.5938, 0.0312, 1, 0.3, 0.6667, 583, 1, 0, 0, 0, 0, 3, 0], "semantic": {"name": "wTree", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " wTree = \"\""}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99992:FunctionDef_L20_C4", "label": "__init__", "type": "function", "loc": [20, 27], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99992:ClassDef_L15_C0", "vector": [2, 1, 0.7344, 0.25, 1, 0.3, 1.0, 555, 0, 1, 0, 0, 0, 0, 3], "semantic": {"name": "__init__", "arg_names": ["self"], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " def __init__(self):\n \n self.wTree = gtk.glade.XML(\"ccui.glade\") \n \n #Get the Main Window, and connect the \"destroy\" event\n self.window = self.wTree.get_widget(\"MainWindow\")\n if (self.window):\n self.window.connect(\"destroy\", gtk.main_quit)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99992:Assign_L22_C8", "label": "self.wTree = XML()", "type": "assigned_variable", "loc": [22, 22], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99992:FunctionDef_L20_C4", "vector": [14, 2, 0.6875, 0.0312, 2, 0.02, 0.0, 900, 3, 1, 0, 0, 52, 10, 1], "semantic": {"name": "self.wTree", "arg_names": [], "import_names": [], "rhs_call_name": "XML", "annotation": ""}, "snippet": " self.wTree = gtk.glade.XML(\"ccui.glade\") "}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99992:Assign_L25_C8", "label": "self.window = get_widget()", "type": "assigned_variable", "loc": [25, 25], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99992:FunctionDef_L20_C4", "vector": [14, 2, 0.7812, 0.0312, 2, 0.02, 0.5, 313, 3, 1, 0, 0, 994, 10, 1], "semantic": {"name": "self.window", "arg_names": [], "import_names": [], "rhs_call_name": "get_widget", "annotation": ""}, "snippet": " self.window = self.wTree.get_widget(\"MainWindow\")"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99992:If_L26_C8", "label": "if", "type": "if", "loc": [26, 27], "level": 2, "parent": "ajibawa-2023/Python-Code-Large/train/row_99992:FunctionDef_L20_C4", "vector": [4, 2, 0.8281, 0.0625, 2, 0.02, 1.0, 0, 7, 0, 0, 0, 0, 0, 1], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": " if (self.window):\n self.window.connect(\"destroy\", gtk.main_quit)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99992:Expr_L27_C12", "label": "connect()", "type": "expression", "loc": [27, 27], "level": 3, "parent": "ajibawa-2023/Python-Code-Large/train/row_99992:If_L26_C8", "vector": [8, 3, 0.8438, 0.0312, 3, 0.98, 0.0, 242, 3, 2, 0, 0, 0, 0, 1], "semantic": {"name": "connect", "arg_names": [], "import_names": [], "rhs_call_name": "connect", "annotation": ""}, "snippet": " self.window.connect(\"destroy\", gtk.main_quit)"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99992:If_L30_C0", "label": "if", "type": "if", "loc": [30, 32], "level": 0, "parent": null, "vector": [4, 0, 0.9688, 0.0938, 0, 0.66, 1.0, 0, 0, 0, 0, 0, 0, 0, 2], "semantic": {"name": "", "arg_names": [], "import_names": [], "rhs_call_name": "", "annotation": ""}, "snippet": "if __name__ == \"__main__\":\n hwg = ClearCutterUI()\n gtk.main()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99992:Assign_L31_C4", "label": "hwg = ClearCutterUI()", "type": "assigned_variable", "loc": [31, 31], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99992:If_L30_C0", "vector": [14, 1, 0.9688, 0.0312, 1, 0.43, 0.0, 313, 3, 0, 0, 0, 685, 10, 1], "semantic": {"name": "hwg", "arg_names": [], "import_names": [], "rhs_call_name": "ClearCutterUI", "annotation": ""}, "snippet": " hwg = ClearCutterUI()"}, {"id": "ajibawa-2023/Python-Code-Large/train/row_99992:Expr_L32_C4", "label": "main()", "type": "expression", "loc": [32, 32], "level": 1, "parent": "ajibawa-2023/Python-Code-Large/train/row_99992:If_L30_C0", "vector": [8, 1, 1.0, 0.0312, 1, 0.43, 1.0, 624, 3, 0, 0, 0, 0, 0, 1], "semantic": {"name": "main", "arg_names": [], "import_names": [], "rhs_call_name": "main", "annotation": ""}, "snippet": " gtk.main()"}] | [{"f": "ajibawa-2023/Python-Code-Large/train/row_99992:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99992:Expr_L16_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99992:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99992:Assign_L18_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99992:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99992:Assign_L19_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99992:ClassDef_L15_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99992:FunctionDef_L20_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99992:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99992:Assign_L22_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99992:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99992:Assign_L25_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99992:FunctionDef_L20_C4", "t": "ajibawa-2023/Python-Code-Large/train/row_99992:If_L26_C8"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99992:If_L26_C8", "t": "ajibawa-2023/Python-Code-Large/train/row_99992:Expr_L27_C12"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99992:If_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99992:Assign_L31_C4"}, {"f": "ajibawa-2023/Python-Code-Large/train/row_99992:If_L30_C0", "t": "ajibawa-2023/Python-Code-Large/train/row_99992:Expr_L32_C4"}] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.